On 7/4/07, Dave Newton <[EMAIL PROTECTED]> wrote:
--- Richard Sayre <[EMAIL PROTECTED]> wrote:
> http://struts.apache.org/2.0.8/docs/select.html
>
> I was wondering what:
>
> list="petDao.pets"
> listKey="id"
> listValue="name"
>
> are referring to?
>
> 1) Is petDao a java bean? 2) Is it an action?
> 3) How do you set it up on the page? 4) What is
> pets? 5) Does it refer to petDao.getPets? 6) what
> does it return? 7) What do id and name refer to?
> 8) Does getPets return a list of objects that
contain
> the fields name and id which have the getters and
> setters for those fields?
...
1) Yes.
2) No.
3) I don't know what that means.
4,5) It's a property of petDao, yes.
6) From the link you provided: "Iterable source to
populate from."
7) From the link you provided:
listKey: Property of list objects to get field value
from
listValue: Property of list objects to get field
content from
8) Hope so.
d.
____________________________________________________________________________________
Thanks. I have a better understanding now.
By number 3 I meant, how do I reference the action, but I realized
this is done when I create the action in struts.xml. I was confused
about #6. I didn't know if I could use a Java object or not. ie. I
thought I had to build the OGNL list expression string and pass it
back.
With #7/#8. If petsDao.pets is an ArrayList does listKey="fieldName"
and listValue="fieldName2" mean that to get these values, call
getFieldName() getFieldName2() on the objects stored in the ArrayList?
IF so, do I need to use generics so it knows what object to expect?
I have one other question:
If I have a Hashtable<Integer,String> with the following data:
1,"One"
2,"Two"
11,"Eleven"
Is it possible to make the select box display the data sorting by id
or sorting by value?
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]