0 Replies Latest reply on Jun 25, 2008 5:02 PM by Eric Chua

    orderingList - onclick

    Eric Chua Newbie

      I am trying to use orderlist so that when I click on a row the selection list is updated. I can't figure out why it isn't. Is a submit required?

      <a4j:form id="listForm">
      <rich:orderingList id="orderlist" value="#{sysAdmin.stores}" onclick="updateForm();" var="store" listHeight="150" listWidth="350" selection="#{sysAdmin.selection}" controlsType="button" >
      <rich:column>
      <f:facet name="header">
      <h:outputText value="Store id" />
      </f:facet>
      <h:outputText value="#{store.storeid}" ></h:outputText>
      </rich:column>
      <rich:column>
      <f:facet name="header">
      <h:outputText value="Store Name" />
      </f:facet>
      <h:outputText value="#{store.name}" ></h:outputText>
      </rich:column>
      </rich:orderingList>

      <a4j:commandButton id="rerenderbutton" value="reRender" reRender="storeform" />
      </a4j:form>

      I can tell the selection list is not being updated. I would like the update to occur with the onclick. Any ideas?

      public Collection getSelection() {
      return selection;
      }


      public void setSelection(Collection selection) {
      System.out.println("Made it ");
      Iterator selectedIt= selection.iterator();
      info.clear();
      while(selectedIt.hasNext()){
      Store oneStore = selectedIt.next();
      this.storename=oneStore.getName();
      this.storedesc=oneStore.getDescription();
      this.storeid=oneStore.getStoreid()+"";
      System.out.println("Made it 2 "+this.storedesc);
      info.add(oneStore.getName()+" "+oneStore.getStoreid()+" " + oneStore.getDescription());
      }
      this.selection = selection;

      }

      My ultimate goal is to click on a row and fill out another form from the same bean.