Struts submit forms, generated with iterate

Discussion in 'Java' started by Marko, Sep 4, 2003.

  1. Marko

    Marko Guest

    Hi all,
    I have a problem, when I want to submit values from a form that was
    generated with logic:iterate. So my problem looks like this:
    I have an ArrayList of values, that are rendered in html:text, every
    value into new textbox, and some additional text, specific for this
    value. Number of pairs value/text is not predefined, they are read
    from database. After the form is renedered on the page, I want to
    change some values in textboxes and submit new values back to the
    business logic side. The problem is, (it looks like) that Struts
    doesn't populate the form's ArrayList, from which it was first
    rendered, when submit is clicked.
    So I have folowing classes:

    PairValue.java - getters and setters for value and some text.

    TestForm.java - Form bean form which the form is populated, using
    iterate in jsp. This form bean has getter and setter for ArrayList of
    PairValue objects. By iterating this arrayList, the form is rendered
    on the page.

    PrepareFormAction.java - action bean, that reads the data from
    bussines logic and set arraylist in TestForm class, using setter. In
    struts-config.xml, this form is request scope.

    SavePairsAction.java - an action form that saves the new data to
    business logic.

    Both actions have TestForm for its form, and both are request scoped.

    So everything goes OK, until I want to save data enetered in the form.
    When submit is pressed, I think, as it works for normal (not iterated)
    forms, the form bean should be auto populated using setter method, but
    it is not. Even if I put some poperty in that form that is not
    iterated, and create setters and getters for it, the setter is not
    invoked at all. It looks like it doesn't invoke TestForm at all.
    Please help, because I searched on many forums, found some similar
    problems, but none helped.
    Regards, Marko
     
    Marko, Sep 4, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Gogo
    Replies:
    1
    Views:
    2,104
    Sudsy
    Sep 4, 2003
  2. Megha Vishwanath
    Replies:
    2
    Views:
    9,843
    tutorialsmaster
    Oct 2, 2009
  3. runescience
    Replies:
    0
    Views:
    1,461
    runescience
    Feb 9, 2006
  4. John
    Replies:
    4
    Views:
    920
    RedGrittyBrick
    Apr 1, 2008
  5. Megha Vishwanath
    Replies:
    3
    Views:
    717
    Megha Vishwanath
    Jul 20, 2004
Loading...

Share This Page