Read my first paragraph again, a little more slowly this time :) Arron.
Struts Newsgroup (@Basebeans.com) wrote: >Subject: Re: Iterate update >From: JDavids <[EMAIL PROTECTED]> > === >So I did this in bean: > public void setFstName (String[] names) { > > int j = names.length; > System.out.println("XXX in set[]"+j); > for (int i=0; i<j; i++) { > System.out.println(names[j]); } > >And in the html:text I did indexed="true". > >In action, I printed an enumeration of properties, and the array does go >to the action!!! Great. Page/JSP tag work. > >But the setFstName(String[] names) does never get called. >What would be a signature of the method that does the setter in the bean? >Thanks in advance for help. > >JD > > >Arron Bates wrote: > >>Martin confirmed it for you. But here's the spiel you're after... >> >>The items in an interate tag need to have their properties set via an >>indexed property. The String[] you mention there is a valid form. Any >>Object[] is fine. In all truth, the setter for Object[] is academic. The >>PropertyUtils will actually call the getter for the array, and then set >>the item in the array for the index that it has. The actual method >>"setMyProperty(Object[])" will never get called. >> >>As of a couple of months ago, you can now use any implementation of >>java.util.List in the place of the Object[]. >> >>As a side note... have you thought of spending the few minutes it would >>take to change your methods to the Object[] style and find out for >>yourself rather than get impatient with the people of the list (and now >>the developers list)?... >> >>Then it wouldn't matter what we said, you'd know, regardless. >> >> >>Arron. >> >> >>Struts Newsgroup (@Basebeans.com) wrote: >> >>>Subject: Re: Iterate update >>>From: JDavis <[EMAIL PROTECTED]> >>>=== >>>First it goes out as iteration tag of html:text. >>>Then I want to capture each filed in each row (multi row update). >>> >>>So the set does a (String[]) ? >>>tia, >>>JD >>> >>>Martin Cooper wrote: >>> >>>>You don't say what you're doing with the elements in the iteration, >>>>but in >>>>general, the simplest thing to do is to use a String[] property in >>>>your form >>>>bean. >>>> >>>>-- >>>>Martin Cooper >>>> >>>> >>>>----- Original Message ----- >>>>From: "Struts Newsgroup" <[EMAIL PROTECTED]> >>>>To: <[EMAIL PROTECTED]> >>>>Sent: Wednesday, April 10, 2002 2:40 PM >>>>Subject: Iterate update >>>> >>>> >>>> >>>>>Subject: Iterate update >>>>>From: "J.Davis" <[EMAIL PROTECTED]> >>>>>=== >>>>>When Iterating to display, it works great. We go to next row, a display >>>>>say 10 rows with say 5 colums each. >>>>> >>>>>On an update ... what to do? >>>>> >>>>>How do you iterate back, and apply each setter 10 times (once for each >>>>> >>>>row). >>>> >>>>>Help... >>>>>JD >>>>> >>>>> >>>>>-- >>>>>To unsubscribe, e-mail: >>>>> >>>><mailto:[EMAIL PROTECTED]> >>>> >>>>>For additional commands, e-mail: >>>>> >>>><mailto:[EMAIL PROTECTED]> >>>> >>>> >>>> >>>>-- >>>>To unsubscribe, e-mail: >>>><mailto:[EMAIL PROTECTED]> >>>>For additional commands, e-mail: >>>><mailto:[EMAIL PROTECTED]> >>>> >>> >>>-- >>>To unsubscribe, e-mail: >>><mailto:[EMAIL PROTECTED]> >>>For additional commands, e-mail: >>><mailto:[EMAIL PROTECTED]> >>> >>> >> >> >>-- >>To unsubscribe, e-mail: >><mailto:[EMAIL PROTECTED]> >>For additional commands, e-mail: >><mailto:[EMAIL PROTECTED]> >> > > >-- >To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> >For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> > > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>