You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by im...@apache.org on 2006/02/17 21:59:24 UTC

svn commit: r378624 - /myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/inputAjax.jsp

Author: imario
Date: Fri Feb 17 12:59:22 2006
New Revision: 378624

URL: http://svn.apache.org/viewcvs?rev=378624&view=rev
Log:
enhanced ComponentUtils.findFirstMessagesComponent to traverse through facets too
added a minimalistic panelLayout to inputAjax.jsp to place all the components within a facets

Modified:
    myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/inputAjax.jsp

Modified: myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/inputAjax.jsp
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/inputAjax.jsp?rev=378624&r1=378623&r2=378624&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/inputAjax.jsp (original)
+++ myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/inputAjax.jsp Fri Feb 17 12:59:22 2006
@@ -59,131 +59,136 @@
     help of the errorStyleClass or errorStyle attribute of the ajax fields where the error have occured. </p> <br/>
 <f:view>
 
-<h:form>
-
-    <h:panelGrid>
-
-        <h:panelGrid>
-            <h:outputText styleClass="standard_bold" value="Input Some Text" />
-            <h:panelGrid columns="2">
-                <s:inputTextAjax value="#{inputAjaxBean.text1}" id="text1"
-                                 validator="#{inputAjaxBean.validateText1}"
-                                 errorStyle="border:1px solid red; color:red;"/>
-                 <t:message forceSpan="true" styleClass="errorMessage" for="text1"></t:message>
-            </h:panelGrid>
-            <f:verbatim>This component demonstrates ajax updating ability when you change the
-                text. <br/> An error message is displayed if the given String is greater than 5 characters.</f:verbatim>
-        </h:panelGrid>
-
-        <f:verbatim><br/></f:verbatim>
-
-        <h:panelGrid>
-            <h:outputText styleClass="standard_bold" value="Input Some Text"/>
-            <h:panelGrid columns="2">
-                <s:inputTextAjax value="#{inputAjaxBean.text2}"
-                                 id="text2"
-                                 showOkButton="true"
-                                 showCancelButton="true"
-                                 validator="#{inputAjaxBean.validateText2}">
-                    <f:valueChangeListener type="org.apache.myfaces.custom.inputAjax.SampleValueChangeListener"/>
-                </s:inputTextAjax>
-                <t:message forceSpan="true" for="text2" style="color:red; font-weight:bold;"/>
-            </h:panelGrid>
-            <f:verbatim>This component demonstrates ajax updating ability, but you must click Ok for it to send.<br/>
-                Cancel will clear the text and not send an update. Will show a validation error if the string is
-                less then 3 characters.</f:verbatim>
-        </h:panelGrid>
-
-         <f:verbatim><br/></f:verbatim>
-
-        <h:panelGrid columns="1">
-            <h:outputText styleClass="standard_bold" value="Input a Date"/>
-            <h:panelGrid columns="2">
-                <s:inputTextAjax value="#{inputAjaxBean.date1}"
-                                 id="date1"
-                                 errorStyleClass="errorField">
-                    <s:convertDateTime pattern="yyyy-MM-dd"/>
-                </s:inputTextAjax>
-                <t:message for="date1" forceSpan="true" styleClass="errorMessage"/>
-            </h:panelGrid>
-            <f:verbatim>This component demonstrates error handling capabilities, enter an invalid string to see the
-                error returned from the server through ajax.</f:verbatim>
-        </h:panelGrid>
-
-         <f:verbatim><br/></f:verbatim>
-
-        <h:panelGrid>
-            <h:panelGrid style="border:1px solid #71A5A5; background-color:rgb(236, 243, 225); width:450px;height:50px;">
-                <t:messages forceSpan="true" styleClass="errorMessage"> </t:messages>
-            </h:panelGrid>
-            <f:verbatim>This is the thomahawk messages component with forceRenderSpan set to true. <br/>
-                    All messages which are generated by the inputTextAjax fields are displayed here.
-            </f:verbatim>
-        </h:panelGrid>
-
-         <f:verbatim><br/><br/></f:verbatim>
-
-
-        <h:outputText value="Select Some Boxes"/>
-        <h:panelGrid columns="1">
-            <s:selectManyCheckboxAjax
-                    id="smcb"
-                    forceId="true"
-                    value="#{inputAjaxBean.chosenValues}">
-                <f:selectItems
-                        value="#{inputAjaxBean.checkboxItems}"/>
-            </s:selectManyCheckboxAjax>
-            <f:verbatim>This component demonstrates ajax updating ability on a checkboxes.</f:verbatim>
-        </h:panelGrid>
-
-        <h:outputText value="Select A Radio Button"/>
-        <h:panelGrid columns="1">
-            <s:selectOneRadioAjax
-                    id="radio1"
-                    forceId="true"
-                    value="#{inputAjaxBean.radioValue}">
-                <f:valueChangeListener type="org.apache.myfaces.custom.inputAjax.SampleValueChangeListener"/>
-                <f:selectItems
-                        value="#{inputAjaxBean.radioItems}"/>
-            </s:selectOneRadioAjax>
-            <f:verbatim>This component demonstrates ajax updating ability on a radio buttons.</f:verbatim>
-        </h:panelGrid>
-
-        <h:outputText value="Toggle Switch"/>
-        <h:panelGrid columns="1">
-            <h:panelGroup>
-                <s:selectBooleanCheckboxAjax
-                        id="toggle1"
-                        forceId="true"
-                        value="#{inputAjaxBean.toggle1}"/>
-                <h:outputText value="Got Milk?"/>
-            </h:panelGroup>
-            <s:message for="toggle1" styleClass="error"/>
-            <f:verbatim>This component demonstrates ajax updating ability based on a toggle switch.</f:verbatim>
-        </h:panelGrid>
-
-        <h:outputText value="Toggle Switch With Images"/>
-        <h:panelGrid columns="1">
-            <h:panelGroup>
-                <s:selectBooleanCheckboxAjax
-                        id="toggle2"
-                        forceId="true"
-                        value="#{inputAjaxBean.toggle2}"
-                        onImage="images/nav-plus.gif"
-                        offImage="images/nav-minus.gif">
-                    <f:valueChangeListener type="org.apache.myfaces.custom.inputAjax.SampleValueChangeListener"/>
-                        </s:selectBooleanCheckboxAjax>
-                <h:outputText value="Got Juice?"/>
-            </h:panelGroup>
-            <s:message for="toggle2" styleClass="error"/>
-            <f:verbatim>This component demonstrates ajax updating ability based on a toggle switch.</f:verbatim>
-        </h:panelGrid>
-
-
-    </h:panelGrid>
-    <t:div id="statusDiv" forceId="true"></t:div>
-    <h:commandButton action="#{inputAjaxBean.submit}" value="Submit"/>
-</h:form>
+<t:panelLayout
+	layout="classic">
+<f:facet name="body">
+	<h:form>
+	
+	    <h:panelGrid>
+	
+	        <h:panelGrid>
+	            <h:outputText styleClass="standard_bold" value="Input Some Text" />
+	            <h:panelGrid columns="2">
+	                <s:inputTextAjax value="#{inputAjaxBean.text1}" id="text1"
+	                                 validator="#{inputAjaxBean.validateText1}"
+	                                 errorStyle="border:1px solid red; color:red;"/>
+	                 <t:message forceSpan="true" styleClass="errorMessage" for="text1"></t:message>
+	            </h:panelGrid>
+	            <f:verbatim>This component demonstrates ajax updating ability when you change the
+	                text. <br/> An error message is displayed if the given String is greater than 5 characters.</f:verbatim>
+	        </h:panelGrid>
+	
+	        <f:verbatim><br/></f:verbatim>
+	
+	        <h:panelGrid>
+	            <h:outputText styleClass="standard_bold" value="Input Some Text"/>
+	            <h:panelGrid columns="2">
+	                <s:inputTextAjax value="#{inputAjaxBean.text2}"
+	                                 id="text2"
+	                                 showOkButton="true"
+	                                 showCancelButton="true"
+	                                 validator="#{inputAjaxBean.validateText2}">
+	                    <f:valueChangeListener type="org.apache.myfaces.custom.inputAjax.SampleValueChangeListener"/>
+	                </s:inputTextAjax>
+	                <t:message forceSpan="true" for="text2" style="color:red; font-weight:bold;"/>
+	            </h:panelGrid>
+	            <f:verbatim>This component demonstrates ajax updating ability, but you must click Ok for it to send.<br/>
+	                Cancel will clear the text and not send an update. Will show a validation error if the string is
+	                less then 3 characters.</f:verbatim>
+	        </h:panelGrid>
+	
+	         <f:verbatim><br/></f:verbatim>
+	
+	        <h:panelGrid columns="1">
+	            <h:outputText styleClass="standard_bold" value="Input a Date"/>
+	            <h:panelGrid columns="2">
+	                <s:inputTextAjax value="#{inputAjaxBean.date1}"
+	                                 id="date1"
+	                                 errorStyleClass="errorField">
+	                    <s:convertDateTime pattern="yyyy-MM-dd"/>
+	                </s:inputTextAjax>
+	                <t:message for="date1" forceSpan="true" styleClass="errorMessage"/>
+	            </h:panelGrid>
+	            <f:verbatim>This component demonstrates error handling capabilities, enter an invalid string to see the
+	                error returned from the server through ajax.</f:verbatim>
+	        </h:panelGrid>
+	
+	         <f:verbatim><br/></f:verbatim>
+	
+	        <h:panelGrid>
+	            <h:panelGrid style="border:1px solid #71A5A5; background-color:rgb(236, 243, 225); width:450px;height:50px;">
+	                <t:messages forceSpan="true" styleClass="errorMessage"> </t:messages>
+	            </h:panelGrid>
+	            <f:verbatim>This is the thomahawk messages component with forceRenderSpan set to true. <br/>
+	                    All messages which are generated by the inputTextAjax fields are displayed here.
+	            </f:verbatim>
+	        </h:panelGrid>
+	
+	         <f:verbatim><br/><br/></f:verbatim>
+	
+	
+	        <h:outputText value="Select Some Boxes"/>
+	        <h:panelGrid columns="1">
+	            <s:selectManyCheckboxAjax
+	                    id="smcb"
+	                    forceId="true"
+	                    value="#{inputAjaxBean.chosenValues}">
+	                <f:selectItems
+	                        value="#{inputAjaxBean.checkboxItems}"/>
+	            </s:selectManyCheckboxAjax>
+	            <f:verbatim>This component demonstrates ajax updating ability on a checkboxes.</f:verbatim>
+	        </h:panelGrid>
+	
+	        <h:outputText value="Select A Radio Button"/>
+	        <h:panelGrid columns="1">
+	            <s:selectOneRadioAjax
+	                    id="radio1"
+	                    forceId="true"
+	                    value="#{inputAjaxBean.radioValue}">
+	                <f:valueChangeListener type="org.apache.myfaces.custom.inputAjax.SampleValueChangeListener"/>
+	                <f:selectItems
+	                        value="#{inputAjaxBean.radioItems}"/>
+	            </s:selectOneRadioAjax>
+	            <f:verbatim>This component demonstrates ajax updating ability on a radio buttons.</f:verbatim>
+	        </h:panelGrid>
+	
+	        <h:outputText value="Toggle Switch"/>
+	        <h:panelGrid columns="1">
+	            <h:panelGroup>
+	                <s:selectBooleanCheckboxAjax
+	                        id="toggle1"
+	                        forceId="true"
+	                        value="#{inputAjaxBean.toggle1}"/>
+	                <h:outputText value="Got Milk?"/>
+	            </h:panelGroup>
+	            <s:message for="toggle1" styleClass="error"/>
+	            <f:verbatim>This component demonstrates ajax updating ability based on a toggle switch.</f:verbatim>
+	        </h:panelGrid>
+	
+	        <h:outputText value="Toggle Switch With Images"/>
+	        <h:panelGrid columns="1">
+	            <h:panelGroup>
+	                <s:selectBooleanCheckboxAjax
+	                        id="toggle2"
+	                        forceId="true"
+	                        value="#{inputAjaxBean.toggle2}"
+	                        onImage="images/nav-plus.gif"
+	                        offImage="images/nav-minus.gif">
+	                    <f:valueChangeListener type="org.apache.myfaces.custom.inputAjax.SampleValueChangeListener"/>
+	                        </s:selectBooleanCheckboxAjax>
+	                <h:outputText value="Got Juice?"/>
+	            </h:panelGroup>
+	            <s:message for="toggle2" styleClass="error"/>
+	            <f:verbatim>This component demonstrates ajax updating ability based on a toggle switch.</f:verbatim>
+	        </h:panelGrid>
+	
+	
+	    </h:panelGrid>
+	    <t:div id="statusDiv" forceId="true"></t:div>
+	    <h:commandButton action="#{inputAjaxBean.submit}" value="Submit"/>
+	</h:form>
+</f:facet>
+</t:panelLayout>
 
 <h:outputLink value="inputAjax.jsf"><h:outputText value="Refresh"></h:outputText></h:outputLink>