Writing contracts for composite components

In this section, you will see how to write contracts for composite components. For this, we will use the Temperature composite component developed in Chapter 10, JSF Custom Components. The implementation section in the code is given as follows:

<cc:implementation> <div id="#{cc.clientId}:tempconv_main"> <h:outputLabel id="tempconv_smlabel" for="tempconv_selectonemenu" value="Convert to:"/> <h:selectOneMenu id="tempconv_selectonemenu" binding="#{cc.unittoI}"> <f:selectItem itemValue="fahrenheit" itemLabel="fahrenheit" /> <f:selectItem itemValue="celsius" itemLabel="celsius" /> </h:selectOneMenu> <h:outputLabel id="tempconv_iflabel" for="tempconv_inputfield" value="Insert value:"/> <h:inputText id="tempconv_inputfield" ...

Get Mastering JavaServer Faces 2.2 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.