You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Hiroyuki Suzuki <je...@atenista.net> on 2007/08/02 09:30:39 UTC

Validating using indexedListProperty

hello guys..its me again..

I have a problem regarding my validation of html:text which is inside the
iteration and the validation will depends if the corresponding checkbox has
been selected.

this is my JSP
bitratebox is for the multibox
and 
bitrateTxt  is for the text

<logic:iterate name="metaEntryConfirmForm" indexId="index"  id="item1"
property="items1">                          
  <tr>                  
    <td><html:multibox property="bitratebox"><bean:write
name="item1"/></html:multibox><bean:write name="item1"/></td>
    <td><html:text property="<%="bitrateTxt["+index+"]"%>" size="50"/></td>
  </tr>
 </logic:iterate>

when I tried to write it in my validation.xml a
FOR bitrateTxt[0] when bitratebox[0] is checked

   <field property="bitrateTxt[0]" indexedListProperty="items1"
depends="requiredif"> 
      <arg name = "requiredif" key = "「500K用ファイル名」を入力" resource = "false"
position="0"/>
      <var>   
        <var-name>field[0]</var-name> 
        <var-value>bitratebox</var-value>   
      </var>
      <var>   
        <var-name>fieldTest[0]</var-name> 
        <var-value>EQUAL</var-value>   
      </var>
      <var>   
        <var-name>fieldValue[0]</var-name> 
        <var-value>500k</var-value>   
      </var>     
   </field>

I used bitrateTxt[0] because the generated html will look like this
<tr>                            
  <td><input type="checkbox" name="bitratebox" value="500k"
disabled="disabled">500k</td>
  <td><input type="text" name="bitrateTxt[0]" size="50" value=""
disabled="disabled"></td>
  <td><input type="checkbox" name="haishinselect" value="goohigashi0"
disabled="disabled"></td>
  <td><input type="checkbox" name="haishinselect" value="goonishi0"
disabled="disabled"></td>
  <td><input type="checkbox" name="haishinselect" value="gooBB0"
disabled="disabled"></td>                            
</tr>

Actionform
	private String[] bitratebox = {};
	private String[] items1 = {"500k","1M","2M","5M","6M"};
	public String[] getBitratebox() {
		return this.bitratebox;
	}
	public void setBitratebox(String[] bitratebox) {
		this.bitratebox = bitratebox;
	}	
	public String[] getItems1(){
		return this.items1;

	private String[] bitrateTxt = {"","","","",""};
	public String[] getBitrateTxt() {
		return this.bitrateTxt;
	}
	public void setBitrateTxt(String[] bitrateTxt) {
		this.bitrateTxt = bitrateTxt;
	}

Is my validdation correct? I cant make this work properly..
Please teach me the incorrect part.
Thank you..
-- 
View this message in context: http://www.nabble.com/Validating-using-indexedListProperty-tf4204569.html#a11959696
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org