drop-down with different values of an object
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   R_B
Posted On:   Wednesday, November 3, 2004 01:39 AM

Hi Ok the whole thing looks like this: if have collection with "user"-objects, each user object has attributs like name, user ID etc. now i would like to get a drop down menu with the value=userID und the label=name. some one has an idea? i already tried some possibilities, one that's nearly ok is the following: top of the jsp file: here i get a list,details see Kollegformular at the bottom <% KollegFormular kf = new KollegFormular(); %> .. <%= kf.getUsers() %>"> .. this e.g. just shows the the correct label, but the value is allways "users"    More>>

Hi
Ok the whole thing looks like this:
if have collection with "user"-objects, each user object has attributs like name, user ID etc.
now i would like to get a drop down menu with the value=userID und the label=name. some one has an idea?

i already tried some possibilities, one that's nearly ok is the following:

top of the jsp file:
here i get a list,details see Kollegformular at the bottom

			

<%
KollegFormular kf = new KollegFormular();
%>

..


<%= kf.getUsers() %>">





..


this e.g. just shows the the correct label, but the value is allways "users"


kollegFormular:

			

public class KollegFormular {

private List users = Collections.synchronizedList(new ArrayList());

public KollegFormular(){
userLaden();
}

/**
* @return Gibt alle Handy Producer zurück
*/
public Iterator getUsers(){
//userLaden();
return users.iterator();
}

public void userLaden(){
users = QueryBuilder.getUsers();
}

}



someone has an idea?

thanks a lot for your help


Please use html tags to format code blocks.

   <<Less

Re: drop-down with different values of an object

Posted By:   Sheikh_Azad  
Posted On:   Wednesday, November 3, 2004 03:25 AM

this is very simple please use "html:optionsCollection"





About | Sitemap | Contact