Event Listener Adapter

As described in Chapter 2, the UIInput component delivers a ValueChangeEvent to all registered event listeners. In addition, the ValueChangeEvent is also delivered to the backing bean via a MethodBinding stored in the UIInput's valueChangeListener attribute. The valueChangeListener attribute is exposed as a tag attribute on the standard input tags, such as lt h inputText gt .In JSF 1.2, the valueChangeListener attribute is deprecated on the UIInput component but is still present on the JSP tag...

The HTC Deck Element Behavior

The structure of the lt pro showOneDeck gt component is slightly different from the lt pro inputDate gt component, since it is of a composite nature. If you look at what is needed to create the deck component in a JSP page, you need three JSP tag handlers lt pro showOneDeck gt , lt pro showItem gt , and lt f facet name header gt . lt pro showOneDeck gt is a container for lt pro showItem gt and defines which lt pro showItem gt should be expanded by default. lt pro showItem gt is also a container...

Requirements for the Date Field Component

You can build your own reusable component in many ways, but for JSF the most common approach is to locate a component that already has the behavior you need and expand upon it. So, what type of behavior is required of the component you will build in this chapter For example, is it for inputting values, selecting one value, selecting many values, or navigating Well, you'll build a component that can take a value, process that value, and then push it back to the underlying model as a strongly...

Jsf Namingcontainer

To ensure each component's uniqueness, JSF provides a NamingContainer marker interface. Within a component implementing NamingContainer, each child component is required to have a locally unique identifier. This is enforced by the renderView method on ViewHandler, and in JSP-based applications it is also enforced by the UIComponentTag. The only time it would be useful to implement NamingContainer for your own component would be if your component stamped out its children in a similar fashion to...

Jsf Setproperties

JSF 1.2 supports the direct use of JSP 2.1 ValueExpression and MethodExpression, rather than passing a String to the tag handler and requiring it to parse the expression internally. As a result, the UIComponentTagSupport setStringProperty method described in this chapter would change as follows for JSF 1.2 protected void setStringProperty UIComponent component, String attrName, value value.getExpressionString If the ValueExpression is actually just literal text, then this text is pushed...

Step Creating a JSP Tag Handler and TLD

The last step in your initial blueprint is to create a JSP tag handler. To build a JSF application, you need some way of describing the structure of your application, and the default view technology for page descriptions, which must be provided by any JSF implementation, is JSP. One of the benefits of making JSP the default language is its broad adoption among Web application developers, and by leveraging this broad developer knowledge about JSP, building JSF applications using JSP as page...

Tag Library Descriptor

You have now implemented three tag handler classes ProShowOneDeckTag, ShowItemTag, and ShowListenerTag and as with all JSP tag handler classes, you need to declare them in a TLD, as shown in Code Sample 3-39. The custom actions for the three new tag handlers will be added to the same TLD and follow the same pattern as the ProlnputDateTag tag handler declared in Chapter 2. lt xml version 1.0 encoding UTF-8 gt lt DOCTYPE taglib PUBLIC - Sun Microsystems, Inc. DTD JSP Tag Library 1.2 EN gt This...

A ComponentBased UI Framework

We have set the stage for the book, so it is now time to focus on the pieces that are differentiating JSF from other technologies UlComponents. JSF is a component-based UI framework where components, such as HtmlDataTable and HtmlPanelGrid, can be viewed as prefabricated blocks that allow application developers to productively build complex applications with reusable components. It also allows application developers to focus on the application logic rather than on building the dynamic rich...

UlComponent

The foundations of all JSF components are the abstract UIComponent and UIComponentBase classes. The UIComponent class javax.faces.component.UIComponent defines the behavioral agreement and state information for all components, and the UIComponentBase class javax. faces.component.UIComponentBase is a convenience subclass that implements almost all methods of the UIComponent class. A simplified description of a UIComponent is that it is a regular JavaBean with properties, events, and listeners....