Binding to selectOneMenu

Hi I have having problems binding my selectOneMenu (myfaces), exception is argument type mismatch.
<h:selectOneMenu
        id="roles_comp"
        value="#{flowScope.userViewController.user.role.uuid}"
          valueChangeListener="#{flowScope.userViewController.updateRole}"
        binding="#{flowScope.userViewController.roleMenu}"
        required="true">                                       
   <f:selectItems
     value="#{flowScope.userViewController.roles}" />
   </h:selectOneMenu>
</h:selectOneMenu>
      * @return the roleMenu
     public HtmlSelectOneMenu getRoleMenu() {
          return roleMenu;
      * @param roleMenu the roleMenu to set
     public void setRoleMenu(HtmlSelectOneMenu roleMenu) {
          this.roleMenu = roleMenu;
11:42:56,333 ERROR [[jsp]] Servlet.service() for servlet jsp threw exception
javax.faces.el.EvaluationException: Exception setting property roleMenu of base with class com.x.user.flow.UserFlowViewController
     at org.apache.myfaces.el.PropertyResolverImpl.setValue(PropertyResolverImpl.java:188)
     at org.apache.myfaces.custom.security.SecurityContextPropertyResolver.setValue(SecurityContextPropertyResolver.java:136)
at java.lang.Thread.run(Thread.java:595)
Caused by: javax.faces.el.EvaluationException: Bean: com.x.user.flow.UserFlowViewController, property: roleMenu, newValue: javax.faces.component.html.HtmlSelectOneMenu@1ca1255,newValue class: javax.faces.component.html.HtmlSelectOneMenu method parameter class: org.apache.myfaces.component.html.ext.HtmlSelectOneMenu
     at org.apache.myfaces.el.PropertyResolverImpl.setProperty(PropertyResolverImpl.java:414)
     at org.apache.myfaces.el.PropertyResolverImpl.setValue(PropertyResolverImpl.java:176)
     ... 60 more
Caused by: java.lang.IllegalArgumentException: argument type mismatch
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)Ignore 'flowScope' this is related to spring web flow.
Which object shouuld i bind too...or am is the problem something different?

Everyone,
Thanks for your replies. I will look into the converter and the Tomahawk controls.
BalusC, why is it poor? I want to avoid doing object lookups based on a selected value in a selectOnMenu? If anything, I think this is a good reason. The selectOneMenu would have objects associated with the menu items. I would then be able to get the selected object and use it.
The utility method you are talking about forces me to constantly keep(and maintain) an array list that I will have to load, loop through, find an object by a specific key, and return it.
What is a good reason to avoid building a list of SelectItems?
Thanks,
Ryan

Similar Messages

  • Dynamically create a SelectOneMenu

    Hi All,
    I have a JSF page on which I need to dynamically create and bind a SelectOneMenu. In order to do this I have the following code (all in a request-scoped bean used by the JSF page):
    List<SelectItem> values;
    // Called after a button is clicked on the page
    public void createMenu() {
        values = new Vector<SelectItem>();
        // Load the values to be displayed
        HtmlSelectOneMenu menu = new HtmlSelectOneMenu();
        menu.add(items);
        UISelectItems items = new UISelectItems();   
        ValueExpression expr = // Get ValueExpression pointing to this request-scoped bean's 'values' attribute
        items.setValue("value", expr);
        // Create the SelectOneMenu inside a binded panel on the screen
        getCustomPanel().getChildren().add(menu);
    public List<SelectItem> getValues() {
        return values;
    }This works fine and the SelectOneMenu is displayed correctly and contains the correct values. However, as soon as I perform any type of postback (navigation, clicking on buttons/links on the page), I receive the following exception:
    [#|2008-03-07T11:57:24.296+0200|SEVERE|sun-appserver9.1|javax.enterprise.system.container.web|_ThreadID=21;_ThreadName=httpSSLWorkerThread-8080-0;_RequestID=bcebfe92-27ee-416d-a3d5-7916f5480fe4;|StandardWrapperValve[Faces Servlet]: PWC1406: Servlet.service() for servlet Faces Servlet threw exception
    java.lang.IllegalArgumentException
         at javax.faces.component.SelectItemsIterator.next(SelectItemsIterator.java:166)
         at javax.faces.component.SelectItemsIterator.next(SelectItemsIterator.java:49)
         at javax.faces.component.UISelectOne.matchValue(UISelectOne.java:164)
         at javax.faces.component.UISelectOne.validateValue(UISelectOne.java:137)
         at javax.faces.component.UIInput.validate(UIInput.java:867)
         at javax.faces.component.UIInput.executeValidate(UIInput.java:1065)
         at javax.faces.component.UIInput.processValidators(UIInput.java:666)
         at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1033)
         at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1033)
         at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1033)
         at javax.faces.component.UIForm.processValidators(UIForm.java:229)
         at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1033)
         at javax.faces.component.UIViewRoot.processValidators(UIViewRoot.java:662)
         at org.ajax4jsf.component.AjaxViewRoot.access$201(AjaxViewRoot.java:57)
         at org.ajax4jsf.component.AjaxViewRoot$3.invokeRoot(AjaxViewRoot.java:319)
         at org.ajax4jsf.context.JsfOneOneInvoker.invokeOnRegionOrRoot(JsfOneOneInvoker.java:56)
         at org.ajax4jsf.context.AjaxContextImpl.invokeOnRegionOrRoot(AjaxContextImpl.java:170)
         at org.ajax4jsf.component.AjaxViewRoot.processValidators(AjaxViewRoot.java:333)
         at com.sun.faces.lifecycle.ProcessValidationsPhase.execute(ProcessValidationsPhase.java:100)
         at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
         at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
         at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:317)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
         at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
         at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:288)
         at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:271)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:202)
         at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
         at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
         at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:206)
         at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
         at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:150)
         at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
         at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
         at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:272)
         at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:637)
         at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:568)
         at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:813)
         at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:341)
         at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:263)
         at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:214)
         at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
         at com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)
    |#]I tried adding breakpoints to all my getters and setters and the constructor of the request-scoped bean, and as they are never triggered I assume this exception occurs before my code is actually accessed. As far as I can tell, for some reason, on creating a postback the value binding of the UISelectItems component is null and as such it can't find the SelectItems it needs. I don't know why this is or how to fix it, though. This doesn't happen if the component isn't created dynamically, and unfortunately our business requirements are as such that I have to create it dynamically.
    Your help would be much appreciated as this really got me stumped and I really need this functionality to be in the project.
    Thank you,
    Ristretto

    Okay ... here's a small proof of concept I created:
    <%@taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
    <%@taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <html>
        <body>
            <f:view>     
                <h:form>
                    <h:panelGrid>
                     <h:commandButton value="Load SelectOneMenu" action="#{pageBean.loadMenu}" />
                  <h:commandButton value="Create Postback" action="#{pageBean.doNothing}" />
              </h:panelGrid>
              <h:panelGrid binding="#{pageBean.panel}" />
             </h:form>
            </f:view>
        </body>
    </html>
    public class PageBean {
        private HtmlPanelGrid panel;
        private List<SelectItem> selectItems;
        public HtmlPanelGrid getPanel() {
            return panel;
        public void setPanel(HtmlPanelGrid panel) {
            this.panel = panel;
        public List<SelectItem> getSelectItems() {
            return selectItems;
        public void setSelectItems(List<SelectItem> selectItems) {
            this.selectItems = selectItems;
        public void loadMenu() {      
            selectItems = new Vector<SelectItem>();
            SelectItem selectItem1 = new SelectItem("first", "First Option");
            SelectItem selectItem2 = new SelectItem("second", "Second Option");
            selectItems.add(selectItem1);
            selectItems.add(selectItem2);
            HtmlSelectOneMenu menu = new HtmlSelectOneMenu();
            UISelectItems items = new UISelectItems();
            ValueExpression expr = getValueExpression("#{pageBean.selectItems}");
            items.setValueExpression("value", expr);
            menu.getChildren().add(items);
            panel.getChildren().add(menu);
        public void doNothing() {
        private ValueExpression getValueExpression(String expression) {
            ExpressionFactory expressionFactory = FacesContext.getCurrentInstance().getApplication().getExpressionFactory();
            ELContext expressionContext = FacesContext.getCurrentInstance().getELContext();
            return expressionFactory.createValueExpression(expressionContext, expression, Object.class);
    }Step 1: Click on "Load SelectOneMenu".
    Step 2: Click on "Create Postback".
    Thanks for having a look at it.
    Ristretto

  • Help needed with SelectOneMenu

    Hi,
    I have a quick, silly question. I'm trying to use a DataTable which has a column populated with a SelectOneMenu for each row. All the SelectOneMenu's contain the same selectable items. My problem is that when ever you try to change the selection of any of the menus they keep their previous value, except for the one in the last row of the table. When the value of the last menu is changed it then changes the value for all menus.
    Here is my sample code:
    <h:dataTable border="1" value="#{bulkBean.bulk}" var="items">
                             <h:column>
                                  <h:selectOneMenu onchange="submit()" binding="#{bulkBean.type2}"
                                       value="#{bulkTypeBean.selectItem}">
                                       <f:selectItems value="#{bulkTypeBean.bulkTypes}" />
                                  </h:selectOneMenu>
                                  <f:facet name="header">
                                       <h:outputText value="Bulk Type" />
                                  </f:facet>
                             </h:column>
                        </h:dataTable>Edited by: MrMiagi on Feb 20, 2008 12:36 AM

    You should bind the selectOneMenu value to a property of the actual row object (the object behind var="items"), not to a property of a single generic bean which would be overwritten everytime on each row iteration. So replace value="#{bulkTypeBean.selectItem}"byvalue="#{items.selectItem}"

  • How to set value in selectOnemenu using binding

    hi all.
    i have bind htmlSelectOneMenu. it contains some value. I want to set or display a value after a process.
    How to change value
    i have tried using setValue method of both binding property and value property of htmlSelectOneMenu.
    Same issue is with InputTextArea. how to set value in it via code(RowSelectionListener of icefaces)

    Balaji wrote:
    hi all.
    i have bind htmlSelectOneMenu. it contains some value. I want to set or display a value after a process.
    How to change value
    i have tried using setValue method of both binding property and value property of htmlSelectOneMenu.
    Same issue is with InputTextArea. how to set value in it via code(RowSelectionListener of icefaces)The html SelectOneMenu is bound to a value of a backing bean. You have to change the value of that backing bean, not the JSF component directly. JSF takes care of updating the model, you shouldn't be touching it unless you know what you are doing.

  • H:selectOneMenu value binding to managed bean property

    Please help. Cannot figure out why selectOneMenu value binding is not working...
    The main contents of my jsp:
         <h:form id="form1" rendered="true">
              <P>
                   <h:selectOneMenu value="#{MBListBoxExample.selectedProject}" rendered="true"
                        required="false">
                        <f:selectItems value="#{MBListBoxExample.items}" />
                   </h:selectOneMenu>
              </P>
              <h:commandButton value="ShowSelected" rendered="true" action="#{MBListBoxExample.showSelected}" />
         </h:form>I have a managed bean with a property that is basically a custom object:
    private Project selectedProject;The selectOneMenu gets populated with the following code in my managed bean:
         public List getItems() {
              try {
                   ArrayList projectList = new ArrayList ();
                   projectList.add(new Project(1, "Project 1"));
                   projectList.add(new Project(2, "Project 2"));
                   projectList.add(new Project(3, "Project 3"));
                   projectList.add(new Project(4, "Project 4"));
                   ArrayList itemList = new ArrayList();
                   for (int x=0; x<projectList.size(); x++) {
                        SelectItem tempItem = new SelectItem();
                        Project tempProj = (Project) projectList.get(x);
                        tempItem.setLabel(tempProj.getName());
                        tempItem.setValue(tempProj);
                        itemList.add(tempItem);
                   return itemList;
              } catch (Exception e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
              return null;
         }The following code is tied to my command button to display some simple output when the button is clicked:
         public void showSelected() {
              System.out.println("The selected item is: " + selectedProject.getName());
         }If I set the value of the SelectItem (tempItem) above to a String and make the selectedProject variable of type String, the code works.
    My goal is to have the items in the list reference 'Project' objects and be able to get to the selected object when the user clicks the command button.
    Any help is greatly appreciated.

    The problem is that you're missing a converter. JSF needs to convert your values from Strings into Projects and vica verca.
    When you do the form submission the values are passed as strings along with the labels. JSF isn't smart enough to convert them automatically.

  • SelectOneMenu binding error

    I have a JSP with selectOneMenu bound to a backing bean:
    <h:selectOneMenu id="chooseCombo" binding="#{TestBean.comboList}"/>
    The backing bean contains:
    public class TestBean {
    ArrayList comboList = null;
    public TestBean() {
    comboList = new ArrayList();
    comboList.add(new SelectItem("a","Apple"));
    comboList.add(new SelectItem("b","Banana"));
    public ArrayList getComboList() {
    return this.comboList;
    public void setComboList(ArrayList cList) {
    this.comboList = cList;
    Which gives the following exception:
    javax.servlet.ServletException: java.lang.IllegalArgumentException: argument type mismatch
    org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:864)
    org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:800)
    root cause
    javax.faces.el.EvaluationException: java.lang.IllegalArgumentException: argument type mismatch
    com.sun.faces.el.ValueBindingImpl.setValue(ValueBindingImpl.java:240)
    com.sun.faces.application.ApplicationImpl.createComponent(ApplicationImpl.java:491)
    javax.faces.webapp.UIComponentTag.createComponent(UIComponentTag.java:1018)
    1. Does anyone know how i should change my backing bean to prevent this exception?
    2. Is there a method to pre-select a value from the list of values?

    One problem I see, is that you are using the "binding" attribute to refer to your backing bean. "binding" is used for component bindings that refer to component instances. You need to use "value=" when referring to your backing bean (and attributes). For example: value="#{TestBean.combolist}"....

  • Question regarding selectOneMenu and PROCESS_VALIDATIONS(3) phase

    Hi im a bit lost regarding selectOneMenu and how validation phase all works together.
    The thing is that i have a simple selectOneMenu
    <h:form id="SearchForm">                                                  
         <h:panelGrid columns="3"  border="0">
              <h:outputLabel id="caseTypeText" value="#{msg.searchCaseCaseType}" for="caseType" />                         
              <h:selectOneMenu id="caseType" value="#{searchCaseBean.caseType}" style="width: 200px;" binding="#{searchCaseBean.caseTypeSelect}">     
                   <f:selectItem itemValue="" itemLabel="#{msg.CommonTextAll}" />                                             
                   <f:selectItems value="#{searchCaseBean.caseTypes}"  />                              
              </h:selectOneMenu>
              <h:message for="caseType" styleClass="errorMessage" />
              <h:panelGroup />
              <h:panelGroup />
              <h:commandButton action="#{searchCaseBean.actionSearch}" value="#{msg.buttonSearch}" />
         </h:panelGrid>
    </h:form>Now when i hit submit button i can see that the bean method searchCaseBean.caseTypes (used in the <f:selectItems> tag) is executed in the PROCESS_VALIDATIONS(3) phase. How come? I dont whant this method to be executed in phase 3, only in phase 6.
    If i add the this in the method if (FacesContext.getCurrentInstance().getRenderResponse())
    public List<SelectItem> getStepStatuses(){
         List<CaseStep> caseSteps = new ArrayList<CaseStep>();
         if (FacesContext.getCurrentInstance().getRenderResponse()) {
              caseSteps = getCaseService().getCaseStep(value);     
         List<SelectItem> selectItems = new ArrayList<SelectItem>(caseSteps.size());
         for(int i=0; i < caseSteps.size(); i++){
              CaseStep step = caseSteps.get(i);               
              String stepStatus = step.getStatus() + "_" + step.getSubStatus();           
              selectItems.add(new SelectItem(stepStatus, step.getShortName()));
         return selectItems;
    } Now i get a validation error (javax.faces.component.UISelectOne.INVALID) for the select field and only phase1, phase2, phase 3 and phase 6 is executed.
    Im lost?

    I see. Many thanxs BalusC. Im using your blog very often, and its very helpfull for me.
    I changed now to use the constructor load method instead. But know im getting problem of calling my service layer (Spring service bean). Its seems they havent been init when jsf bean is calling its constructor.
    Can i init the spring service bean from the faces-config file?
    JSF Bean
        public SearchCaseBean() {
              super();
                    //caseService need to be init
              if(getCaseService() == null){
                   setCaseService((CaseService)getWebApplicationContextBean("caseService"));
              fillCaseTypeSelectItems();
              fillCaseStatusSelectItems();
    .....faces-config
    <managed-bean>
              <managed-bean-name>searchCaseBean</managed-bean-name>
              <managed-bean-class>portal.web.SearchCaseBean</managed-bean-class>
              <managed-bean-scope>request</managed-bean-scope>          
              <managed-property>
                   <property-name>caseService</property-name>
                   <value>#{caseService}</value>
              </managed-property>
         </managed-bean>

  • How to get submitted Value from SelectOneMenu?

    Hi.
    At the beginning, i would like to say, that i am at the beginning to learn JSP and JSF. I am from germany, so please excuse my english.
    For work i have to develop a form, where the user can select a manufacturer, insert a unique key and get a list of devices after he submits this two attributes.
    At the moment i can not get the value of the selected Item in the selectonemenu.
    I deleted all my trys to get this value, to show you the working parts.
    We work with faces-config.xml, tiles.xml and hybris as platform.
    My code:
    deviceFamilyMain.jsp:
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
    <h:form id="frmDeviceFamilySelect">
      <h:selectOneMenu binding="#{DeviceFamilyBean.selectOneMenuDeviceFamilies}" id="selectOneMenuDeviceFamilies">
         <f:selectItems binding="#{DeviceFamilyBean.dropdownDeviceFamilySelectItems}" id="dropdownDeviceFamilySelectItems" />
      </h:selectOneMenu>
      <h:commandButton action="#{DeviceFamilyBean.detailsAction}" value="Main"/>
    </h:form>
    DeviceFamilyBean:
    public class DeviceFamilyBean extends TC_JSFBean
         //selectOneMenuDeviceFamilies
         HtmlSelectOneMenu selectOneMenuDeviceFamilies = new HtmlSelectOneMenu();
         public HtmlSelectOneMenu getSelectOneMenuDeviceFamilies() {
              return selectOneMenuDeviceFamilies;
         public void setSelectOneMenuDeviceFamilies(HtmlSelectOneMenu selectOneMenuDeviceFamilies) {
              this.selectOneMenuDeviceFamilies = selectOneMenuDeviceFamilies;
         //dropdownDeviceFamilySelectItems
         private UISelectItems dropdownDeviceFamilySelectItems = new UISelectItems();
         public UISelectItems getDropdownDeviceFamilySelectItems() {
                  Object objFacesSession = FacesContext.getCurrentInstance().getApplication()
               .getVariableResolver().resolveVariable(getFacesContext(), "SessionBean");
                  SessionBean sessionBean = (SessionBean) objFacesSession;
              dropdownDeviceFamilySelectItems.setValue(getDropdownDeviceFamilyDefaultItems());
              return dropdownDeviceFamilySelectItems;
         public void setDropdownDeviceFamilySelectItems(UISelectItems dropdownDeviceFamiliesSelectItems) {
                  this.dropdownDeviceFamilySelectItems = dropdownDeviceFamiliesSelectItems;
         //dropdownDeviceFamilyDefaultItems
         private ArrayList dropdownDeviceFamilyDefaultItems = new ArrayList();
         public ArrayList getDropdownDeviceFamilyDefaultItems() {
              Object objFacesSession = FacesContext.getCurrentInstance().getApplication()
              .getVariableResolver().resolveVariable(getFacesContext(), "SessionBean");
              SessionBean sessionBean = (SessionBean) objFacesSession;
            TC_Manager tcDeviceFamilyManager = TC_Manager.getInstance();
            dropdownDeviceFamilyDefaultItems.clear();             
              Collection col = this.getAllDeviceFamilies();
              Iterator itDev = col.iterator();
              while (itDev.hasNext())
                   DeviceFamily deviceFamily = (DeviceFamily) itDev.next();
                   dropdownDeviceFamilyDefaultItems.add(new SelectItem(deviceFamily.getCode()));
              return dropdownDeviceFamilyDefaultItems;
         public void setDropdownDeviceFamilyDefaultItems(ArrayList dropdownDeviceFamilieDefaultItems) {
              this.dropdownDeviceFamilyDefaultItems = dropdownDeviceFamilieDefaultItems;
         //OutputText DeviceFamily Name
         private HtmlOutputText outputTextDevFamName = new HtmlOutputText();
         public HtmlOutputText getOutputTextDevFamName()
             Object obj = FacesContext.getCurrentInstance().getApplication()
            .getVariableResolver().resolveVariable(getFacesContext(), "SessionBean");
             SessionBean sessionBean = (SessionBean) obj;
             if (sessionBean.getCurrentDeviceFamily() != null)
                  outputTextDevFamName.setValue(sessionBean.getCurrentDeviceFamily().getCode());
             } else {
                  outputTextDevFamName.setValue("CurDevFam = null");
              return outputTextDevFamName;
         public void setOutputTextDevFamName(HtmlOutputText outputTextDevFamName) {
              this.outputTextDevFamName = outputTextDevFamName;
         //detailsAction
         public String detailsAction()
                  Object objFacesSession = FacesContext.getCurrentInstance().getApplication()
              .getVariableResolver().resolveVariable(getFacesContext(), "SessionBean");
                  SessionBean sessionBean = (SessionBean) objFacesSession;
                  //sessionBean.setCurrentDeviceFamily((DeviceFamily) this.getDropdownDeviceFamilySelectItems().getValue());
                  return "go_devicefamily_details";
    SessionBean:
         private DeviceFamily currentDeviceFamily;
         public DeviceFamily getCurrentDeviceFamily() {
              return currentDeviceFamily;
         public void setCurrentDeviceFamily(DeviceFamily currentDeviceFamily) {
              this.currentDeviceFamily = currentDeviceFamily;
    go_devicefamily_details is referenced to deviceFamilyDetails:
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
    <f:view>
        <h:form id="frmDevFamDetails">
            <h:outputText value="#{DeviceFamilyBean.outputTextDevFamName}" />
        </h:form>
    </f:view>I hope i did not forget anything needfull.
    Maybe someone could explain how to get the value and complete the code.
    Thanks.

    Thx 4 the tip.
    I found an other way. It was such easy, that i could kick myself. :-)
    Only in the detailsAction() i needed:
    sessionBean.setCurrentDeviceFamilyName((String) this.getSelectOneMenuDeviceFamilies().getValue());
    I allways looked for dropdownDeviceFamilySelectItems and tryed to get the selected Index, but it is the HtmlSelectOneMenu that carries the value. :-(
    The DeviceFamily Class is an HybrisObject and not easy to initialize.
    I just created a new String (currentDeviceFamilyName).
    Now it works.

  • Problem with selectOneMenu in Datatable

    Hi
    I have the following datatable that binds correctly to a set of Game objects.
    I need to have a dropdown with the numbers 1 to 10 as items which is bound to each dataItem's newRating field.
    However there is some problem with the dropdown that i can't figure out. The datatable stops rendering when it hits the first dropdown.
    At the moment,
    The new rating field in the Game class is of type SelectItem with the appropriate get and set methods.
    Could anyone please point out what I'm doing wrong
    Thanks.
    Here is the relevant part in Home.jsp:
                                              <h:dataTable binding="#{Home.newGamesTable}" id="newGamesTable" value="#{Home.newGames}" var="dataItem">
                                                                <h:column>
                                                                    <f:facet name="header">
                                                                        <h:outputText value=""/>
                                                                    </f:facet>
                                                                    <h:panelGroup layout="block" styleClass="new_game_main">
                                                                        <h:outputText styleClass="new_game_title" value="#{dataItem.title}"/>
                                                                        <h:outputText escape="false" styleClass="new_game_label" value="Date added: "/>
                                                                        <h:outputText styleClass="new_game_data" value="#{dataItem.dateString}"/>
                                                                        <h:outputText escape="false" styleClass="new_game_label" value="Average Rating:"/>
                                                                        <h:outputText styleClass="new_game_data" value="#{dataItem.rating}"/>
                                                                        <h:outputText styleClass="new_game_label" value="Uploaded by:"/>
                                                                        <h:outputText styleClass="new_game_data" value="#{dataItem.userName}"/>
                                                                        <h:commandLink styleClass="new_game_label" value="Play Now!"/>
                                                                        <h:selectOneMenu styleClass="new_game_rating" value="#{dataItem.newRating}">
                                                                            <f:selectItems value="#{ratingItems}" />
                                                                        </h:selectOneMenu>
                                                                        <h:commandLink action="#{Home.rateNewGame}" styleClass="message_link" value="Rate"/>
                                                                    </h:panelGroup>
                                                                </h:column>
                                                            </h:dataTable>and Home.java
    private List<SelectItem> ratingItems = null;
         public List<SelectItem> getRatingItems()
             if (ratingItems == null)
                 ratingItems = new ArrayList<SelectItem>();
                 for (int i = 1; i <= 10; i++)
                     SelectItem item = new SelectItem();
                     item.setValue(Integer.valueOf(i));                        
                     ratingItems.add(item);
             return ratingItems;
         public void setRatingItems(List<SelectItem> items)
             ratingItems = items;        
        private List<Game> newGames = null;
        private boolean hasNewGames;
        public List<Game> getNewGames()
            if (newGames ==null)
                newGames = DataFactory.getNewGames();           
            hasNewGames = !newGames.isEmpty();
            return newGames;
        }

    What do you mean by stops rendering? Can you paste the relevant portion of the output (from view source in the browser).

  • Problem with binding of a selectManyCheckbox inside a dataTable

    Hi,
    first i want to point out that my english is not the best. :)
    A german version is followed at the end of the english text.
    I have a class "MyClass" with few attributes like:
    private long id;
    private String text;
    private Set<MyClass2> childs;
    An a second class "MyClass2" wich also have some attributes:
    private long id;
    private String text;
    Now i have a List with lots of objects from typ "MyClass":
    List myList = new ArrayList();
    // Sample Data!!
    for (int i=0; i<100; i++)
    MyClass1 m1 = new MyClass1();
    m1.setId(i);
    m1.setText("MyClass1 Line " + i);
    // Now add some "childs":
    for (int j=0; j<i*2; j++)
    MyClass2 m2 = new MyClass2();
    m2.setId( i );
    m2.setText("Sample "+ i);
    m1.getChilds().add(m2);
    myList.add ( m1 );
    So now i want to show the ID and text every Object of MyClass1 on my "test.jsp" (width JSF Tags).
    The Collections inside this class should display as checkboxes (value = id, label = text).
    Sample:
    ID: +1+ TEXT: MyClass1 Line 1
    CHECKBOXES:
    [x] Sample 0
    [x] Sample 1
    ID: +2+ TEXT: MyClass1 Line 2
    CHECKBOXES:
    [x] Sample 0
    [x] Sample 1
    [x] Sample 2
    [x] Sample 3
    Okay i think you know what i mean. ;-)
    I tryed it also with a dataTable to iterate in "myList" and use a selectOneMenu with selectItems to generate the checkboxes.
    Here is the code:
    <h:dataTable value="#{myBean.myList}" var="rowInstance" binding="#{myBean.dataTable}" id="dataTable">
    <h:column>
    <h:outputText value="ID: #{rowInstance.id}" />
    <h:outputText value="TEXT: #{rowInstance.text}" />
    </h:column>
    <h:column>
    <h:selectManyCheckbox id="cbox" styleClass="checkbox">
    <f:selectItems value="#{myBean.childs}"/>
    </h:selectManyCheckbox>
    </h:column>
    </h:dataTable>
    Maybe you see the that i've used childs in the selectItems.
    This is a methode like that:
    public SelectItem[] getChilds()
    MyClass1 mc1 = (MyClass1) dataTable.getRowData();
    // now i iterate the childs and make for each a SelectItem()
    Also you maybe see that i have no binding on selectManyCheckbox, because i have no idea how it works. :-)
    I've tried to bind it to a String[] but and the end this String[] always contain the last low.
    My Question is now:
    When the user pressed the submit Button how can i figure out which Checkboxen the user clicked ?
    Thank you a lot.
    Now the german version (surley better explained):
    Hallo nochmal,
    ich habe versucht auf englisch mein Problem zu schildern.
    Was mit sicherheit nicht zu 100% gelungen ist, deshalb hier noch mal eine deutschsprachige Version (maybe some germans out there).
    Wie oben abgeblidet habe ich im Prinzip zwei Klassen.
    Die erste Klasse "MyClass1" hat eine Collection die Objekte von der Klasse "MyClass2" enth�lt.
    Nun m�chte ich auf meiner JSP Seite die JSF Tags benutzt eine Liste von Objekten (die vom Typ "MyClass1" sind) abbilden.
    Die Collection innerhalb dieser Klasse soll als Checkboxen dargestellt werden.
    Ich habe es ohne gro�e Probleme hinbekommen, dass er das so anzeigt wie ich das m�chte.
    Nur habe ich z.Z. noch Probleme damit wie ich sp�ter herausfinde, welche der Checkboxen denn nun angew�hlt sind.
    Normalerweise w�rde man ja ein binding machen, so k�nnte man alle ausgew�hlten Checkboxen (getSelectedValues()) ja bekommen.
    Da aber die Anzahl der Objekte immer unterschiedlich ist kann ich nicht die entsprechenden Variablen anlegen.
    Deshalb die Frage: Wie bekomme ich mit welche der Checkboxen ausgew�hlt wurden? Wie muss das binding aussehen?
    Vielen Dank.
    Greetings from Germany. :)

    Just bind it to the row object.
    JSF<h:dataTable value="#{myBean.myDataList}" var="myData">
        <h:column>
            <h:selectManyCheckbox value="#{myData.selectedItems}">
                <f:selectItems value="#{myData.selectItems}" />
            </h:selectManyCheckbox>
        </h:column>
    </h:dataTable>MyDataprivate List<String> selectedItems; // + getter + setter
    private List<SelectItem> selectItems; // + getter

  • How to bind a complex object to a composite component

    I'm using JSF2 and having an issue binding an object (EL Expression) as a parameter to my composite component.
    I have written a composite component (not very complex) that will display a drop-down list of countries and should bind the selection to a provided target bean.
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:composite="http://java.sun.com/jsf/composite"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:a4j="http://richfaces.org/a4j"
    xmlns:rich="http://richfaces.org/rich">
    <!-- INTERFACE -->
    <composite:interface>
    <composite:attribute name="label" required="true" />
    <composite:attribute name="requiredMessage" required="true"/>
    <composite:attribute name="target" required="true" type="com.mycompany.entity.Country"/>
    </composite:interface>
    <!-- IMPLEMENATION -->
    <composite:implementation>
    <h:panelGrid columns="2">
    <h:outputLabel for="country-list" value="#{cc.attrs.label}"/>
    <h:panelGrid id="country" columns="1" styleClass="select-one-menu-panel" >
    <h:selectOneMenu id="country-list"
    enabledClass="select-one-menu-enabled" disabledClass="select-one-menu-disabled"
    layout="pageDirection"
    value="#{cc.attrs.target}"
    required="true" requiredMessage="#{cc.attrs.requiredMessage}"
    >
    <f:selectItem itemLabel="#{msgs['label.pleaseSelect']}" itemValue="" />
    <f:selectItems value="#{countryController.countries}" />
    <a4j:ajax />
    </h:selectOneMenu>
    <a4j:outputPanel id="country-list-error-panel" ajaxRendered="true">
    <h:message id="country-list-error" for="country-list" style="color:red"/>
    </a4j:outputPanel>
    </h:panelGrid>
    </h:panelGrid>
    </composite:implementation>
    </html>
    I want to be able to use the composite component in the following way:
    <util:country-select
    label="#{msgs['label.countryOfBirth']}"
    requiredMessge="#{msgs['error.birthCountryRequired']}"
    target="#{participant.countryOfBirth}"/>
    When I load the page everything renders correctly, but when I select an item from the drop-down I get a validation error.
    apply-form:j_idt77:country-list: Validation Error: Value is not valid
    I know that it must be something with the way that I have the parameters defined but I simply can't find any information to help me figure this out.
    Any light that you might be able to she on this would be greatly appreciated.
    Thank you for the help...

    Hi,
    well, you can. What the ADF Data Control and thus the binding gives you is the JSF component binding and the business service access.
    If you don't want to use ADF, then what you can do is
    - Create an ADF BC root Application Module from a managed bean
    e.g. see http://docs.oracle.com/cd/E21764_01/web.1111/b31974/bcservices.htm#CHDDDBFC
    - Access the View Object for querying the data to display
    - Expose the queried data so the component can handle it e.g. setter/getter for input components, ArrayList for tables (or you create the more complex component models like table and tree models)
    Having outlined the above, here are some gotchas to watch out for
    - Make sure creating the root application module is done such that you don't create/release it with each request. So you may consider a data serving managed bean in a scope like page flow or session
    - Ensure you have helper methods that allow you to query and CRUD operate the View Object data
    Frank

  • How to get the selected value in SelectOneMenu in backing bean

    Hello all,
    I need your help. I want to have 2 select menus with the second menu's items list are populated based on the selection in the first menu. I don't know how to get the selected value in the backing bean so that I can based on that select menu to populate the second menu's item list. Basically I need to access to the UI Component of the first select Menu and retrieve its selected value.
    Could you help me out?
    Thank you very much in advance,
    Lngo

    Hi Lingo,
    There r two ways of getting the values into the list. First one is hardcoding the values and the second one is use the list and get the values into the list by firing a query in the database.
    Inorder to display the values in the second menu based on the first onces selection we need to add an attribute to the first selectonemenu known as valueChangeListener and we need to sumit the page.
    Here is the sample code
    <h:selectOneMenu id="catalogue"
                                  binding="#{urbean.catalogue}" onchange="submit()"
                                  valueChangeListener="#{urbean.categoryValueChange}"
                                  <f:selectItem itemLabel="Select Catalogue" itemValue="" />
                                  <f:selectItems value="#{urbean.catalogueList}" />
    </h:selectOneMenu>
    <h:selectOneMenu id="category"
                                  binding="#{urbean.category}">     <f:selectItem itemLabel="Select Category" itemValue="" />
                                  <f:selectItems value="#{urbean.categoryList}" />
                                  <                         </h:selectOneMenu>
    now in method called by valuechangelistener we need to write the similar code
    public void categoryValueChange(ValueChangeEvent event) {
    String rfnum = (String) event.getNewValue();
    List categoryList = new ArrayList();
    List tempList = new TablenameDAO().getActiveCatByCatalogueID(rfnum);
              for (int i = 0; i < tempList.size(); i++) {
                   Tablename tablename = (Tablename ) tempList.get(i);
                   String value = "" + tablename .getrfnum();
    String label = tablename .getname();
         if (label == null) {
                   label = "";
                   SelectItem item = new SelectItem(value, label);
                   categoryList.add(item);
              bean.setCategoryList(categoryList);
    ///getActiveCatByCatalogueID (rfnum) should bring the records which r based on the rfnum
    if u follow this process i am damsure that u will get the values in to the secondlist based upon the first list
    Thanks & Regards
    Manidhar

  • Need help with SelectOneMenu in a HtmlDataTable: Default Values

    Hello again,
    I have an DataTable in my jsp and 1 of the columns need to be a dropdown.
    Further, I also need the dropdown defaulted to whatever data that is currently in the datatable.
    I can get the dropdown data to display, however I cannot get it to default to a value in each row.
    So far I've got the following:
    jsp:
    <h:dataTable id="dataTable" binding="#{AddSponsors.projectDepartmentsDataTable}" value="#{AddSponsors.projectDepartments}" var="projectDepartments"  border="1" >
    <h:column>
       <f:facet name="header" >
          <h:outputText value="Department" styleClass="labelcell"/>     
       </f:facet>
       <h:selectOneMenu value="#{projectDepartments.deptCode}">
          <f:selectItems value="#{AddSponsors.selectItemsDepartment}" />
       </h:selectOneMenu>
    </h:column>**Note that AddSponsors.projectDepartments is a list of the object AddSponsorsDTO.
    AddSponsorsDTO:
    public class AddSponsorsDTO implements java.io.Serializable{
       private String deptCode;
       private String deptName;
       private Double percentAllocation;
      //getters and setters for the above
    }session scoped backing bean:
    I have the dropdown populated fine like this:
    //getter for the dropdown
    public List<SelectItem> getSelectItemsDepartment() {
       fillSelectItemsDepartment();
       return selectItemsDepartment;
    //fill the dropdown
    public void fillSelectItemsDepartment(){
       TbDepartment t;
       List l = this.tbDepartmentDAO.findAll();
       selectItemsDepartment = new ArrayList<SelectItem>();
       for (Iterator i = l.iterator(); i.hasNext();){
          t = (TbDepartment) i.next();
          selectItemsDepartment.add(new SelectItem(t.getDeptCode(), t.getDeptName()));
    }How is an item selected in the dropdown. Let's say programatically for example? By deptCode?
    Am I missing anything here?
    Thanks!
    Nick
    Edited by: nicksan on Nov 15, 2007 4:14 PM

    I revisited that page and now I understand a bit more clearly.
    The key for me was the LinkedHashedMap and the get() method.
    As you suggested, I also created a DTO to store the key and value.
    Then I populate the Map like this:
    selectListDTOMap = new LinkedHashMap<String, SelectListDTO>();
    for (Iterator i = l.iterator(); i.hasNext();){
       t = (TbDepartment) i.next();
       selectListDTOMap.put(t.getDeptCode(),  new SelectListDTO(t.getDeptCode(), t.getDeptName()));
    }Then I've got another method that populates the actual SelectItems.
    selectItemsDepartment = new ArrayList<SelectItem>();
    List<SelectListDTO> list = new ArrayList<SelectListDTO>(selectListDTOMap.values());
    for(SelectListDTO dto : list){
       selectItemsDepartment.add(new SelectItem(dto.getKey(), dto.getValue()));
    }I also have a valueChangeListener like this:
    public void selectItemChanged(ValueChangeEvent event){
       String newValue = (String) event.getNewValue();
       SelectListDTO dto = (SelectListDTO) selectListDTOMap.get((String)event.getNewValue());
       AddSponsorsDTO s = (AddSponsorsDTO) projectDepartmentsDataTable.getRowData();
       s.setDeptCode(dto.getKey());
       s.setDeptName(dto.getValue());
       s.setDataItemStatus(AddSponsorsDTO.NewModified);
       //set the new data to the datatable data          
       projectDepartments.set(projectDepartmentsDataTable.getRowIndex(), s);
    }Makes sense?

  • How to set the default item showed in a h:selectonemenu

    I need to show the second, or the third, and on so.
    i tried some ways to set the default item showed in it, but failed.
    i had tried the attribute value, but it stiil showed the first item.
    Can u help me?
    in the JSP
    <h:selectOneMenu id = "companyName" rendered="true" binding="#{j03CMSyainAddBean.selectCompany}" style="width:150">
           <f:selectItems value="#{j03CMSyainAddBean.companyList2}"/>
    </h:selectOneMenu>in the back BEAN
    private UISelectOne selectCompany;
    private ArrayList companyList2;In the ArrayList companyList2, there are several selectItems.
    Thanks
    George

    Sanjeev K Sharma wrote:
    and without messing with /boot/grub/grub.cfg  ?
    I need this so that new kernels show up but do not change the default boot kernel
    Is there a way to do it by file name instead of position within the menuentry / submenu list?
    I found some ubuntu and fedora sugestions but all by position, none by name
    AND how to set the kdump kernel as the default?
    Arch is putting this kernel under a submenu - would this pose problems for setting it as the default?
    In /etc/default/grub you can use the name of your entry you wish to use as default
    GRUB_DEFAULT='Arch Linux, with Linux core repo kernel'
    You can tell grub to stop using submenus by doing:
    GRUB_DISABLE_SUBMENU=y
    Or you can just make a purely custom menuentry in /etc/grub.d/40_custom if you'd like:
    menuentry "Other Linux" {
    linux <KERNEL IMAGE HERE>
    initrd <INITRD IMAGE HERE>
    EDIT: /etc/grub/default -> /etc/default/grub
    Last edited by Slabity (2015-04-07 11:16:22)

  • SelectOneMenu inside h:dataTable gives conversion error

    Hi guys,
    I'm enduring quite alot of misery attempting to put selectOneMenu UI components in my h:dataTable. Due to the 30000 character restriction, I can only submit my view and backing bean and DTO and the converter (even though the total characters of my files is only 26,583? [cat * | wc -c]). Perhaps you can figure out a way I can send me all my files and you'll be able to test it much easier.
    The jist of the problem is that I get a conversion error between the selectOneMenu and the backing DTO of the <h:dataTable>. After I define a converter I get a ClassCastException.
    My BIGGEST question is "Why do I even need a converter?", the selectItem(s)/options are hardcoded label/value Strings and so is the the property of the dataTable row's backing DTO!!!
    Here's the files, any assistance will be greatly appreciated.
    P.S. I'm running JDeveloper 10.1.3.3.
    Thanks.
    (All these files are in the same package so you can just put them all in a directory named "example"):
    My DTO BudgetEquipmentListVO.java:
    package example;
    import java.util.Date;
    import java.util.List;
    public class BudgetEquipmentListVO {
        private Integer rowNo = new Integer("0");               //Row number for paging thru dataTables.
        private String equipmentListId = new String("0");                        //From equipment_list table.
        private Integer equipmentCodeId = new Integer("0");         //From equipment_codes table
        private String objectCode = "0730";                     //So far, 0730,0735 are possible.
        private Integer budgetId = new Integer("0");            //fed_budget_id from fed_budget table.
        private String  description = "";
        private String  equipNo = "";                           //Alphanumeric
        private Date    dateAcquired = new Date();  
        private Integer estimatedCost = new Integer("0");       //Used for Stimulus Application
        private Integer actualCost = new Integer("0");          //Used for EOY expenditures.  Disable for stimulus application
        private String  bldgLocation = "";                      //Address where equipment is at.
        private String  approvedInd = "N";                      //Whether item's been approved or not. Y/N
        private Integer amountApproved = new Integer("0");      //Gets set on approval page.
        private StringBuffer comment = new StringBuffer(4000);  //Currently max 4000 chars
        private String  suppInstInd = "I";            //Support or Instruction item, S or I
        private Integer approvedById = new Integer("0");        //User id of approver.
        private Date    approvedDate = null;                    //Date approved
        private List<BudgetEquipmentListVO> innerList;
        public BudgetEquipmentListVO() {
        public void setObjectCode(String objectCode) {
            this.objectCode = objectCode;
        public String getObjectCode() {
            return objectCode;
        public void setBudgetId(Integer budgetId) {
            this.budgetId = budgetId;
        public Integer getBudgetId() {
            return budgetId;
        public void setDescription(String description) {
            this.description = description;
        public String getDescription() {
            return description;
        public void setEquipNo(String equipNo) {
            this.equipNo = equipNo;
        public String getEquipNo() {
            return equipNo;
        public void setDateAcquired(Date dateAcquired) {
            this.dateAcquired = dateAcquired;
        public Date getDateAcquired() {
            return dateAcquired;
        public void setEstimatedCost(Integer estimatedCost) {
            this.estimatedCost = estimatedCost;
        public Integer getEstimatedCost() {
            return estimatedCost;
        public void setActualCost(Integer actualCost) {
            this.actualCost = actualCost;
        public Integer getActualCost() {
            return actualCost;
        public void setBldgLocation(String bldgLocation) {
            this.bldgLocation = bldgLocation;
        public String getBldgLocation() {
            return bldgLocation;
        public void setApprovedInd(String approvedInd) {
            this.approvedInd = approvedInd;
        public String getApprovedInd() {
            return approvedInd;
        public void setAmountApproved(Integer amountApproved) {
            this.amountApproved = amountApproved;
        public Integer getAmountApproved() {
            return amountApproved;
        public void setComment(StringBuffer comment) {
            this.comment = comment;
        public StringBuffer getComment() {
            return comment;
        public void setSuppInstInd(String suppInstInd) {
            this.suppInstInd = suppInstInd;
        public String getSuppInstInd() {
            return suppInstInd;
        public void setApprovedById(Integer approvedBy) {
            this.approvedById = approvedBy;
        public Integer getApprovedById() {
            return approvedById;
        public void setApprovedDate(Date approvedDate) {
            this.approvedDate = approvedDate;
        public Date getApprovedDate() {
            return approvedDate;
        public void setRowNo(Integer rowNo) {
            this.rowNo = rowNo;
        public Integer getRowNo() {
            return rowNo;
        // Helpers ------------------------------------------------------------------------------------
         // Getters ------------------------------------------------------------------------------------
         public String getKey() {
             return equipmentListId;
         public BudgetEquipmentListVO getValue() {
             return this;
        // This must return true for another Foo object with same key/id.
        public boolean equals(Object other) {
            return other instanceof BudgetEquipmentListVO && equipmentListId != null && equipmentListId.equals(((BudgetEquipmentListVO) other).getEquipmentListId());
        // This must return the same hashcode for every Foo object with the same key.
        public int hashCode() {
            return equipmentListId != null ? this.getClass().hashCode() + equipmentListId.hashCode() : super.hashCode();
        // Override Object#toString() so that it returns a human readable String representation.
        // It is not required by the Converter or so, it just pleases the reading in the logs.
        public String toString() {
            return "BudgetEquipmentListVO[" + equipmentListId.toString() + ", " + equipmentCodeId.toString() + ", " + objectCode + ", " + approvedInd + ", " + suppInstInd + "]";
        public void setEquipmentListId(String equipmentListId) {
            this.equipmentListId = equipmentListId;
        public String getEquipmentListId() {
            return equipmentListId;
        public void setEquipmentCodeId(Integer equipmentCodeId) {
            this.equipmentCodeId = equipmentCodeId;
        public Integer getEquipmentCodeId() {
            return equipmentCodeId;
        public void setInnerList(List<BudgetEquipmentListVO> innerList) {
            this.innerList = innerList;
        public List<BudgetEquipmentListVO> getInnerList() {
            return innerList;
    The View, equipmentList.jspx:
    <?xml version='1.0' encoding='windows-1252'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"
              xmlns:h="http://java.sun.com/jsf/html"
              xmlns:f="http://java.sun.com/jsf/core"
              xmlns:af="http://xmlns.oracle.com/adf/faces"
              xmlns:afh="http://xmlns.oracle.com/adf/faces/html">
      <jsp:output omit-xml-declaration="true" doctype-root-element="HTML"
                  doctype-system="http://www.w3.org/TR/html4/loose.dtd"
                  doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"/>
      <jsp:directive.page contentType="text/html;charset=windows-1252"/>
      <f:view>
      <f:loadBundle basename="myBundle" var="myBundle"/>
        <afh:html>
          <afh:head title="ARRA - Equipment List (0730, 0735)">
            <meta http-equiv="Content-Type"
                  content="text/html; charset=windows-1252"/>
            <link rel="stylesheet" type="text/css" href="/css/crud.css" />
            <script type="text/javascript" src="/js/global.js"></script>
          </afh:head>
          <afh:body>
            <h:form id="equipmentForm">
              <afh:tableLayout width="100%">
                <afh:rowLayout width="100%" halign="center">
                  <afh:cellFormat columnSpan="1" width="100%" halign="center"
                                  rowSpan="1">
                    <h:dataTable value="#{backing_equipmentScreen.dataList}"
                                 binding="#{backing_equipmentScreen.dataTable}"
                                 styleClass="dataTable" rowClasses="rowOdd,rowEven"
                                 var="dataItem" id="table" border="2"
                                 bgcolor="#C2DFFF" width="100%"
                                 rows="#{backing_equipmentScreen.numItems}">
                    <f:facet name="header">
                        <af:outputText value="#{myBundle.headerTable}"
                                       inlineStyle="font-size:small;"/>
                      </f:facet>
                        <h:column>
                            <f:facet name="header">
                                <af:outputText value="#{myBundle.headerColumnRowNumber}"
                                         inlineStyle="font-size:small;"/>
                            </f:facet>
                            <af:outputText value="#{backing_equipmentScreen.dataTable.rowIndex + 1}"
                                       inlineStyle="font-size:small;"/>
                      </h:column>
                      <h:column>
                        <f:facet name="header">
                          <h:panelGroup>
                            <afh:rowLayout>
                              <afh:cellFormat inlineStyle="font-size:small;">
                                <h:outputText value="#{myBundle.headerColumnDesc}"/>
                              </afh:cellFormat>
                            </afh:rowLayout>
                          </h:panelGroup>
                        </f:facet>
                        <h:panelGroup>
                          <afh:rowLayout>
                            <afh:cellFormat inlineStyle="font-size:small;">
                              <h:outputText value="#{dataItem.description}"/>
                            </afh:cellFormat>
                          </afh:rowLayout>
                        </h:panelGroup>
                      </h:column>
                      <h:column>
                        <f:facet name="header">
                          <h:panelGroup>
                            <afh:rowLayout>
                              <afh:cellFormat inlineStyle="font-size:small;">
                                <h:outputText value="#{myBundle.headerColumnEquipNo}"/>
                              </afh:cellFormat>
                            </afh:rowLayout>
                          </h:panelGroup>
                        </f:facet>
                        <h:panelGroup>
                          <afh:rowLayout>
                            <afh:cellFormat inlineStyle="font-size:small;">
                              <h:inputText value="#{dataItem.equipNo}"
                                           />
                            </afh:cellFormat>
                          </afh:rowLayout>
                        </h:panelGroup>
                      </h:column>
                      <h:column>
                        <f:facet name="header">
                          <h:panelGroup>
                            <afh:rowLayout>
                              <afh:cellFormat inlineStyle="font-size:small;">
                                <h:outputText value="#{myBundle.headerColumnDateAcquired}"/>
                              </afh:cellFormat>
                            </afh:rowLayout>
                          </h:panelGroup>
                        </f:facet>
                        <h:panelGroup>
                          <afh:rowLayout>
                            <afh:cellFormat inlineStyle="font-size:small;">
                              <af:selectInputDate value="#{dataItem.dateAcquired}"/>
                            </afh:cellFormat>
                          </afh:rowLayout>
                        </h:panelGroup>
                      </h:column>
                      <h:column>
                        <f:facet name="header">
                          <h:panelGroup>
                            <afh:rowLayout>
                              <afh:cellFormat inlineStyle="font-size:small;">
                                <h:outputText value="#{myBundle.headerColumnObjCode}"/>
                              </afh:cellFormat>
                            </afh:rowLayout>
                          </h:panelGroup>
                        </f:facet>
                        <h:panelGroup>
                          <afh:rowLayout>
                            <afh:cellFormat inlineStyle="font-size:small;">
                              <h:selectOneMenu value="#{dataItem.objectCode}" binding="#{backing_equipmentScreen.objCodeMenu}">
                                <f:selectItem id="item1" itemLabel="0730" itemValue="0730"/>
                                <f:selectItem id="item2" itemLabel="0735" itemValue="0735"/>
                                <f:converter converterId="selectOneMenuConverter"/>
                              </h:selectOneMenu>
                            </afh:cellFormat>
                          </afh:rowLayout>
                        </h:panelGroup>
                      </h:column>
                      <h:column>
                        <f:facet name="header">
                          <h:panelGroup>
                            <afh:rowLayout>
                              <afh:cellFormat inlineStyle="font-size:small;">
                                <h:outputText value="#{myBundle.headerColumnInsSuppInd}"/>
                              </afh:cellFormat>
                            </afh:rowLayout>
                          </h:panelGroup>
                        </f:facet>
                        <h:panelGroup>
                          <afh:rowLayout>
                            <afh:cellFormat inlineStyle="font-size:small;">
                              <h:selectOneMenu value="#{dataItem.suppInstInd}" binding="#{backing_equipmentScreen.suppInstMenu}">>
                                <f:selectItem id="supportitem1" itemLabel="Support" itemValue="S"/>
                                <f:selectItem id="supportitem2" itemLabel="Instruction" itemValue="I"/>
                              </h:selectOneMenu>
                            </afh:cellFormat>
                          </afh:rowLayout>
                        </h:panelGroup>
                      </h:column>
                      <h:column>
                        <f:facet name="header">
                          <h:panelGroup>
                            <afh:rowLayout>
                              <afh:cellFormat inlineStyle="font-size:small;">
                                <h:outputText value="#{myBundle.headerColumnEstCost}"/>
                              </afh:cellFormat>
                            </afh:rowLayout>
                          </h:panelGroup>
                        </f:facet>
                        <h:panelGroup>
                          <afh:rowLayout>
                            <afh:cellFormat inlineStyle="font-size:small;">
                              <h:inputText value="#{dataItem.estimatedCost}">
                              <f:convertNumber
                                                currencySymbol="$"
                                                groupingUsed="#{true}"
                                                maxFractionDigits="0"
                                                type="currency"/>
                              </h:inputText>
                            </afh:cellFormat>
                          </afh:rowLayout>
                        </h:panelGroup>
                      </h:column>
                      <h:column>
                        <f:facet name="header">
                          <h:panelGroup>
                            <afh:rowLayout>
                              <afh:cellFormat inlineStyle="font-size:small;">
                                <h:outputText value="#{myBundle.headerColumnActualCost}"/>
                              </afh:cellFormat>
                            </afh:rowLayout>
                          </h:panelGroup>
                        </f:facet>
                        <h:panelGroup>
                          <afh:rowLayout>
                            <afh:cellFormat inlineStyle="font-size:small;">
                              <h:inputText value="#{dataItem.actualCost}">
                              <f:convertNumber
                                                currencySymbol="$"
                                                groupingUsed="#{true}"
                                                maxFractionDigits="0"
                                                type="currency"/>
                              </h:inputText>
                            </afh:cellFormat>
                          </afh:rowLayout>
                        </h:panelGroup>
                      </h:column>
                      <h:column>
                        <f:facet name="header">
                          <h:panelGroup>
                            <afh:rowLayout>
                              <afh:cellFormat inlineStyle="font-size:small;">
                                <h:outputText value="#{myBundle.headerColumnBldgLoc}"/>
                              </afh:cellFormat>
                            </afh:rowLayout>
                          </h:panelGroup>
                        </f:facet>
                        <h:panelGroup>
                          <afh:rowLayout>
                            <afh:cellFormat inlineStyle="font-size:small;">
                              <h:inputTextarea value="#{dataItem.bldgLocation}"/>
                            </afh:cellFormat>
                          </afh:rowLayout>
                        </h:panelGroup>
                      </h:column>
                      <h:column>
                        <f:facet name="header">
                          <h:panelGroup>
                            <afh:rowLayout>
                              <afh:cellFormat inlineStyle="font-size:small;">
                                <h:outputText value="#{myBundle.headerColumnApprovedInd}"/>
                              </afh:cellFormat>
                            </afh:rowLayout>
                          </h:panelGroup>
                        </f:facet>
                        <h:panelGroup>
                          <afh:rowLayout>
                            <afh:cellFormat inlineStyle="font-size:small;">
                              <h:selectOneMenu value="#{dataItem.approvedInd}" binding="#{backing_equipmentScreen.yesNoMenu}">>
                                <f:selectItem id="yesnoitem1" itemLabel="Yes" itemValue="Y"/>
                                <f:selectItem id="yesnoitem2" itemLabel="No" itemValue="N"/>
                              </h:selectOneMenu>
                            </afh:cellFormat>
                          </afh:rowLayout>
                        </h:panelGroup>
                      </h:column>
                      <h:column>
                        <f:facet name="header">
                          <h:panelGroup>
                            <afh:rowLayout>
                              <afh:cellFormat inlineStyle="font-size:small;">
                                <h:outputText value="#{myBundle.headerColumnComments}"/>
                              </afh:cellFormat>
                            </afh:rowLayout>
                          </h:panelGroup>
                        </f:facet>
                        <h:panelGroup>
                          <afh:rowLayout>
                            <afh:cellFormat inlineStyle="font-size:small;">
                              <h:inputTextarea value="#{dataItem.comment}"/>
                            </afh:cellFormat>
                          </afh:rowLayout>
                        </h:panelGroup>
                      </h:column>
                        <f:facet name="footer">
                            <h:panelGrid columns="4">
                                <h:outputLabel for="rows" value="#{myBundle.labelRowsPage}:" />
                                <h:panelGroup>
                                    <h:inputText id="rows" value="#{backing_equipmentScreen.dataTable.rows}" styleClass="input" size="1"><f:validateLongRange minimum="1" maximum="100" /></h:inputText>
                                    <h:commandButton value="#{myBundle.buttonSet}" action="#{backing_equipmentScreen.pageFirst}" styleClass="input" />
                                </h:panelGroup>
                                <h:outputText value="#{myBundle.labelPaging}:" />
                                <h:panelGroup>
                                    <h:commandButton value="#{myBundle.buttonFirst}" action="#{backing_equipmentScreen.pageFirst}" styleClass="input" disabled="#{backing_equipmentScreen.dataTable.first == 0}" />
                                    <h:commandButton value="#{myBundle.buttonPrevious}" action="#{backing_equipmentScreen.pagePrevious}" styleClass="input" disabled="#{backing_equipmentScreen.dataTable.first == 0}" />
                                    <h:commandButton value="#{myBundle.buttonNext}" action="#{backing_equipmentScreen.pageNext}" styleClass="input" disabled="#{backing_equipmentScreen.dataTable.first + backing_equipmentScreen.dataTable.rows >= backing_equipmentScreen.dataTable.rowCount}" />
                                    <h:commandButton value="#{myBundle.buttonLast}" action="#{backing_equipmentScreen.pageLast}" styleClass="input" disabled="#{backing_equipmentScreen.dataTable.first + backing_equipmentScreen.dataTable.rows >= backing_equipmentScreen.dataTable.rowCount}" />
                                    <h:outputText value="#{myBundle.labelPage}: #{backing_equipmentScreen.currentPage} / #{backing_equipmentScreen.totalPages}" />
                                </h:panelGroup>
                                <h:outputLabel for="add" value="#{myBundle.labelAddRows}:" />
                                <h:panelGroup>
                                    <h:inputText id="add" value="#{backing_equipmentScreen.addCount}" styleClass="input" size="1"><f:validateLongRange minimum="1" maximum="100" /></h:inputText>
                            <af:commandButton action="#{backing_equipmentScreen.actionAdd}"
                                              styleClass="input"
                                              text="#{myBundle.buttonAdd}"/>
                          </h:panelGroup>
                                <h:outputText value="#{myBundle.labelActions}:" />
                                <h:panelGroup>
                                    <h:commandButton value="#{myBundle.buttonSelectAll}" action="#{backing_equipmentScreen.actionSelectAll}" rendered="#{!backing_equipmentScreen.editMode and !backing_equipmentScreen.selectAll}" styleClass="input" />
                                    <h:commandButton value="#{myBundle.buttonUnselectAll}" action="#{backing_equipmentScreen.actionSelectAll}" rendered="#{!backing_equipmentScreen.editMode and backing_equipmentScreen.selectAll}" styleClass="input" />
                                    <h:commandButton value="#{myBundle.buttonEdit}" action="#{backing_equipmentScreen.actionEdit}" rendered="#{!backing_equipmentScreen.editMode}" styleClass="input" />
                                    <h:commandButton value="#{myBundle.buttonDelete}" action="#{backing_equipmentScreen.actionDelete}" rendered="#{!backing_equipmentScreen.editMode}" styleClass="input" />
                                    <h:commandButton id="save" value="#{myBundle.buttonSave}" action="#{backing_equipmentScreen.actionSave}" rendered="#{backing_equipmentScreen.editMode}" styleClass="input" />
                                    <h:commandButton value="#{myBundle.buttonRefresh}" action="#{backing_equipmentScreen.actionRefresh}" immediate="true" styleClass="input" />
                                    <h:commandButton value="#{myBundle.buttonReset}" action="#{backing_equipmentScreen.actionReset}" immediate="true" styleClass="input" />
                                </h:panelGroup>
                            </h:panelGrid>
                        </f:facet>
                    </h:dataTable>
                    <h:panelGroup rendered="#{empty backing_equipmentScreen.dataList and !backing_equipmentScreen.message}">
                        <h:panelGroup rendered="#{!backing_equipmentScreen.searchMode}">
                            <h:outputText value="#{myBundle.textNoData}" />
                            <h:commandButton value="#{myBundle.buttonAdd}" action="#{backing_equipmentScreen.actionAdd}" styleClass="input" />
                        </h:panelGroup>
                        <h:outputText value="#{myBundle.textRefineSearch}" rendered="#{backing_equipmentScreen.searchMode}" />
                    </h:panelGroup>
                    <h:panelGroup rendered="#{backing_equipmentScreen.message}">
                        <h:outputText value="#{myBundle.textErrors}" styleClass="error" />
                        <h:messages styleClass="error" />
                    </h:panelGroup>
                  </afh:cellFormat>
                </afh:rowLayout>
              </afh:tableLayout>
            </h:form>
          </afh:body>
        </afh:html>
      </f:view>
    </jsp:root>

    Hi evryone,
    I have following piece of code
    <?xml version='1.0' encoding='windows-1252'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
    <jsp:directive.page contentType="text/html;charset=windows-1252"/>
    <f:view>
    <af:document>
    <af:messages/>
    <af:form>
    <af:selectOneChoice>
    <f:selectItem itemLabel="ABC" itemValue="ABC"/>
    <f:selectItem itemLabel="DEF" itemValue="DEF"/>
    <f:selectItem itemLabel="GHI" itemValue="GHI"/>
    <f:selectItem itemLabel="JKL" itemValue="JKL"/>
    <f:selectItem itemLabel="MNO" itemValue="MNO"/>
    </af:selectOneChoice>
    </af:form>
    </af:document>
    </f:view>
    </jsp:root>
    When I run this program , I get following compiler error:
    Error(12): Unable to convert constant to type javax.el.ValueExpression for attribute "itemLabel" of tag "selectItem".
    Error(12): Unable to convert constant to type javax.el.ValueExpression for attribute "itemValue" of tag "selectItem".
    Error(13): Unable to convert constant to type javax.el.ValueExpression for attribute "itemLabel" of tag "selectItem".
    Error(13): Unable to convert constant to type javax.el.ValueExpression for attribute "itemValue" of tag "selectItem".
    Error(14): Unable to convert constant to type javax.el.ValueExpression for attribute "itemLabel" of tag "selectItem".
    Error(14): Unable to convert constant to type javax.el.ValueExpression for attribute "itemValue" of tag "selectItem".
    Error(15): Unable to convert constant to type javax.el.ValueExpression for attribute "itemLabel" of tag "selectItem".
    Error(15): Unable to convert constant to type javax.el.ValueExpression for attribute "itemValue" of tag "selectItem".
    Error(16): Unable to convert constant to type javax.el.ValueExpression for attribute "itemLabel" of tag "selectItem".
    Error(16): Unable to convert constant to type javax.el.ValueExpression for attribute "itemValue" of tag "selectItem".
    Anyone has any ideas? Where could be problem?

Maybe you are looking for

  • Can I Return My Headset Without It's Box?

    I bought a Logitech G430 Headset on 11/01/2014 and the hinge where the right side of the headset swivels broke. so it's loose and wont stay over me ear so I dont hear through it like I used to and I can hear alot of the background. I registered it wh

  • Master Boot Record is greyed out, so how to use?

    How do I use Master Boot Record (in Mountain Lion, to partition an external Seagate Backup+ hard drive) when it is greyed out and I can't choose it? I tried turning off Time Machine, but that didn't do anything. I also tried installing various Seagat

  • Safari on Windows 7 with Silverlight 4 and Windows RIA Services

    I have an application using the above technologies and it's working with issue on Windwos 7 (fully patched OS) using IE 7+ and Chrome 18, Macbook OSX 10.7.4 using Safari 5.1.5+ and Chrome 18.  Today, I upgraded from Safari 5.1.5 to 5.1.7 on my Window

  • Hints and tips about OCP certification 10g

    Hi, in a few weeks I will have my certification test for OCP Oracle 10g. For this I'm interested in hints and tips for the test. Did somebody completed this test (not the upgrade one) and could tell me please the main topic, some tips for best prepar

  • Messages: "Web application processing terminated"

    Hello all, When i execute a webtemplate, the message "web application processing is terminated" as a link. Diagnosis are as follows: Diagnosis The system had to terminate processing of the Web application. The reason could be that the system was no l