public void setDateOfBirth(int idx, String dateOfBirth)
White, Susan wrote:
The form is not setting the value that the user inputs. I used some of
the posts from this list to create this code and everything compiles,
throws no exceptions but does not work, either. The setter(s) is(are)
not being called Any ideas? PS The indexed='true' parameter seems to have no effect present or
absent. Thanks! Susan
JSP:
<logic:iterate id="thisParty" name="acctParties" indexId="idx">
<tr valign="bottom">
<td align="left" valign="top" class="dkBlue11b"
colspan="2">
Please enter the date of birth for
<bean:write name="thisParty"
property="firstName"/>
<logic:notEmpty name="thisParty"
property="middleName">
<bean:write name="thisParty"
property="middleName"/>
</logic:notEmpty>
<bean:write name="thisParty"
property="lastName"/> (MM/DD/YYYY)
</td>
</tr>
<tr>
<td colspan="2">
<html:text property='<%= "dateOfBirth[" + idx +
"]" %>' indexed='true'/>
</td>
</tr> </logic:iterate>
Java: private String[] dateOfBirth=null;
/**
* Returns the dateOfBirth by index.
* @param int index of array
* @return String date of birth value
*/
public String getDateOfBirth(int idx) {
if (this.dateOfBirth==null) {
return new String("");
} else {
if (idx < this.dateOfBirth.length) {
return this.dateOfBirth[idx];
} else {
return new String("");
}
}
}
/** * Sets the dateOfBirth. * @param dateOfBirth The dateOfBirth to set * @param idx The position of dateOfBirth to set */ public void setDateOfBirth(String dateOfBirth, int idx) { this.dateOfBirth[idx] = dateOfBirth; }
/** * Sets the dateOfBirth. * @param dateOfBirth The dateOfBirth to set * @param idx The position of dateOfBirth to set */ public void setDateOfBirth(String[] dateOfBirth) { this.dateOfBirth = dateOfBirth; } /** * Returns the dateOfBirth array. * @return String array */ public String[] getDateOfBirth() { return dateOfBirth; }
-- Kris Schneider <mailto:[EMAIL PROTECTED]> D.O.Tech <http://www.dotech.com/>
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

