Static Text Component |
You can drag the Static Text component
from
the Basic category of the Palette to the Visual Designer to provide instructions, titles,
headings, and similar text information for your pages. If you want to add a label to a component, use either a Label component or the component's label property, not the Static Text component.
After dragging the component to the Visual Designer, you can do a number of things with it:
text property.
text property, or binding the component to a database
or object that supplies the default value.text property. See List
of Converters for a full list of converters.
text property to an object or a data provider, as described in the topic Bind to Data Dialog Box.
text property to other objects or bean properties that update this component's properties automatically.
<ui:staticText id="staticText1"
text="At {1,time} on {1,date}, there were {2} on planet {0,number,integer}.">
<f:param id="param0" value="#{SessionBean1.myInt}"/>
<f:param id="param1" value="#{SessionBean1.myDate}"/>
<f:param id="param2" value="2 Spxfyzt"/>
</ui:staticText>
int named myInt and a property of type java.util.Date named myDate to SessionBean1 in the Projects Window, and that you bind the value properties of param0 and param1 respectively to these SessionBean1 properties. The parameterized text in this code sample will render something like, "At 8:36:18 AM on Dec 13, 2005, there were 2 spxfyzt on planet 7."
| Legal Notices. Copyright © 2006 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. |