com.sun.rave.web.ui.component
Class AnchorBase

java.lang.Object
  extended by javax.faces.component.UIComponent
      extended by javax.faces.component.UIComponentBase
          extended by com.sun.rave.web.ui.component.AnchorBase
All Implemented Interfaces:
javax.faces.component.StateHolder
Direct Known Subclasses:
Anchor

public abstract class AnchorBase
extends javax.faces.component.UIComponentBase

Use the ui:anchor tag to create HTML anchors in the rendered HTML page. You can then use ui:hyperlink tags that jump to the locations of the anchors in the page.

HTML Elements and Layout

The ui:anchor tag creates an <a> element in the rendered HTML page. The name and id attributes of the <a> element are both set to the value of the id attribute specified with the ui:anchor tag. The name attibute is included to maintain compatibility with older browsers.

Client Side Javascript Functions

None. 

Examples

Example 1: Create an anchor

<ui:anchor id="anchor1" />

This generates an anchor, with id and name set to the same value.
  
<a id="anchor1" name="anchor1" />

Example 2: Create a hyperlink to that will go to the anchor above

<ui:hyperlink id="gotoAnchor1" url="#anchor1" />

Example 3: Create a context  relative hyperlink to go to the anchor in Example 1

<ui:hyperlink id="gotoAnchor1" url="/faces/hyperlink.jsp#anchor1" />

Note:  In the url attribute, you must specify a path that maps to the correct servlet. However, you do not need the context. In this example, the
/faces part of the path maps to the servlet through the JSF FacesServlet as defined in the web.xml.

Auto-generated component class. Do NOT modify; all changes will be lost!


Field Summary
 
Fields inherited from class javax.faces.component.UIComponent
bindings
 
Constructor Summary
AnchorBase()
          Construct a new AnchorBase.
 
Method Summary
 java.lang.String getFamily()
          Return the identifier of the component family to which this component belongs.
 java.lang.String getStyle()
          CSS style(s) to be applied when this component is rendered.
 java.lang.String getStyleClass()
          CSS style class(es) to be applied when this component is rendered.
 void restoreState(javax.faces.context.FacesContext _context, java.lang.Object _state)
          Restore the state of this component.
 java.lang.Object saveState(javax.faces.context.FacesContext _context)
          Save the state of this component.
 void setStyle(java.lang.String style)
          CSS style(s) to be applied when this component is rendered.
 void setStyleClass(java.lang.String styleClass)
          CSS style class(es) to be applied when this component is rendered.
 
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, broadcast, decode, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, invokeOnComponent, isRendered, isTransient, processDecodes, processRestoreState, processSaveState, processUpdates, processValidators, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding
 
Methods inherited from class javax.faces.component.UIComponent
encodeAll, getContainerClientId, getValueExpression, setValueExpression
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AnchorBase

public AnchorBase()

Construct a new AnchorBase.

Method Detail

getFamily

public java.lang.String getFamily()

Return the identifier of the component family to which this component belongs. This identifier, in conjunction with the value of the rendererType property, may be used to select the appropriate Renderer for this component instance.

Specified by:
getFamily in class javax.faces.component.UIComponent

getStyle

public java.lang.String getStyle()

CSS style(s) to be applied when this component is rendered.


setStyle

public void setStyle(java.lang.String style)

CSS style(s) to be applied when this component is rendered.

See Also:
getStyle()

getStyleClass

public java.lang.String getStyleClass()

CSS style class(es) to be applied when this component is rendered.


setStyleClass

public void setStyleClass(java.lang.String styleClass)

CSS style class(es) to be applied when this component is rendered.

See Also:
getStyleClass()

restoreState

public void restoreState(javax.faces.context.FacesContext _context,
                         java.lang.Object _state)

Restore the state of this component.

Specified by:
restoreState in interface javax.faces.component.StateHolder
Overrides:
restoreState in class javax.faces.component.UIComponentBase

saveState

public java.lang.Object saveState(javax.faces.context.FacesContext _context)

Save the state of this component.

Specified by:
saveState in interface javax.faces.component.StateHolder
Overrides:
saveState in class javax.faces.component.UIComponentBase