Title: Webwork2: Select Tag (Newbie)

Hi Patrick, welcome to WebWork!

 

Listkey and listvalue are used as so:

 

<option value=”[listkey]”>[listvalue]</option>

 

The values you should place in your ww:select tag are ones that assume that the context is one of the objects in the list. So if “searchModel.partnerModelList” returns a Map going from Long -> String, then listkey should be “key” and listvalue should be “value”, since iterating over a Map returns Map.Entry objects in which Map.Entry has getKey() and getValue() methods.

 

Alternatively, if your list is a List of special objects, you can use values for listkey and listvalue that result in method calls on those objects for the key/value pairs.

 

-Pat

 

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Patrick Holzmann
Sent: Thursday, November 20, 2003 10:21 AM
To: [EMAIL PROTECTED]
Subject: [OS-webwork] Webwork2: Select Tag (Newbie)

 

hi,

i'm trying tofigure out how to use the select tag:

i have an action with a searchmodel class contaiing another model (partnermodel) class.

now in jsp i use following statement:
<ww:select label="'Partnername'" name="'partnerNameList'"
           list="searchModel.partnerModelList" listValue="partnerName"
           value="partnerId" listKey="partnerId" />

the listing of the partnernames works but i would like to have the partnerid as the <option>-value property.

i just can't find out what exactly listkey and value are supposed to be...

can someone please help me?

thanks
patrick

Reply via email to