I personally use nested tags because they have better
support for this kinda thing.

Here is a good place for a tutorial.

http://www.keyboardmonkey.com/pilotlight/index.jsp

Go to the bottom and click on the monkey[0] tutorial.

Keep in mind the struts-basics for how it sets values
on the submit.

I have not tried this myself and I don't know what the
exact api you need is for the form bean so that it
will set the values when you submit..  What is
suprising is that the Person getPerson(int index) type
of api is not required.  That is pretty good.

To be honest, if I had to do it again, I would learn
the nested tags first and if I needed to subclass for
my own functionality I would subclass the nested html
tags.  It is a bit more of a learning curve, but once
you have the concept it is smooth sailing and you can
do a lot more.

A big advantage is that you don't have to have
everything on a single page and can have

nested:iterate
 - jsp:include

Always used nested:root as the first tag in the
included jsp page!

Some things to remember are that unlike their
equivalent tags, you should be using a name property

for example:

<bean:write name="<name>" property="<property>"/>

you would use

<nested:write property="<property>"/>

So which bean is the write using??  The last 

nested:nest, nested:form, nested:iterate that it
finds.

Now html tags never use a name property since they use
the form that was identified by your 

html:form action=""

This line creates the form according to the action (if
it didn't exist in the scope specified in the
struts-config.

nested-html tags will use the nested bean they are
found in based on the last nested:nest, nested:form,
nested:iterate tags that they are found in.

The other important concept is to understand that how
struts handles the form population for you on a
submit.

This is a lot to understand and I may not have
explained it properly... Check out the tutorial and
remember that whatever time you spend now is well
worth it.

sandeep
--- Sashi Ravipati <[EMAIL PROTECTED]> wrote:
> Any ideas how to make this to work
> 
> >>> [EMAIL PROTECTED] 06/10/03 03:24PM >>>
> There is an error in that
> 
> getPerson(int index) should return a Person object
> or
> something with name etc.
> 
> sandeep
> --- Sashi Ravipati <[EMAIL PROTECTED]> wrote:
> > I want to accomplish something which is similar to
> > what is shown in the
> > example
> > 
> >
>
http://www.scioworks.net/devnews/strutsDistilled/updates/update-030401/indexedAttr.html
> > 
> > In here he talk abt indexed properties . Could not
> > understand what he is
> > trying to do here
> > 
> > You form bean class will look like this:
> > public class MyFormBean extends ActionForm {
> >   private List fPersonList;
> >   public List getPersonList() { ... }
> >   public void getPerson(int index) { ... }
> > }
> > Could you give me more insight on this
> > 
> > Do we have to code the "Person" class with
> > phoneNo and name properties, or does that happen
> > somehow automatically?
> > 
> > And how does this work:
> >  public void getPerson(int index) { ... }
> > 
> > Shouldn't that return a Person object, or at the
> > very least an Object,
> > rather than void?
> > 
> > Thanks
> > 
> > 
> > >>> [EMAIL PROTECTED] 06/10/03 11:50AM >>>
> > I wrote a long FAQ description in the
> documentation
> > about this, and I'm
> > still not sure I can adequately answer this
> > question, as it can be
> > somewhat confusing.  You could read that at <
> > http://jakarta.apache.org/struts/faqs/index.html>.
> 
> > Select the "indexed
> > properties" link.
> > 
> > Basically, you use indexed tags when you want the
> > resulting "name" of an
> > HTML component to reference array indexes, so you
> > can move values in and
> > out of a collection/array in your form bean
> instead
> > of scalars.
> > 
> > The indexed tags work along with either the
> > "logic:iterate" or
> > "c:forEach" tags.
> > 
> > > -----Original Message-----
> > > From: Sashi Ravipati
> > [mailto:[EMAIL PROTECTED]
> > > Sent: Tuesday, June 10, 2003 8:38 AM
> > > To: [EMAIL PROTECTED]
> > > Subject: What are "indexed" struts-html tags and
> > how to use them?
> > > 
> > > Can somebody explain how these work, or is there
> > any example of this.
> > > 
> > > Thanks
> > 
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > [EMAIL PROTECTED]
> > For additional commands, e-mail:
> > [EMAIL PROTECTED]
> > 
> 
> 
> __________________________________
> Do you Yahoo!?
> Yahoo! Calendar - Free online calendar with sync to
> Outlook(TM).
> http://calendar.yahoo.com
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 


__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com

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

Reply via email to