You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by rl...@apache.org on 2003/09/24 05:43:17 UTC
cvs commit: jakarta-struts/web/validator/WEB-INF struts-config.xml validation.xml
rleland 2003/09/23 20:43:17
Modified: web/validator index.jsp jsType.jsp type.jsp
web/validator/WEB-INF struts-config.xml validation.xml
Log:
Bug#: 18993, and Bug#: 11520
Modify Validator example to show use of 'required'
for checkboxes, radio,select-one,
and select-multiple field types.
Revision Changes Path
1.4 +1 -1 jakarta-struts/web/validator/index.jsp
Index: index.jsp
===================================================================
RCS file: /home/cvs/jakarta-struts/web/validator/index.jsp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- index.jsp 30 Aug 2003 03:52:42 -0000 1.3
+++ index.jsp 24 Sep 2003 03:43:17 -0000 1.4
@@ -47,7 +47,7 @@
<bean:message key="typeForm.description"/>
</li>
<li>
- <html:link page="/jsType.jsp"><bean:message key="jsTypeForm.title"/></html:link> -
+ <html:link page="/editJsType.do"><bean:message key="jsTypeForm.title"/></html:link> -
<bean:message key="jsTypeForm.description"/>
</li>
</ul>
1.6 +47 -0 jakarta-struts/web/validator/jsType.jsp
Index: jsType.jsp
===================================================================
RCS file: /home/cvs/jakarta-struts/web/validator/jsType.jsp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- jsType.jsp 30 Aug 2003 03:52:42 -0000 1.5
+++ jsType.jsp 24 Sep 2003 03:43:17 -0000 1.6
@@ -103,6 +103,53 @@
</td>
</tr>
<tr>
+ <th align="left">
+ <bean:message key="typeForm.option.satisfaction"/>:
+ </th>
+ <td align="left">
+ <html:select property="satisfaction">
+ <html:option value="" key="typeForm.option.select.one"/>
+ <html:options collection="satisfactionList" property="value"
+ labelProperty="label"/>
+ </html:select>
+ </td>
+ </tr>
+ <tr>
+ <th align="left">
+ <bean:message key="typeForm.option.os.list"/>:
+ </th>
+ <td align="left">
+ <html:select property="osList" multiple="true">
+ <html:option value="" key="typeForm.option.select.many"/>
+ <html:options collection="osTypes" property="value"
+ labelProperty="label"/>
+ </html:select>
+ </td>
+ </tr>
+ <tr>
+ <th align="left">
+ <bean:message key="typeForm.radio.overall.satisfaction"/>:
+ </th>
+ <td align="left">
+ <logic:iterate id="satBean" name="satisfactionList" type="org.apache.struts.util.LabelValueBean">
+ <html:radio property="overallSatisfaction" value="<%=satBean.getValue()%>">
+ <%=satBean.getLabel()%>
+ </html:radio>
+ </logic:iterate>
+ </td>
+ </tr>
+ <tr>
+ <th align="left">
+ <bean:message key="typeForm.checkbox.used.languages"/>:
+ </th>
+ <td align="left">
+ <logic:iterate id="langBean" indexId="usedIndex" name="languageTypes" type="org.apache.struts.util.LabelValueBean">
+ <html:multibox property="usedLanguages" value="<%=langBean.getValue()%>"/><%=langBean.getLabel()%>
+
+ </logic:iterate>
+ </td>
+ </tr>
+ <tr>
<td>
<html:submit property="submit" onclick="bCancel=false;">
<bean:message key="button.save"/>
1.5 +1 -0 jakarta-struts/web/validator/type.jsp
Index: type.jsp
===================================================================
RCS file: /home/cvs/jakarta-struts/web/validator/type.jsp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- type.jsp 30 Aug 2003 03:52:42 -0000 1.4
+++ type.jsp 24 Sep 2003 03:43:17 -0000 1.5
@@ -119,6 +119,7 @@
</th>
<td align="left">
<html:text property="creditCard" size="16" maxlength="16"/>
+ (e.g. 4111111111111111, 5500000000000004)
</td>
</tr>
1.5 +8 -1 jakarta-struts/web/validator/WEB-INF/struts-config.xml
Index: struts-config.xml
===================================================================
RCS file: /home/cvs/jakarta-struts/web/validator/WEB-INF/struts-config.xml,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- struts-config.xml 28 Jul 2003 05:56:40 -0000 1.4
+++ struts-config.xml 24 Sep 2003 03:43:17 -0000 1.5
@@ -86,12 +86,19 @@
</action>
<!-- JavaScript Type Action -->
+ <action path="/editJsType"
+ type="org.apache.struts.webapp.validator.EditTypeAction"
+ scope="request"
+ validate="false">
+ <forward name="success" path="/jsType.jsp"/>
+ </action>
+
<action path="/jsType"
type="org.apache.struts.webapp.validator.TypeAction"
name="jsTypeForm"
scope="request"
validate="true"
- input="/jsType.jsp">
+ input="/editJsType.do?typeForm.reset=false">
<forward name="success" path="/index.jsp"/>
</action>
1.7 +19 -3 jakarta-struts/web/validator/WEB-INF/validation.xml
Index: validation.xml
===================================================================
RCS file: /home/cvs/jakarta-struts/web/validator/WEB-INF/validation.xml,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- validation.xml 30 Aug 2003 03:52:43 -0000 1.6
+++ validation.xml 24 Sep 2003 03:43:17 -0000 1.7
@@ -265,7 +265,7 @@
<var-value>3.14</var-value>
</var>
</field>
- <field property="date"
+ <field property="date"
depends="required,date">
<arg0 key="typeForm.date.displayname"/>
<var>
@@ -273,9 +273,25 @@
<var-value>MM/dd/yyyy</var-value>
</var>
</field>
- <field property="creditCard"
- depends="required,creditCard">
+ <field property="creditCard"
+ depends="required,creditCard">
<arg0 key="typeForm.creditCard.displayname"/>
+ </field>
+ <field property="satisfaction"
+ depends="required">
+ <arg0 key="typeForm.option.satisfaction"/>
+ </field>
+ <field property="osList"
+ depends="required">
+ <arg0 key="typeForm.option.os.list"/>
+ </field>
+ <field property="overallSatisfaction"
+ depends="required">
+ <arg0 key="typeForm.radio.overall.satisfaction"/>
+ </field>
+ <field property="usedLanguages"
+ depends="required">
+ <arg0 key="typeForm.checkbox.used.languages"/>
</field>
</form>
</formset>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org