2 Replies Latest reply on May 12, 2009 9:22 AM by bruco

    saving input from rich:datatable before scrolling to next pa

    bruco

      Hello!
      My purpose is saving input from rich:datatable before scrolling to next page.

      I'm trying to use a rich:datatable with an inputtext field column as shown below.
      I'd like to know if it's possible to get the value in the input field before invoking walk() method in the associated bean.
      Now walk method gets new items before Update Model Value phase, so I loose the input value from datatable.
      I have also tried to use actionListener attribute for dataScroller componet but it is called before Update Model Value phase.

      Do you have any suggestion?

      Thanks

      <%@page contentType="text/html"%>
      <%@page pageEncoding="UTF-8"%>
      <%@taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
      <%@taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
      <%@taglib uri="http://richfaces.org/a4j" prefix="a4j" %>
      <%@taglib uri="http://richfaces.org/rich" prefix="rich" %>
      <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
      
      <div class="contentContainer">
      
       <h:panelGroup id="messagePanel" layout="block">
       <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
       </h:panelGroup>
       <h2> <h:outputText value="#{label.eseQuery2}"/> </h2>
        
       <h:form styleClass="jsfcrud_list_form">
      
       <rich:datascroller align="left"
       id="sc2"
       for="list"
       maxPages="10"
       actionListener="#{esequery2.dataScrollerAction}"
       fastStep="2">
       <f:facet name="first">
       <h:graphicImage url="/resources/css/images/22-backlist.png" title="#{label.paginaInizio}"/>
       </f:facet>
       <f:facet name="fastrewind">
       <h:graphicImage url="/resources/css/images/22-back.png" title="#{label.pagina2Prec}"/>
       </f:facet>
       <f:facet name="previous">
       <h:graphicImage url="/resources/css/images/22-singleBack.png" title="#{label.paginaPrec}"/>
       </f:facet>
       <f:facet name="next">
       <h:graphicImage url="/resources/css/images/22-singleNext.png" title="#{label.paginaSucc}"/>
       </f:facet>
       <f:facet name="fastforward">
       <h:graphicImage url="/resources/css/images/22-next.png" title="#{label.pagina2Succ}"/>
       </f:facet>
       <f:facet name="last">
       <h:graphicImage url="/resources/css/images/22-forwardlist.png" title="#{label.paginaFine}"/>
       </f:facet>
       </rich:datascroller>
       <br/>
       <rich:dataTable value="#{esequery2}"
       var="item"
       id="list"
       rowClasses="jsfcrud_odd_row,jsfcrud_even_row"
       headerClass="richTableHeader"
       rows="5">
      
       <h:column>
       <f:facet name="header" >
       <h:outputText value="#{label.order}" />
       </f:facet>
       <h:inputText value="#{item.order}" style="width:2em" title="#{label.select4Query}"/>
       </h:column>
      
       <h:column>
       <f:facet name="header">
       <h:outputText value="#{label.id}"/>
       </f:facet>
       <h:outputText value=" #{item.query.id}"/>
       </h:column>
      
       <h:column>
       <f:facet name="header">
       <h:outputText value="#{label.tipoQueryShort}"/>
       </f:facet>
       <h:outputText value=" #{item.query.tipo}"/>
       </h:column>
      
       <h:column>
       <f:facet name="header">
       <h:outputText value="#{label.descrizione}" />
       </f:facet>
       <h:outputText value="#{item.query.descrizione4List}" title="#{item.query.descrizione}"/>
       </h:column>
      
       <h:column>
       <f:facet name="header">
       <h:outputText value="#{label.cmdQueryShort}"/>
       </f:facet>
       <h:outputText value=" #{item.query.comando4List}" title=" #{item.query.comando}"/>
       </h:column>
      
       <h:column>
       <f:facet name="header">
       <h:outputText value="#{label.idAlert}"/>
       </f:facet>
       <h:outputText value=" #{item.query.idalert}"/>
       </h:column>
      
       <h:column>
       <f:facet name="header">
       <h:outputText value="#{label.msgAlert}"/>
       </f:facet>
       <h:outputText value=" #{item.query.msgalert4List}" title=" #{item.query.msgalert}"/>
       </h:column>
      
       <h:column>
       <f:facet name="header">
       <h:outputText value="#{label.idAction}"/>
       </f:facet>
       <h:outputText value=" #{item.query.idaction}"/>
       </h:column>
      
       <h:column>
       <f:facet name="header">
       <h:outputText value="#{label.parmActionShort}"/>
       </f:facet>
       <h:outputText value=" #{item.query.parmaction4List}" title=" #{item.query.parmaction}"/>
       </h:column>
      
       <h:column>
       <f:facet name="header">
       <h:outputText value="#{label.dataesec}"/>
       </f:facet>
       <h:outputText value=" #{item.log.dataesecFormatted}" />
       </h:column>
      
       <h:column>
       <f:facet name="header">
       <h:outputText value="#{label.orainizio}"/>
       </f:facet>
       <h:outputText value=" #{item.log.orainizioFormatted}" />
       </h:column>
      
       <h:column>
       <f:facet name="header">
       <h:outputText value="#{label.orafine}"/>
       </f:facet>
       <h:outputText value=" #{item.log.orafineFormatted}" />
       </h:column>
      
      
       <h:column>
       <f:facet name="header">
       <h:outputText escape="false" value=" "/>
       </f:facet>
       <h:commandLink action="#{esequery2.detailSetup}">
       <h:graphicImage height="16px" url="/resources/css/images/show.png" title="#{label.dettaglio}"/>
       <f:param name="jsfcrud.currentEsequery" value="#{jsfcrud_class['operazioniSospette.jsf.util.JsfUtil'].jsfcrud_method['getAsConvertedString'][item][esequery2.converter].jsfcrud_invoke}"/>
       </h:commandLink>
       </h:column>
      
       </rich:dataTable>
       <br />
       <div id="buttonBar">
       <h:commandButton action="#{esequery2.resetAction}" title="#{label.reset}" image="/resources/css/images/22-clear.png"/>
        
       <h:commandButton action="#{esequery2.processQuery}" title="#{label.nextStep}" image="/resources/css/images/22-next.png"/>
       </div>
       </h:form>
      </div>