dcsimg
logic:iterate issues
4 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Jijo_Thomas
Posted On:   Thursday, November 13, 2003 08:54 PM

I have a form in which i have deatils of ,say students. Lets say that the form has n rows with 2 text boxes in each row. Name Age I have a bean called Student that contains the above mentioned attributes with their getter and setter methods I have an array list in my form bean that contains details of all the students. Now to populate the form with the data i have to iterate through the array list as follows Now my problem is, i do not know how to get the values entered in these text boxes in my action class from the form bean. If i have arrays for each of the text boxes Name, Age   More>>

I have a form in which i have deatils of ,say students. Lets say that the form has n rows with 2 text boxes in each row.

  • Name

  • Age


  • I have a bean called Student that contains the above mentioned attributes with their getter and setter methods


    I have an array list in my form bean that contains details of all the students. Now to populate the form with the data i have to iterate through the array list as follows















    Now my problem is, i do not know how to get the values entered in these text boxes in my action class from the form bean. If i have arrays for each of the text boxes Name, Age in my form bean, will they get automatically populated? If not then, how should i proceed? Please help!

       <<Less

    Re: logic:iterate issues

    Posted By:   Rick_Jolly  
    Posted On:   Wednesday, December 3, 2003 03:49 PM

    Does anyone have an answer to Jijo's specific question:




    "Now my problem is, i do not know how to get the values entered in these text boxes in my action class from the form bean."




    Jijo is trying to get at a Collection from within a bean (in this case a form bean). Once we have the collection we can use the logic:iterate tag, but how does one get the collection in the first place? In other words, how to we get a reference to the form bean and then call some sort of getCollection() method and use it in the logic:iterate tag?



    Thank you

    Re: logic:iterate issues

    Posted By:   Padmanabh_Murthy  
    Posted On:   Tuesday, December 2, 2003 10:38 PM

    Hi

    i think you are right.

    u should have a setter and getter in the formbean.

    the data will be populated in the form bean.

    u can use the getter method to get the String array.

    and then u can use the data for the business logic.




    Rgds
    PAdmanabh :)

    Re: logic:iterate issues

    Posted By:   Padmanabh_Murthy  
    Posted On:   Tuesday, December 2, 2003 10:38 PM

    Hi

    i think you are right.

    u should have a setter and getter in the formbean.

    the data will be populated in the form bean.

    u can use the getter method to get the String array.

    and then u can use the data for the business logic.




    Rgds
    PAdmanabh :)

    Re: logic:iterate issues

    Posted By:   Padmanabh_Murthy  
    Posted On:   Tuesday, December 2, 2003 10:37 PM

    Hi

    i think you are right.

    u should have a setter and getter in the formbean.

    the data will be populated in the form bean.

    u can use the getter method to get the String array.

    and then u can use the data for the business logic.




    Rgds
    PAdmanabh :)
    About | Sitemap | Contact