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" binding="#{cc.temptI}"/> <h:commandButton id="tempconv_button" value="Convert"> <f:ajax execute="@form" render="@form"/> ...