blob: f940f0076bac1680dcde2c63303a1aba9584c73c [file] [log] [blame]
<?xml version="1.0" encoding="iso-8859-1" standalone="yes" ?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"
xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html"
xmlns:tr="http://myfaces.apache.org/trinidad">
<jsp:directive.page contentType="text/html;charset=utf-8"/>
<f:view>
<tr:document>
<tr:messages/>
<tr:form>
<tr:subform>
<tr:inputText required="true" label="Sub 1:" value="#{subformBean.subformValue1}"/>
<tr:inputText label="Sub 1 Value" value="#{subformBean.subformValue1}" readOnly="true"/>
<tr:commandButton text="Submit 1"/>
</tr:subform>
<tr:subform>
<tr:inputText required="true" label="Sub 2:" value="#{subformBean.subformValue2}"/>
<tr:inputText label="Sub 2 Value" value="#{subformBean.subformValue2}" readOnly="true"/>
<tr:commandButton text="Submit 2"/>
</tr:subform>
<tr:subform default="true">
<tr:inputText required="true" label="Sub Default:" value="#{subformBean.subformValue3}"/>
<tr:inputText label="Sub Default Value" value="#{subformBean.subformValue3}"
readOnly="true"/>
<tr:commandButton text="Submit Default"/>
</tr:subform>
<tr:inputText required="true" label="Outside Subform" id="it4"
value="#{subformBean.subformValue4}"/>
<tr:inputText label="Outside Subform Value" id="it4a" value="#{subformBean.subformValue4}"
readOnly="true"/>
<tr:commandButton text="Submit Outside"/>
<tr:separator/>
<tr:outputText value="The fields in the 2 tables below will throw an error if they contain a string where the length is greater than 2. "/>
<tr:spacer height="10"/>
<tr:outputText value="Enter 'cat' in all the field of the first table, then hit one of the 'go' buttons. Note that you only see an error for the row where you hit the go button, even though all the rows contain a string where the length is greater than 2. This is because each row of the first column is in its own subform, so only the row in which the button was pressed is running the full lifecycle"/>
<tr:table id="i1" value="#{subformBean.texts}" var="row">
<tr:column>
<tr:subform id="s1">
<tr:panelGroupLayout id="pgl0" layout="horizontal">
<tr:inputText label="Enter text" id="it1" value="#{row.text}">
<tr:validateLength maximum="2"/>
</tr:inputText>
<tr:commandButton text="Go" id="go" actionListener="#{row.doSomething}"/>
</tr:panelGroupLayout>
</tr:subform>
</tr:column>
<tr:column>
<tr:outputText id="ot1" value="#{row.text}"/>
</tr:column>
</tr:table>
<tr:spacer height="10"/>
<tr:outputText value="Enter 'cat' in all the field of the second table, then hit one of the 'go' buttons. Note that you see an error for all the rows. There is no subform in this table, therefore regardless of which button you hit, the full table is processed."/>
<tr:table id="t2" value="#{subformBean.texts2}" var="row">
<tr:column>
<tr:panelGroupLayout id="pgl1" layout="horizontal">
<tr:inputText label="Enter text" id="it2" value="#{row.text}">
<tr:validateLength maximum="2"/>
</tr:inputText>
<tr:commandButton text="Go" id="go2" actionListener="#{row.doSomething}"/>
</tr:panelGroupLayout>
</tr:column>
<tr:column>
<tr:outputText id="ot2" value="#{row.text}"/>
</tr:column>
</tr:table>
</tr:form>
</tr:document>
</f:view>
</jsp:root>