Hi Rick,

Let me explain what I have, any other recommendation on how I should rather
do it would also help.

Firstly I have a data bean

public class beanData implements Serializable {
    private long property1;
    private String property2;
    private String property3;
    private String property4;
    private String property5;

    public long getProperty1 () {
        return property1;
    }
    public void set Property1 (long property1) {
        this.property1= property1;
    }

    public String getProperty2 () {
        return property2;
    }
    public void set Property2 (String property2) {
        this.property2= property2;
    }
    public String getProperty3 () {
        return property3;
    }
    public void set Property3 (String property3) {
        this.property4= property3;
    }
    public String getProperty4 () {
        return property4;
    }
    public void set Property4 (String property4) {
        this.property4= property4;
    }
    public String getProperty5 () {
        return property5;
    }
    public void set Property5 (String property5) {
        this.property5= property5;
    }

}


I then have a formbean 

public class beanForm extends ActionFormBase {
    private int prop1;
    private int prop2;
    private String prop3;
    private ArrayList prop4;
    
  
    public int getProp1() {
        return prop1;
    }
    public void set Prop1 (int prop1) {
        this.prop1= prop1;
    }

    public int getProp2() {
        return prop2;
    }
    public void set Prop2 (int prop2) {
        this.prop2= prop2;
    }  
   
    public String getProp3() {
        return prop3;
    }
    public void set Prop3 (String prop3) {
        this.prop3= prop3;
    }

    public ArrayList getProp4() {
        return prop4;
    }
    public void set Prop4 (ArrayList prop4) {
        this.prop4= prop4;
    }
}


I have a jsp that I populate by using a DTO that looks the same as the
beanForm class.


<c:forEach var="lines" items="${beanForm.prop4}" >
<tr>
        <td><bean:write name="beanForm" property="prop1"/></td>
        <td><bean:write name="beanForm" property="prop2"/></td>
        <td><bean:write name="lines" property="property2"/></td>
        <td><bean:write name="lines" property="property3"/></td>
        <td><html:text indexed="true" name="lines"
property="property4"/></td>
        <td><html:text indexed="true" name="lines"
property="property5"/></td>
        <td>&nbsp;</td>
</tr>
</c:forEach>    


When I post this jsp back using the FormBean I would like the bean that is
contained within the Array in the formbean to be populated by the text box
values.

I have some master data in the formbean that will only be displayed once. I
then I have an arralist of data bean that I iterate through there are values
in this bean that should be filled in on the jsp and on submit go into the
bean in the arralist on the formbean.

I tried using the normal
<logic--:iterate> with <html:text> I tried
<logic-el--:iterate> with <html-el--:text and the <c:forEach and everytime
the array of textbox values are missing on submit.

Regards
Neil Meyer




-----Original Message-----
From: Rick Reumann [mailto:[EMAIL PROTECTED] 
Sent: 11 April 2006 10:17 PM
To: Struts Users Mailing List
Subject: Re: Multiple text box

On 4/11/06, Neil Meyer <[EMAIL PROTECTED]> wrote:
> Hi All,
>
> I urgently need some help here please I basically need to do the following
in
> struts. I tried the <html-el--:text /> tag and still can't get it to work.
>
> String names[] = request.getParameterValues("names");
>
> I have a form bean with an arraylist on it this arraylist contains a bean
> with parameters some of the parameters will be updates on the page and this
> properties per bean should be retrieved into the array list of beans.

I'm still not sure what you are trying to accomplish. It would help if
you could give an example scenario of what you are trying to
accomplish from a user-requirement/UI point of view.

I'm not sure why you just threw in
String names[] = request.getParameterValues("names");
in the above? What does that have to do with what you are trying to
accomplish?

--
Rick
http://www.learntechnology.net

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to