You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Eugene McCullagh <eu...@openeire.org> on 2003/07/25 02:11:08 UTC

Issue

I have a 2 bean classes, Bean1 and Bean2. Bean1 holds an ArrayList of Bean2
objects. The Bean2 class has a string property called status. Finally I have
an ActionForm, actionForm1, which holds an instance of Bean1.

I want to dynamically create a set of radio buttons which will allow a user
to change status (either "accept" or "reject") of each Bean2 instance within
the ArrayList. The code I am using is as follows:

/*Class Definitions. Assume each class has appropriate setter and getter
methods*/

public class ActionForm1 {
    Bean1 bean1Instance;
}

public class Bean1 {
    ArrayList bean2List;
}

public class Bean2 {
    String status = "accept";
}

/*JSP Code*/

<logic:iterate name="actionForm1" property="bean1Instance.bean2List"
id="row">
  <html:radio name="row" property="status" value="accept" indexed="true"/>
  <html:radio name="row" property="status" value="reject" indexed="true"/>
</logic:iterate>

I have tested this and the tag picks up the status (i.e. "accept") from
Bean3.status in each iteration, checking the radio button for accept each
time. However it does not appear to set it if I click the "reject" radio
button on the screen. I would be extremeny grateful if anyone could shed
some light on this as I am at a loss

TIA


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