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-----
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: 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 |
Title: Webwork2: Select Tag (Newbie)
- [OS-webwork] Webwork2: Select Tag (Newbie) Patrick Holzmann
- Patrick Lightbody