Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to display two values in the labelProperty in html:options?

Status
Not open for further replies.

poporogue

Programmer
Dec 20, 2002
16
HK
Hi,
i am new in struts and panic in this problem.

<html:select property="prodRef" >
<html:eek:ptions collection= "selectedList" property="prodRef" labelProperty= "name" />
</html:select>

i have this selection list in my JSP, this JSP can only displays one value - "name". but i want to display 2 values in the selection list. what can i do to put 2 values into the field labelPriperty so the pull down selection list contains 2 values?

thanks in advance.
Popo
 
Where's your form code?

As far as I understand the process, the <html:eek:ptions collection= /> segment pulls an array or anytype of collection /multi-value holding object, vectors, arrays, linked lists, etc.. so your method in your form should ideally return an object of this type:

String name[] = {Bob, Bob};
public String[] getName()
{
return name;
}

At least that's how I would be approaching it first.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top