0 Replies Latest reply on Jul 31, 2012 6:57 AM by lukas.p

    h:selectOneMenu inside rich:orderingList causes Exception

    lukas.p Newbie

      Hi everyone, I could use your help.

       

      I am onRichfaces 4.2.2 Final.

       

      I am using the rich:orderingList component with nested h:selectOneMenus per row. However, the h:selectOneMenu always throws an Exception if the page is submitted. Also the selection component itself does not work properly as the item is not changeable. The Exception is

       

      javax.el.PropertyNotFoundException: /content/search/sparte/sparteSearchFilter.xhtml @92,52 value="#{item.direction}": Target Unreachable, identifier 'item' resolved to null

       

      I also tried various other selection components such as h:selectOneRadio, rich:select, ... but the issue stays the same.

       

      This is my code:

       

      xhtml page:

       

      <rich:panel id="sort2Panel">

           <rich:orderingList value="#{sortBean2.items}" var="item">                                               

                <h:column>

                     <f:facet name="header">

                          <h:outputText value="Item" />

                     </f:facet>              

                     <h:selectOneMenu value="#{item.direction}">

                          <f:selectItem itemLabel="Ascending" itemValue="asc" />

                          <f:selectItem itemLabel="Descending" itemValue="desc"/>

                     <h:selectOneMenu>

               </h:column>

          </rich:orderingList>                   

      </rich:panel>

       

       

       

      Bean:

       

      @ManagedBean

      @SessionScoped

      public class SortBean2 {

       

          List<Item> items = new ArrayList<Item>();

       

          public SortBean2() {

              items.add(new Item());

              items.add(new Item());

              items.add(new Item());

          }

       

          public List<Item> getItems() {

              return items;

          }

       

          public void setItems(List<Item> items) {

              this.items = items;

          }

       

      }

       

      Model:

       

      public class Item {

       

          private SelectItem direction;

       

          public Item() {

       

          }

       

          public void setDirection(SelectItem direction) {

              this.direction = direction;

          }

       

          public SelectItem getDirection() {

              return this.direction;

      }