jsf - Selected element not set to the backing bean -


i have following field in jsp. selected value not set element. when did inspect element on drop down field in ff, shows element not selected. not set backing bean. missing?

    <h:selectonmenu id="scriptengine"  value="#{addscriptbean.scriptengine}" required="true">         <f:selectitems value="#{addscriptbean.scriptengines}"/>     </h:selectonemenu>  

the backing bean code follows

    public list<selectitem> getscriptengines() {     list<selectitem> items = new arraylist<selectitem>();     try {          getscriptenginenamescommand command = (getscriptenginenamescommand) commandfactory.getinstance().getcommand(getscriptenginenamescommand.class.getname());         command.doexecute();         map<string, string> enginenames = command.getenginenames();         messagesource messagesource = getmessagesource();         locale  locale = requestutils.getuserlocale((httpservletrequest) facescontext.getcurrentinstance()                     .getexternalcontext().getrequest(), globals.locale_key);          string label = messagesource.getformattedmessage(locale, "com.soa.console.faces.script.select", new object[] {});         items.add(new selectitem("", label));         (string name : enginenames.keyset()){             items.add(new selectitem(enginenames.get(name), name));         }      }catch (gexception e){         string emessage = e.tostring();         facesmessage msg = new facesmessage("", emessage);         msg.setseverity(facesmessage.severity_error);         facescontext.getcurrentinstance().addmessage(null, msg);     }      return items; } 

i guess getter method not calling becuase have bounded <f:selectitems> tag bean scriptengines getter method getscriptengines().it should have been getscriptengines().this problem


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -