|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.faces.component.UIComponent javax.faces.component.UIComponentBase javax.faces.component.UIOutput com.sun.rave.web.ui.component.LabelBase
Use the ui:label
tag to display a label for a component. To specify which component
the label belongs to you can do one of the following:
ui:label
; or for
attribute of ui:label
to the id of the component to be labeled.If the tags are adjacent on the page, it is simpler to place the
component in the body of the ui:label
tag.
Note that many components in this library have label
and labelLevel
attributes (and sometimes
labelOnTop
) which can be used instead of ui:label
. The main reason
to use ui:label
is to specify the
appearance of the label beyond what these attributes permit.
The ui:label
tag results in a HTML <label>
or <span>
element. A <span>
element is rendered if no labeled component is found.
If the tag has a body, the body must consist of tags for
JavaServer Faces components only. The components become children
of the Label
component, and are rendered after the
<label>
element.
If the tag has a body but no for
attribute, a
<label>
element is rendered. Its
for
attribute is set to the element ID of the first
child component that is an EditableValueHolder.
The Label renderer relies on the following theme classes:
LblLev1Txt LblLev2Txt LblLev3Txt LblRqdDiv
None.
ui:label
with for
attribute<ui:label id="label1" text="Label 1:" for="field1" labelLevel="2"/> <ui:field id="field1" text="#{Bean.value}" type="text" trim="true"/>
ui:label
with labeled component in tag body<ui:label id="label2" text="Label 2:" labelLevel="2"/> <ui:field id="field2" text="#{Bean.value}" type="text" trim="true"/> </ui:label>
ui:label
<ui:field id="field3" text="#{Bean.value}" type="text" trim="true" label="Label 3:" labelLevel="2"/>
Auto-generated component class. Do NOT modify; all changes will be lost!
Field Summary |
Fields inherited from class javax.faces.component.UIOutput |
COMPONENT_FAMILY, COMPONENT_TYPE |
Constructor Summary | |
LabelBase()
Construct a new LabelBase . |
Method Summary | |
java.lang.String |
getFamily()
Return the family for this component. |
java.lang.String |
getFor()
Use this attribute to specify the labeled component. |
int |
getLabelLevel()
Style level for this label, where lower values typically specify progressively larger font sizes, and/or bolder font weights. |
java.lang.String |
getOnClick()
Scripting code executed when a mouse click occurs over this component. |
java.lang.String |
getOnMouseDown()
Scripting code executed when the user presses a mouse button while the mouse pointer is on the component. |
java.lang.String |
getOnMouseMove()
Scripting code executed when the user moves the mouse pointer while over the component. |
java.lang.String |
getOnMouseOut()
Scripting code executed when a mouse out movement occurs over this component. |
java.lang.String |
getOnMouseOver()
Scripting code executed when the user moves the mouse pointer into the boundary of this component. |
java.lang.String |
getOnMouseUp()
Scripting code executed when the user releases a mouse button while the mouse pointer is on the component. |
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. |
java.lang.Object |
getText()
The label text to be displayed for this label. |
java.lang.String |
getToolTip()
Display the text as a tooltip for this component |
javax.faces.el.ValueBinding |
getValueBinding(java.lang.String name)
Return the ValueBinding stored for the
specified name (if any), respecting any property aliases. |
boolean |
isHideIndicators()
Use the hideIndicators attribute to prevent display of the required and invalid icons with the label. |
boolean |
isRequiredIndicator()
Flag indicating that the labeled component should be marked as required. |
boolean |
isVisible()
Use the visible attribute to indicate whether the component should be viewable by the user in the rendered HTML page. |
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 |
setFor(java.lang.String _for)
Use this attribute to specify the labeled component. |
void |
setHideIndicators(boolean hideIndicators)
Use the hideIndicators attribute to prevent display of the required and invalid icons with the label. |
void |
setLabelLevel(int labelLevel)
Style level for this label, where lower values typically specify progressively larger font sizes, and/or bolder font weights. |
void |
setOnClick(java.lang.String onClick)
Scripting code executed when a mouse click occurs over this component. |
void |
setOnMouseDown(java.lang.String onMouseDown)
Scripting code executed when the user presses a mouse button while the mouse pointer is on the component. |
void |
setOnMouseMove(java.lang.String onMouseMove)
Scripting code executed when the user moves the mouse pointer while over the component. |
void |
setOnMouseOut(java.lang.String onMouseOut)
Scripting code executed when a mouse out movement occurs over this component. |
void |
setOnMouseOver(java.lang.String onMouseOver)
Scripting code executed when the user moves the mouse pointer into the boundary of this component. |
void |
setOnMouseUp(java.lang.String onMouseUp)
Scripting code executed when the user releases a mouse button while the mouse pointer is on the component. |
void |
setRequiredIndicator(boolean requiredIndicator)
Flag indicating that the labeled component should be marked as required. |
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. |
void |
setText(java.lang.Object text)
The label text to be displayed for this label. |
void |
setToolTip(java.lang.String toolTip)
Display the text as a tooltip for this component |
void |
setValueBinding(java.lang.String name,
javax.faces.el.ValueBinding binding)
Set the ValueBinding stored for the
specified name (if any), respecting any property
aliases. |
void |
setVisible(boolean visible)
Use the visible attribute to indicate whether the component should be viewable by the user in the rendered HTML page. |
Methods inherited from class javax.faces.component.UIOutput |
getConverter, getLocalValue, getValue, setConverter, setValue |
Methods inherited from class javax.faces.component.UIComponentBase |
addFacesListener, broadcast, decode, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, isRendered, isTransient, processDecodes, processRestoreState, processSaveState, processUpdates, processValidators, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public LabelBase()
Construct a new LabelBase
.
Method Detail |
public java.lang.String getFamily()
Return the family for this component.
public javax.faces.el.ValueBinding getValueBinding(java.lang.String name)
Return the ValueBinding
stored for the
specified name (if any), respecting any property aliases.
name
- Name of value binding to retrievepublic void setValueBinding(java.lang.String name, javax.faces.el.ValueBinding binding)
Set the ValueBinding
stored for the
specified name (if any), respecting any property
aliases.
name
- Name of value binding to setbinding
- ValueBinding to set, or null to removepublic java.lang.String getFor()
Use this attribute to specify the labeled component. The
attribute is only relevant if the component to be labeled is not
a child of the ui:label
tag. The value of the
attribute should be the id of the component relative to the
label, not the DOM ID of the rendered HTML element.
public void setFor(java.lang.String _for)
Use this attribute to specify the labeled component. The
attribute is only relevant if the component to be labeled is not
a child of the ui:label
tag. The value of the
attribute should be the id of the component relative to the
label, not the DOM ID of the rendered HTML element.
getFor()
public boolean isHideIndicators()
Use the hideIndicators attribute to prevent display of the required and invalid icons with the label. When the required attribute on the component to be labeled is set to true, the required icon is displayed next to the label. If the user submits the page with an invalid value for the component, the invalid icon is displayed. This attribute is useful when the component has more than one label, and only one label should show the icons.
public void setHideIndicators(boolean hideIndicators)
Use the hideIndicators attribute to prevent display of the required and invalid icons with the label. When the required attribute on the component to be labeled is set to true, the required icon is displayed next to the label. If the user submits the page with an invalid value for the component, the invalid icon is displayed. This attribute is useful when the component has more than one label, and only one label should show the icons.
isHideIndicators()
public int getLabelLevel()
Style level for this label, where lower values typically specify progressively larger font sizes, and/or bolder font weights. Valid values are 1, 2, and 3. The default label level is 2. Any label level outside this range will result in no label level being added.
public void setLabelLevel(int labelLevel)
Style level for this label, where lower values typically specify progressively larger font sizes, and/or bolder font weights. Valid values are 1, 2, and 3. The default label level is 2. Any label level outside this range will result in no label level being added.
getLabelLevel()
public java.lang.String getOnClick()
Scripting code executed when a mouse click occurs over this component.
public void setOnClick(java.lang.String onClick)
Scripting code executed when a mouse click occurs over this component.
getOnClick()
public java.lang.String getOnMouseDown()
Scripting code executed when the user presses a mouse button while the mouse pointer is on the component.
public void setOnMouseDown(java.lang.String onMouseDown)
Scripting code executed when the user presses a mouse button while the mouse pointer is on the component.
getOnMouseDown()
public java.lang.String getOnMouseMove()
Scripting code executed when the user moves the mouse pointer while over the component.
public void setOnMouseMove(java.lang.String onMouseMove)
Scripting code executed when the user moves the mouse pointer while over the component.
getOnMouseMove()
public java.lang.String getOnMouseOut()
Scripting code executed when a mouse out movement occurs over this component.
public void setOnMouseOut(java.lang.String onMouseOut)
Scripting code executed when a mouse out movement occurs over this component.
getOnMouseOut()
public java.lang.String getOnMouseOver()
Scripting code executed when the user moves the mouse pointer into the boundary of this component.
public void setOnMouseOver(java.lang.String onMouseOver)
Scripting code executed when the user moves the mouse pointer into the boundary of this component.
getOnMouseOver()
public java.lang.String getOnMouseUp()
Scripting code executed when the user releases a mouse button while the mouse pointer is on the component.
public void setOnMouseUp(java.lang.String onMouseUp)
Scripting code executed when the user releases a mouse button while the mouse pointer is on the component.
getOnMouseUp()
public boolean isRequiredIndicator()
Flag indicating that the labeled component should be marked as required. It is only relevant if the labeled component is not a child of the label tag. Set this flag to ensure that the required icon shows up the first time the page is rendered.
public void setRequiredIndicator(boolean requiredIndicator)
Flag indicating that the labeled component should be marked as required. It is only relevant if the labeled component is not a child of the label tag. Set this flag to ensure that the required icon shows up the first time the page is rendered.
isRequiredIndicator()
public java.lang.String getStyle()
CSS style(s) to be applied when this component is rendered.
public void setStyle(java.lang.String style)
CSS style(s) to be applied when this component is rendered.
getStyle()
public java.lang.String getStyleClass()
CSS style class(es) to be applied when this component is rendered.
public void setStyleClass(java.lang.String styleClass)
CSS style class(es) to be applied when this component is rendered.
getStyleClass()
public java.lang.Object getText()
The label text to be displayed for this label. This attribute
can be set to a literal string, to a value binding expression
that corresponds to a property of a managed bean, or to a value
binding expression that corresponds to a message from a resource
bundle declared using f:loadBundle
.
public void setText(java.lang.Object text)
The label text to be displayed for this label. This attribute
can be set to a literal string, to a value binding expression
that corresponds to a property of a managed bean, or to a value
binding expression that corresponds to a message from a resource
bundle declared using f:loadBundle
.
getText()
public java.lang.String getToolTip()
Display the text as a tooltip for this component
public void setToolTip(java.lang.String toolTip)
Display the text as a tooltip for this component
getToolTip()
public boolean isVisible()
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.
public void setVisible(boolean visible)
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.
isVisible()
public void restoreState(javax.faces.context.FacesContext _context, java.lang.Object _state)
Restore the state of this component.
public java.lang.Object saveState(javax.faces.context.FacesContext _context)
Save the state of this component.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |