You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Rick Reumann <ma...@reumann.net> on 2002/11/04 16:20:04 UTC

Nested Tags situation any light would be appreciated

Sorry to repeat this question... possibly some fresh Monday blood
could help...

I'm stumped here what I'm screwing up and would appreciate any help.
I'm playing around using nested tags and for a simple example in my
first action that brings me to the jsp everything gets prepopulated
and the display is fine:

Ex output:
=================================
John
Enter Favorite Cars:
Mustang        Porsche       BMW

Bill
Enter Favorite Cars:
Corvette       Mercedes      Viper

Fred
Enter Favorite Cars:
A              B             C
==================================

The problem is when you change the name of any of the cars, after the
form submits and returns you to this page, it populates all the rows
with whatever the first row has in it (In this case if you did nothing
and hit submit all 3 rows would look like John's row). I'm sure it's
something simple I'm screwing up and would appreciate any help. Here's
the basics of the jsp nested tag page:

<nested:form  action="myAction">

       <nested:iterate property="people" >

       <nested:write property="name"/><brR>
    
        Enter in Cars:<br>

        <nested:iterate property="carList">

            <nested:text property="carName"/>
    
        </nested:iterate>

        <br><br><br>

    </nested:iterate>

<nested:hidden property="dispatch" value="getResults"/>
<br><br>
<html:submit styleClass="field" value="GET RESULTS"/>

</nested:form>

//reminder:

Form Bean
     ArrayList people

     people is populated with Person beans

            Each Person bean has the field
                 String name;
                 ArrayList carList

                           carList is a list of CarBeans
                                   CarBean just has String carName

                                   
people = ArrayList in form bean of Person beans
name = String in Person Bean
carList = ArrayList of CarBean beans
carName = String field in CarBean


-- 

Rick
mailto:maillist@reumann.net


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>