1 Reply Latest reply on Jul 13, 2010 5:34 PM by nbelaevski

    <h:selectmanycheckbox and <a4j:support issues

    craig12980

      Hi

       

      This is my environment:

       

      • Spring 3
      • Richfaces 3.3.3
      • JVM 1.6
      • Apache tomcat 6.0.26

       

      What i'ld love to do is a search, display the search resulta in an extended datatable where i'll show to the user 3 columns. The last columns is a checkbox and the user can choose one or more elements.

      This is what i did:

       

      search.xhtml:


      <!-- Sezione Elenco -->
      <h:panelGroup id="out" columns="4"> 
      <!-- rich:panel id="panelRisultati" rendered="#{not empty engageRicercaReferenzeController.cmdRicerca.listaSchedeProgetti}">  -->
      <rich:panel id="panelRisultati" rendered="#{engageRicercaReferenzeController.numAnn>0}">
      <a4j:form id="thisFormRicLista">
      <rich:extendedDataTable value="#{engageRicercaReferenzeController.dataModel}"
      var="lista" id="table" width="800px" height="350px"
      sortMode="#{engageRicercaReferenzeController.sortMode}"
      noDataLabel="#{msg.nessunRisultato}"
      selectionMode="#{engageRicercaReferenzeController.selectionMode}"
      tableState="#{engageRicercaReferenzeController.tableState}"
      selection="#{engageRicercaReferenzeController.selection}" 
      rows="#{engageRicercaReferenzeController.numeroRecordPerPagina}"
      styleClass="noBorderTable" rowKeyVar="row">
      <f:facet name="header">
      <h:outputText value="#{msg.elencoRicerca}" />
      </f:facet>
      <rich:column width="350px" id="titolo" sortable="false">
      <f:facet name="header">
      <h:outputText value="#{msg.titolo}" />
      </f:facet>
      <a4j:commandLink  id="detaillink"
      oncomplete="javascript:Richfaces.showModalPanel('dettaglioPrg',{width:600,height:500})"
      action="#{engageDettaglioReferenzeController.detailRefPrg}" reRender="dettaglioPrg"> >
      <f:param name="idRefPrg" value="#{lista.id}" />
      <h:outputText value="#{lista.titoloProgetto}" />>
      </a4j:commandLink>
      <rich:toolTip for="detaillink" direction="top-left"
      value="Dettaglio Progetto" />
      </rich:column>
       
      <rich:column width="300px">
      <f:facet name="header">
      <h:outputText value="#{msg.contattoInterno}" />
      </f:facet>
      <h:outputText value="#{lista.contattoInterno}" />
      </rich:column>
      <rich:column width="100px">
      <f:facet name="header">
      <h:outputText value="#{msg.dataInizio}" />
      </f:facet>
      <h:outputText value="#{lista.dataInizio}">
      <f:convertDateTime dateStyle="short" timeZone="Europe/Berlin"
      pattern="dd/MM/yyyy" type="both" />
      </h:outputText>
      </rich:column>
       
      <rich:column width="100px">
             <h:selectManyCheckbox id="checkboxschede" value="#{engageRicercaReferenzeController.cmdRicerca.schedeProgettoSelezionate}">
                                   
                                   <a4j:support ajaxSingle="true" 
                                                     event="onchange" 
                                                     actionListener="#{engageRicercaReferenzeController.checkboxListener}" 
                                                     />
                                   <f:selectItem itemValue="#{lista.id}"/>
                               </h:selectManyCheckbox>
                              
      </rich:column>
       
       
      </rich:extendedDataTable>
      <rich:datascroller align="left" for="table" id="sc2" immediate="true"
      page="#{engageRicercaReferenzeController.scrollerPage}" />
       
      <h:panelGrid columns="3" title="Download report" id="reportDownload">
      <f:facet name="header">
                             <h:outputText value="Scarica"/>
                           </f:facet>
      <a4j:htmlCommandLink action="#{engageRicercaReferenzeController.downloadFile}">
      <f:param name="tipoFile" value="pdf" />  
      <h:outputText value="Download in formato pdf" />
      </a4j:htmlCommandLink >
      <a4j:htmlCommandLink action="#{engageReportRicerca.downloadFile}">
      <f:param name="tipoFile" value="xls" />  
      <h:outputText value="Download in formato excel" />
      </a4j:htmlCommandLink >
      <a4j:htmlCommandLink action="#{engageReportRicerca.downloadFile}">
      <f:param name="tipoFile" value="rtf" />  
      <h:outputText value="Download in formato rtf" />
      </a4j:htmlCommandLink >
      </h:panelGrid>
      </a4j:form>
      </rich:panel>
      </h:panelGroup>
      
      
      

       

      Well the query is executed correctly; the table is shown correctly and the checkbox too.

      The variable "lista" is an object taken from the database; this object has some properties between them there is the id property that is a long (primitive object). Well when i select a checkbox i get this error:

       

      13-lug-2010 17.32.21 com.sun.faces.lifecycle.RenderResponsePhase execute
      INFO: WARNING: FacesMessage(s) have been enqueued, but may not have been displayed.
      sourceId=thisFormRicLista:table:1:checkboxschede[severity=(ERROR 2), summary=(thisFormRicLista:table:1:checkboxschede: Validation Error: Value is not valid), detail=(thisFormRicLista:table:1:checkboxschede: Validation Error: Value is not valid)]
      

       

      When i deselect the checkbox no message is shown.

      Do you have any suggestion on how i can solve this issue?

      Regards,

      Angelo.