0 Replies Latest reply on Feb 18, 2009 12:31 PM by waq

    can't remove items from the selectMenu

      I am using selectMenu as:

      <a4j:region selfRendered="true" id="text">
       <h:selectOneListbox id="symbol" value="#{user.name}">
       <f:selectItems value="#{user.temp_list}" />
       </h:selectOneListbox>
      <a4j:commandButton action="#{user.getData}" reRender="symbol" value="Get"/>
      </a4j:region>
      


      temp_list has following three values when page loads:
      temp_list.add(new SelectItem("Sunday"));
      temp_list.add(new SelectItem("Monday"));
      temp_list.add(new SelectItem("Tuesday"));
      


      Now in user.getData i want to remove items one by one based on the selection made by the user. The code is:

      temp_list.remove(0);
      this.setTemp_list(temp_list);
      


      But the problem is that if user selects Sunday for example, it remove it from the list but next time when user select Monday it removes monday but BRING BACK SUNDAY AGAIN IN THE LIST. Why is it so?