<?xml version='1.0' encoding='UTF-8'?>
<facelet-taglib xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-facelettaglibrary_2_0.xsd"
version="2.0">
<namespace>http://jsfcompref.com/example</namespace>
<tag>
<tag-name>helloworld</tag-name>
<component><component-type>HtmlHelloWorld</component-type></component>
</tag>
</facelet-taglib>
Now that we’ve created a simple, but fully functional component, we can begin adding
attributes to the component. Because HtmlHelloWorld extends from UIComponentBase,
UIComponent properties from the superclass such as id, binding, rendered are already
available for use in the Facelet page.
Prior to JSF 2.0, component state was typically stored in instance
variables on the UIComponent subclass. For example, the UIInput component has a valid
property, which indicates whether this component is valid or not. This value would be stored
in a simple boolean instance variable, accessed via a JavaBeans getter and setter and handled
explicitly in the saveState( ) and restoreState( ) methods. JSF 2.0 introduces the StateHelper
interface to make this sort of activity easier and less error prone.
Friday, March 18, 2011
Wednesday, March 16, 2011
JSF2 complete reference - again 3
TIP OF THE DAY: make the order button a composite component
Finally, notice the @FacesComponent annotation. This annotation is an alternative for
the following XML in the faces-config.xml file:
<component>
<component-type>HtmlHelloWorld</component-type>
<component-class>
com.jsfcompref.components.component.HtmlHelloWorld
</component-class>
</component>
310
Finally, notice the @FacesComponent annotation. This annotation is an alternative for
the following XML in the faces-config.xml file:
<component>
<component-type>HtmlHelloWorld</component-type>
<component-class>
com.jsfcompref.components.component.HtmlHelloWorld
</component-class>
</component>
310
Tuesday, March 15, 2011
JSF2 complete reference - again 2
For example <h:outputLabel
for="#{cc.clientId}:userid" value="Userid:" />
causes the label to have the correct absolute
client ID to the actual userid text field.
<h:inputSecret required="true"
validatorMessage="#{cc.attrs.passwordValidatorMessage}"
requiredMessage="Password is required" id="password" />
for="#{cc.clientId}:userid" value="Userid:" />
causes the label to have the correct absolute
client ID to the actual userid text field.
<h:inputSecret required="true"
validatorMessage="#{cc.attrs.passwordValidatorMessage}"
requiredMessage="Password is required" id="password" />
Monday, March 14, 2011
JSF2 complete reference - again 1
UI component is something that has
appearance, state, and behavior.
xmlns:vt="http://java.sun.com/jsf/composite/trainer"
vt:loginPanel
that means the file is src/main/webapp/resources/trainer/loginPanel.xhtml.
301 .....1:40, 2:46 at least
appearance, state, and behavior.
xmlns:vt="http://java.sun.com/jsf/composite/trainer"
vt:loginPanel
that means the file is src/main/webapp/resources/trainer/loginPanel.xhtml.
301 .....1:40, 2:46 at least
Thursday, March 3, 2011
Wednesday, January 12, 2011
Tuesday, January 4, 2011
Subscribe to:
Posts (Atom)