1 Reply Latest reply on Aug 31, 2010 2:18 AM by semua60

    How to get inputtext value from (datatable + datascroller)

    semua60 Newbie



      I've a datatable with datascroller and a commandButton. A column in datatable is an inputtext



                  <rich:dataTable id="table" value="#{testBean.list}" var="item" rows="15" >
                          <f:facet name="header">
                              <h:outputText value="Id" />
                          <h:outputText value="#{item.id}" />
                          <f:facet name="header">
                              <h:outputText value="Note" />
                          <h:inputText id="txtNote" value="#{testBean.noteMap[item.id]}" />
                      <f:facet name="footer">
                          <rich:datascroller id="scroller" for="table" actionListener="#{testBean.scrollerActionListener}" />
                  <h:commandButton value="Save" action="#{testBean.saveAction}" />
      I want to capture value in the inputtext and save into session before user move to another page.
      So I declare an actionListener in datascroller, to capture value inputtext in the current page. Before datatable move to next/prev page.
      The problem is, the variable noteMap is still empty (I can't get it from inside scrollerActionListener).
      If button 'Save' click, I can get the inputtext value, but only at the current page. Value in another page was gone.
      Anyone can help?
      private Map<String, String> noteMap = new HashMap<String, String>();

      public void scrollerActionListener(ActionEvent event) {
          //save noteMap into Session

      public String saveAction() {
          //load noteMap from Session
          return "";