|
BEA NetUI tags and APIs are included for backward compatibility only. For new applications, use the Beehive tags and APIs. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.servlet.jsp.tagext.TagSupport javax.servlet.jsp.tagext.BodyTagSupport com.bea.wlw.netui.tags.AbstractBaseTag com.bea.wlw.netui.tags.html.Anchor com.bea.wlw.netui.tags.html.ImageAnchor
public class ImageAnchor
Generates a hyperlink with a clickable image. ImageAnchor provides support for image rollovers. An imageAnchor must have one of five attributes to correctly create the hyperlink:
Attribute Descriptions | |||
---|---|---|---|
Attribute | Required | Runtime Expression Evaluation | Data Bindable |
accessKey | No | No | No |
Define the keyboard navigation key for the element. | |||
action | No | No | Read Only |
An action invoked by clicking the link. | |||
align | No | No | No |
Property to specify where to align the image. | |||
alt | No | No | Read Only |
Property to specify alt text of an image. | |||
border | No | No | Read Only |
The border size around the image | |||
formSubmit | No | No | No |
True if clicking this link should submit its enclosing form . | |||
forward | No | No | No |
The logical forward name from which to retrieve the hyperlink URI. | |||
height | No | No | Read Only |
The image height | |||
href | No | No | Read Only |
A URL to go to. | |||
hspace | No | No | Read Only |
The horizontal spacing around the image | |||
id | No | No | No |
The id attribute has been deprecated; instead, use
tagId . The id attribute of the generated ImageAnchor. You should use the tagId
which will encode the id correctly for containers such as the Portal which needs to rewrite
IDs to make them unique. | |||
isMap | No | No | No |
The server-side image map declaration. | |||
linkName | No | No | No |
An internal place in the page to move to. | |||
location | No | No | No |
Location within the URI to visit. | |||
lowsrc | No | No | No |
The low resolution image source URI. | |||
page | No | No | No |
The page attribute has been deprecated.
The module-relative page URL to which this hyperlink will be rendered. | |||
rolloverImage | No | No | No |
The URI of the rollover image. | |||
src | No | No | Read Only |
The image source URI | |||
target | No | No | No |
The window target. | |||
tagId | No | No | No |
The id of this imageAnchor. The real id written to the HTML stream
may be changed by the container (Portal), but may be looked up with the tagId
value through the JavaScript method getNetuiTagName( tagId, tag ) method written by
the <netui:html> tag. | |||
useMap | No | No | No |
The client-side image map declaration. | |||
vspace | No | No | Read Only |
The vertical spacing around the image. | |||
width | No | No | Read Only |
The image width. |
<netui:imageAnchor href="index.jsp" src="top.jpg" height="25" width="25" />
Generates a hyperlink with a clickable image. Provides support for image rollovers.
The <netui:imageAnchor> tag must have one of five attributes to correctly create the hyperlink:
action
- an action method invoked by clicking the hyperlinkforward
- a forward to redirect tohref
- an URL to go tolinkName
- an internal place in the page to move topage
- the module-relative page URL to which this hyperlink will be rendered
JavaScript
If an <netui:imageAnchor> sets the formSubmit
attribute to true
and no
onClick
attribute is set, the following JavaScript function will be written into the page.
The JavaScript function will be referenced by the onclick
attribute of the generated image
anchor, and will cause the parent form to submit:
function submit[formname][formAction]Form() { for(var i=0; i<document.forms.length; i++) { if (document.forms[i].id == "[formAction]") { document.forms[i].method = "POST"; document.forms[i].action = "[formAction]"; document.forms[i].submit(); } } }
It is possible to write a custom onClick
JavaScript event handler that would
do additional work, for example form validation, and still submit the form correctly. To
accomplish this, reference a JavaScript function in the onClick
attribute:
<netui:imageAnchor formSubmit="true" onClick="SubmitFromAnchor();return false;"> View Results </netui:imageAnchor>
And add the referenced JavaScript function to the page:
function SubmitFromAnchor() { // implement custom logic here for(var i=0; i<document.forms.length; i++) { // submit to the action /aWebapp/formPost.do if (document.forms[i].action == "/aWebapp/formPost.do") { document.forms[i].method="POST"; document.forms[i].action="/aWebapp/formPost.do"; document.forms[i].submit(); } } }
This will cause the JavaScript function to be executed before posting the form.
Field Summary | |
---|---|
protected String |
src
|
Fields inherited from class com.bea.wlw.netui.tags.html.Anchor |
---|
_state, HREF, id |
Fields inherited from class com.bea.wlw.netui.tags.AbstractBaseTag |
---|
ATTR_GENERAL, ATTR_GENERAL_EXPRESSION, ATTR_JAVASCRIPT, ATTR_STYLE, JAVASCRIPT_STATUS, NETUI_UNIQUE_CNT |
Fields inherited from class javax.servlet.jsp.tagext.BodyTagSupport |
---|
bodyContent |
Fields inherited from class javax.servlet.jsp.tagext.TagSupport |
---|
pageContext |
Fields inherited from interface com.bea.wlw.netui.tags.html.HtmlConstants |
---|
ACCEPT, ACCESSKEY, ACTION, ALIGN, ALINK, ALT, ANCHOR, BACKGROUND, BASE, BGCOLOR, BODY, BORDER, BR, CAPTION, CELLPADDING, CELLSPACING, CHAR, CHAROFF, CHARSET, CHECKED, CLASS, COLS, COORDS, DIR, DISABLED, DIV, ENCTYPE, FOR, FORM, FORM_GET, FORM_POST, FRAME, HEIGHT, HREFLANG, HSPACE, HTML, ID, IMAGE, INPUT, INPUT_BUTTON, INPUT_CHECKBOX, INPUT_FILE, INPUT_HIDDEN, INPUT_IMAGE, INPUT_PASSWORD, INPUT_RADIO, INPUT_RESET, INPUT_SUBMIT, INPUT_TEXT, ISMAP, LABEL, LANG, LINK, LONGDESC, MAXLENGTH, METHOD, NAME, ONBLUR, ONCHANGE, ONCLICK, ONDBLCLICK, ONFOCUS, ONKEYDOWN, ONKEYPRESS, ONKEYUP, ONLOAD, ONMOUSEDOWN, ONMOUSEMOVE, ONMOUSEOUT, ONMOUSEOVER, ONMOUSEUP, ONRESET, ONSELECT, ONSUBMIT, ONUNLOAD, OPTION, READONLY, REL, REV, ROWS, RULES, SELECT, SHAPE, SIZE, SPAN, SRC, STYLE, SUMMARY, TABINDEX, TABLE, TARGET, TD, TEXT, TEXTAREA, TITLE, TR, TYPE, USEMAP, VALIGN, VALUE, VLINK, VSPACE, WIDTH |
Fields inherited from interface javax.servlet.jsp.tagext.BodyTag |
---|
EVAL_BODY_BUFFERED, EVAL_BODY_TAG |
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag |
---|
EVAL_BODY_AGAIN |
Fields inherited from interface javax.servlet.jsp.tagext.Tag |
---|
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE |
Constructor Summary | |
---|---|
ImageAnchor()
|
Method Summary | |
---|---|
int |
doEndTag()
Render the image and hyperlink. |
int |
doStartTag()
Insert rollover javascript. |
String |
getAccessKey()
Gets the accessKey attribute value. |
String |
getAlign()
Gets the property to specify where to align the image. |
String |
getAlt()
Gets the property to specify alt text of the image. |
String |
getBorder()
Gets the border size around the image. |
String |
getHeight()
Gets the image height. |
String |
getHspace()
Gets the horizontal spacing around the image. |
String |
getIsmap()
Gets the server-side image map declaration. |
String |
getLowsrc()
Gets the low resolution image source URI. |
String |
getPage()
Gets the module-relative path, starting with a slash character, of the image to be displayed by this rendered tag. |
String |
getRolloverImage()
Gets the roll-over image of the ImageAnchor. |
String |
getSrc()
Gets the image source URI. |
String |
getTagName()
Return the name of the Tag. |
String |
getUsemap()
Gets the client-side image map declaration. |
String |
getVspace()
Gets the vertical spacing around the image. |
String |
getWidth()
Gets the image width. |
protected void |
localRelease()
Release any acquired resources. |
void |
setAccessKey(String accessKey)
Sets the accessKey attribute value. |
void |
setAlign(String align)
Sets the property to specify where to align the image. |
void |
setAlt(String alt)
Sets the property to specify the alt text of the image. |
void |
setAttribute(String name,
String value)
Set an attribute value. |
void |
setBorder(String border)
Sets the border size around the image. |
void |
setHeight(String height)
Sets the image height. |
void |
setHspace(String hspace)
Sets the the horizontal spacing around the image. |
void |
setIsmap(String ismap)
Sets the server-side image map declaration. |
void |
setLowsrc(String lowsrc)
Sets the the low resolution image source URI. |
void |
setPage(String page)
Sets the module-relative path, starting with a slash character, of the image to be displayed by this rendered tag. |
void |
setRolloverImage(String rolloverImage)
Sets the roll-over image of the ImageAnchor. |
void |
setSrc(String src)
Sets the image source URI. |
void |
setUsemap(String usemap)
Sets the client-side image map declaration. |
void |
setVspace(String vspace)
Sets the vertical spacing around the image. |
void |
setWidth(String width)
Sets the image width. |
protected String |
src()
Return the base source URL that will be rendered in the src
property for this generated element, or null if there is
no such URL. |
protected String |
url(String url)
Return the specified src URL, modified as necessary with optional request parameters. |
Methods inherited from class com.bea.wlw.netui.tags.html.Anchor |
---|
addParameter, calculateURL, createAnchorBeginTag, doAfterBody, getAction, getFormAction, getFormActionURL, getFormSubmit, getForward, getHref, getId, getLinkName, getLocation, getOnBlur, getOnClick, getOnDblClick, getOnFocus, getOnKeyDown, getOnKeyPress, getOnKeyUp, getOnMouseDown, getOnMouseMove, getOnMouseOut, getOnMouseOver, getOnMouseUp, getRealFormName, getStyle, getStyleClass, getTabindex, getTagId, getTarget, setAction, setFormSubmit, setForward, setHref, setId, setLinkName, setLocation, setOnBlur, setOnClick, setOnDblClick, setOnFocus, setOnKeyDown, setOnKeyPress, setOnKeyUp, setOnMouseDown, setOnMouseMove, setOnMouseOut, setOnMouseOver, setOnMouseUp, setStyle, setStyleClass, setTabindex, setTagId, setTarget, stripSlashes |
Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport |
---|
doInitBody, getBodyContent, getPreviousOut, setBodyContent |
Methods inherited from class javax.servlet.jsp.tagext.TagSupport |
---|
findAncestorWithClass, getParent, getValue, getValues, removeValue, setParent, setValue |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.servlet.jsp.tagext.Tag |
---|
getParent, setParent |
Field Detail |
---|
protected String src
Constructor Detail |
---|
public ImageAnchor()
Method Detail |
---|
public String getTagName()
getTagName
in class Anchor
public void setAttribute(String name, String value) throws javax.servlet.jsp.JspException
Anchor
name
represents
the name of the attribute.
The value
represents the value and may contain
a netui expression. This method may result in errors being generated.
This requires that the tag buffer its body and
write attributes in the end tag. For the anchor tag it is not legal to set
the id
, name
, or href
attributes with this method.
setAttribute
in interface IAttributeConsumer
setAttribute
in class Anchor
name
- The name of the attribute. This value may not be null or the empty string.value
- The value of the attribute. This may contain a netui expression.
javax.servlet.jsp.JspException
- A JspException may be thrown if there is an error setting the attribute.public String getAlign()
public void setAlign(String align)
align
- - the image alignment.public String getAlt()
public void setAlt(String alt)
alt
- - the image alignment.public String getAccessKey()
getAccessKey
in class Anchor
public void setAccessKey(String accessKey)
A, C, E, F, G,
H, V, left arrow, and right arrow
.
setAccessKey
in class Anchor
accessKey
- - the accessKey value.A, C, E, F, G,
H, V, left arrow, and right arrow
public String getBorder()
public void setBorder(String border)
border
- - the border size.public String getHeight()
public void setHeight(String height)
height
- - the height.public String getHspace()
public void setHspace(String hspace)
hspace
- - the horizontal spacing.public String getIsmap()
public void setIsmap(String ismap)
ismap
- - the image map declaration.public String getLowsrc()
public void setLowsrc(String lowsrc)
lowsrc
- - the low-res image source URI.public String getPage()
getPage
in class Anchor
public void setPage(String page)
setPage
in class Anchor
page
- - the module-relative path.public String getRolloverImage()
public void setRolloverImage(String rolloverImage)
rolloverImage
- - the rollover image.public String getSrc()
public void setSrc(String src)
src
- - the image source URI.public String getUsemap()
public void setUsemap(String usemap)
usemap
- - the map declaration.public String getVspace()
public void setVspace(String vspace)
vspace
- - the vertical spacing.public String getWidth()
public void setWidth(String width)
width
- - the image width.public int doStartTag() throws javax.servlet.jsp.JspException
Support for indexed property since Struts 1.1
doStartTag
in interface javax.servlet.jsp.tagext.Tag
doStartTag
in class Anchor
javax.servlet.jsp.JspException
- if a JSP exception has occurredpublic int doEndTag() throws javax.servlet.jsp.JspException
doEndTag
in interface javax.servlet.jsp.tagext.Tag
doEndTag
in class Anchor
javax.servlet.jsp.JspException
- if a JSP exception has occurredprotected void localRelease()
localRelease
in class Anchor
protected String src() throws javax.servlet.jsp.JspException
src
property for this generated element, or null
if there is
no such URL.
javax.servlet.jsp.JspException
- if an error occursprotected String url(String url) throws javax.servlet.jsp.JspException
url
- The URL to be modified (or null if this url will not be used)
javax.servlet.jsp.JspException
- if an error occurs preparing the URL
|
BEA NetUI tags and APIs are included for backward compatibility only. For new applications, use the Beehive tags and APIs. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |