java - How to link two values to dropdown in JSF? -


i have created entites , facde in netbeans. want create native query 2 feilds table. , bind them

string query = "select distinct(m.idmanufacturer),m.hmid "                 + " model m";  @suppresswarnings("unchecked") list<model> modellist = (list&lt;model>) getentitymanager().createnativequery(query).getresultlist(); 

and used code

<f:selectitems itemlabel="#{mycontroller.modellist.idmanufacturer}"/> 

to show values in dropdown. doesn't seem working. ideas?

try creating list of selectitems list<model> , give in value attribute.

e.g.

list<selectitem> modellist = new arraylist<selectitem>();   //implement conversion label value here. <f:selectitems value="#{mycontroller.modellist}"/> 

Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -