| |||||||
FRAMES NO FRAMES |
Use the webuijsf:anchor
tag to
The value of the id attribute of the rendered anchor element will be the component id, not the component's client id. In order to obtain the DOM node of the anchor element, on the client, the component id must be used and not the component's client id. This means that the component id must be unique in the page and not just unique within the closest NamingContainer.
None
document.getElementById(id).setProps({disabled:
true})
.getProps() |
Use this function to get widget properties. See setProps()
function for a list of supported properties. |
refresh(execute) |
Use this function to
asynchronously refresh the component.
|
setProps(props) |
Use this function to change any of the following supported
properties:
|
When the component is manipulated on the client side, some functions may
publish event topics for custom Ajax implementations to listen for.
Using the Dojo event system, listen for the refresh event topic by using:
<webuijsf:script>
var processEvents =
{
update: function(props) {
//
Do something...
}
}
// Subscribe to refresh event.
dojo.subscribe(webui.suntheme.widget.anchor.event.<eventname>.endTopic,
processEvents, "update");
</webuijsf:script>
webui.suntheme.widget.anchor.event.refresh.beginTopic | Event topic published before asynchronously refreshing the
component. Supported properties include:
|
webui.suntheme.widget.anchor.event.refresh.endTopic | Event topic published after asynchronously refreshing the
component. Supported properties include:See setProps() function.
|
<webuijsf:anchor id="anchor1" url="http://www.sun.com"/>
<a id="foo" />
Note: To access this on the client side, use document.getElementById("anchor1");
<webuijsf:hyperlink id="link1"url="#anchor1" > Go to Anchor
</webuijsf:hyperlink >
<webuijsf:anchor id="gotoAnchor1"
url="/faces/hyperlink.jsp#anchor1" />
url
attribute, you must specify a path
that maps to the correct servlet. However, you do not need the context.
In this example, the
part of the path maps to the
servlet through the JSF FacesServlet as defined in the web.xml.
<webuijsf:anchor id="anchor1" > This is an anchor
</webuijsf:anchor >
<webuijsf:button id="button1" text="Hide Anchor"
onClick="toggleVisible()"/>
<script type="text/javascript">
function toggleVisible() {
var domNode =
document.getElementById("anchor1");
var props = domNode.getProps();
if (domNode != null) {
domNode.setProps({"visible":!props.visible});
}
}
</script>
<webuijsf:anchor id="anchor1"
text="#{MyBean.text}"/
<webuijsf:button id="
>
button1
" text="#{MyBean.text}" onClick="refreshAnchor();return false;"/>
<webuijsf:script>
function refreshAnchor() {
var domNode =
document.getElementById("form1:anchor1"); // Get anchor
return domNode.refresh(); //
Asynchronously refresh anchor
}
</webuijsf:script>
Note that the refresh function can optionally take a list of
elements
to execute. Thus, a comma-separated list of ids can be provided to
update components server-side: refresh("form1:id1,form2:id2,..."). When
no parameter is given, the refresh function acts as a reset.
That is, the component will be redrawn using values set
server-side, but not updated.text="#{MyBean.text}"/
<webuijsf:anchor id="anchor1"
>
<webuijsf:textField id="field1" text="#{MyBean.text}" label="Change Anchor Text"
onKeyPress="setTimeout('refreshAnchor();', 0);"/> // Field used to asynchronously update text.
<webuijsf:script>
function
refreshAnchor
() {
var domNode =
document.getElementById("form1:anchor1"); // Get anchor
return
domNode.refresh("form1:field1"); // Asynchronously refresh while
submitting field value
}
</webuijsf:script>
Note that the refresh function can optionally take a list of
elements
to execute. Thus, a comma-separated list of ids can be provided to
update components server-side: refresh("form1:id1,form2:id2,...")Tag Information | |
Tag Class | com.sun.webui.jsf.component.AnchorTag |
TagExtraInfo Class | None |
Body Content | JSP |
Display Name | None |
Attributes | ||||
Name | Required | Request-time | Type | Description |
binding | false | false | java.lang.String | A ValueExpression that resolves to the UIComponent that corresponds to this tag. This binding allows the Java bean that contains the UIComponent to manipulate the UIComponent, its properties, and its children. |
shape | false | false | java.lang.String | The shape of the hot spot on the screen (for use in client-side image maps). Used with the coords attribute.Valid values are: default (entire region); rect (rectangular region); circle (circular region); and poly (polygonal region). |
onKeyPress | false | false | java.lang.String | Scripting code that is executed when the user presses and releases a key while the component has focus. |
target | false | false | java.lang.String | The resource at the specified URL is displayed in the frame that is specified with the target attribute. Values such as "_blank" that are valid for the target attribute of a HTML anchor element are also valid for this attribute in this component |
onFocus | false | false | java.lang.String | Scripting code that is executed when the anchor component receives focus. An element receives focus when the user selects the element by pressing the tab key or clicking the mouse. |
charset | false | false | java.lang.String | Specifies the character encoding of the target URL |
urlLang | false | false | java.lang.String | The language code of the resource designated by this anchor. |
rev | false | false | java.lang.String | Specifies the relationship between the target URL and the current document |
onKeyUp | false | false | java.lang.String | Scripting code executed when the user releases a key while the component has focus. |
onMouseUp | false | false | java.lang.String | Scripting code executed when the user releases a mouse button while the mouse pointer is on the component. |
styleClass | false | false | java.lang.String | CSS style class or classes to be applied to the outermost HTML element when this component is rendered. |
style | false | false | java.lang.String | CSS style or styles to be applied to the outermost HTML element when this component is rendered. |
url | false | false | java.lang.String | Absolute, relative, or context relative (starting with "/") URL to the resource selected by this anchor. If the url attribute is specified, clicking the anchor sends the browser to the new location. If UIParameter components are specified as child to the anchor component, then the renderer processes these name value pairs of the UIParameter components and appends them as query parameters to the specified url. |
onClick | false | false | java.lang.String | Scripting code that is executed when a mouse click occurs over this component. If the component submits the form (by using the action attribute), the script that you use with the onClick attribute should not return from the function. When the action attribute is used, the component handles the return with a script that is appended to the anchor element's onclick property. When you supply an onClick attribute, this return script is appended after your script in the anchor's onclick. You can return from your script to abort the submit process if necessary. |
onBlur | false | false | java.lang.String | Scripting code executed when this element loses focus. |
toolTip | false | false | java.lang.String | Sets the value of the title attribute for the HTML element. The specified text will display as a tooltip if the mouse cursor hovers over the HTML element. |
onMouseDown | false | false | java.lang.String | Scripting code executed when the user presses a mouse button while the mouse pointer is on the component. |
type | false | false | java.lang.String | The MIME content type of the resource specified by the anchor component. |
disabled | false | false | java.lang.String | Flag indicating that clicking this component by the user is not currently permitted. |
accessKey | false | false | java.lang.String | This attribute assigns an access key to an element. An access key is a single character from the document character set. |
onMouseOut | false | false | java.lang.String | Scripting code executed when a mouse out movement occurs over this component. |
onMouseOver | false | false | java.lang.String | Scripting code executed when the user moves the mouse pointer into the boundary of this component. |
htmlTemplate | false | false | java.lang.String | Get alternative HTML template to be used by the anchor component. |
onMouseMove | false | false | java.lang.String | Scripting code executed when the user moves the mouse pointer while over the component. |
text | false | false | java.lang.String | The text to be displayed for the anchor element. |
rel | false | false | java.lang.String | Specifies the relationship between the current document and the target URL |
visible | false | false | java.lang.String | Use the visible attribute to indicate whether the component should be viewable by the user in the rendered HTML page. If set to false, the HTML code for the component is present in the page, but the component is hidden with style attributes. By default, visible is set to true, so HTML for the component HTML is included and visible to the user. If the component is not visible, it can still be processed on subsequent form submissions because the HTML is present. |
onKeyDown | false | false | java.lang.String | Scripting code that is executed when the user presses down on a key while the anchor component has focus. |
tabIndex | false | false | java.lang.String | Position of this element in the tabbing order of the current document. Tabbing order determines the sequence in which elements receive focus when the tab key is pressed. The value must be an integer between 0 and 32767. |
coords | false | false | java.lang.String | Specifies the coordinates appropriate to the shape attribute to define a region of an image for image maps |
rendered | false | false | java.lang.String | Use the rendered attribute to indicate whether the HTML code for the component should be included in the rendered HTML page. If set to false, the rendered HTML page does not include the HTML for the component. If the component is not rendered, it is also not processed on any subsequent form submission. |
id | false | true | java.lang.String | No Description |
Variables | No Variables Defined. |
| |||||||
FRAMES NO FRAMES |