0 Replies Latest reply on Mar 29, 2012 10:01 AM by Sebastien Morissette

    Question on datatable filtering

    Sebastien Morissette Newbie

      Hi,

       

      i've implemented a datatable that has a filtering h:inputext inside the header exactly as in the examples but when i hit Enter inside the inputtext field it submits the entire page instead of doing nothing like on the example page..

       

      i am wondering if anyone allready had that issue..

       

      the page is : (see the filter column in blue) i am runnin with richfaces 4.1 final and i have another small project running on same Websphere server and RAD environment where it is functionning correclty(in the example you hear a beep wht you hit enter in the inputtext component)

        

      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <!-- jsf:pagecode language="java" location="/JavaSource/pagecode/jspFiles/ears/jsf/Deployments/DeploymentHistory1.java" --><!-- /jsf:pagecode -->
      <html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:a4j="http://richfaces.org/a4j"
      xmlns:rich="http://richfaces.org/rich"
      xmlns:fn="http://java.sun.com/jsp/jstl/functions">

      <ui:composition template="/WEB-INF/templates/basictemplate.xhtml">
      <ui:param name="HeaderTitle"
        value="#{msgs['ears.deployments.deploymenthistory.banner'] }" />

      <ui:define name="head"></ui:define>

      <ui:define name="content">
        <f:event type="preRenderView"
         listener="#{pc_DeploymentHistory3.handleEvent}" />
        <h:form id="form1" >
         <rich:dataTable id="depHistList1" value="#{jmxDepBean.depHistList}"
          rows="20" var="vardepHistList" rowClasses="odd-row, even-row"
          style="width: 100%;" >
          <f:facet name="noData">
           <div style="width: 100%; text-align: center">
            <h:outputFormat
             value="#{msgs['ears.deployments.deploymenthistory.nodata']}">

       

       

            </h:outputFormat>
           </div>
          </f:facet>
          <rich:column id="id1column" style="text-align: center">
           <f:facet name="header">
            <h:outputText styleClass="outputText"
             value="#{msgs['ears.deployments.deploymenthistory.details']}"
             id="id1text"></h:outputText>
           </f:facet>
         
          
           <a4j:commandButton styleClass="no-decor" render="editGrid" onclick="loadBarFromFrame(1);"
            value="#{msgs['ears.deployments.deploymenthistory.details']}"
            execute="@this" oncomplete="loadBarFromFrame(0);#{rich:component('editPane')}.show()">

            <f:setPropertyActionListener
             target="#{jmxDepBean.currentDeployment}"
             value="#{vardepHistList}" />
           </a4j:commandButton>

       

          </rich:column>
         
          <rich:column id="dateTime1column" style="text-align: center" filterValue="#{jmxDepBean.datefilter}" filterExpression="#{fn:containsIgnoreCase(vardepHistList.dateTime, jmxDepBean.datefilter)}">
           <f:facet name="header">
           <h:panelGroup>
            <h:outputText styleClass="outputText"
             value="#{msgs['ears.deployments.deploymenthistory.deploydate']}"
             id="dateTime1text"></h:outputText><h:inputText id="datefilter" value="#{jmxDepBean.datefilter}" >
             <a4j:ajax event="blur" render="depHistList1" execute="@this" />
             </h:inputText>
             </h:panelGroup>
           </f:facet>
           <h:outputText styleClass="outputText" id="dateTime1"
            value="#{vardepHistList.dateTime}">
           </h:outputText>
          </rich:column>
          <rich:column id="project1column" style="text-align: center">
           <f:facet name="header">
            <h:outputText styleClass="outputText"
             value="#{msgs['ears.deployments.deploymenthistory.project']}"
             id="project1text"></h:outputText>
           </f:facet>
           <h:outputText styleClass="outputText" id="project1"
            value="#{vardepHistList.project}">
           </h:outputText>
          </rich:column>
          <rich:column id="earName1column" style="text-align: center">
           <f:facet name="header">
            <h:outputText styleClass="outputText"
             value="#{msgs['ears.deployments.deploymenthistory.earfile']}"
             id="earName1text"></h:outputText>
           </f:facet>
           <h:outputText styleClass="outputText" id="earName1"
            value="#{vardepHistList.earName}">
           </h:outputText>
          </rich:column>
          <rich:column id="propsFile1column" style="text-align: center">
           <f:facet name="header">
            <h:outputText styleClass="outputText"
             value="#{msgs['ears.deployments.deploymenthistory.propsfile']}"
             id="propsFile1text"></h:outputText>
           </f:facet>
           <h:outputText styleClass="outputText" id="propsFile1"
            value="#{vardepHistList.propsFile}">
           </h:outputText>
          </rich:column>
          <rich:column id="envType1column" style="text-align: center">
           <f:facet name="header">
            <h:outputText styleClass="outputText"
             value="#{msgs['ears.deployments.deploymenthistory.env']}"
             id="envType1text"></h:outputText>
           </f:facet>
           <h:outputText styleClass="outputText" id="envType1"
            value="#{vardepHistList.envType}">
           </h:outputText>
          </rich:column>
          <rich:column id="status1column" style="text-align: center">
           <f:facet name="header">
            <h:outputText styleClass="outputText"
             value="#{msgs['ears.deployments.deploymenthistory.status']}"
             id="status1text"></h:outputText>
           </f:facet>
           <h:outputText styleClass="outputText" id="status1"
            value="#{vardepHistList.status}">
           </h:outputText>
          </rich:column>
         
          <rich:column id="status2column" style="text-align: center">
           <f:facet name="header">
            <h:outputText styleClass="outputText"
             value="#{msgs['ears.deployments.deploymenthistory.changestatus']}"
             id="status2text"></h:outputText>
           </f:facet>
               <a4j:commandLink immediate="true" styleClass="no-decor" render="depHistList1" onclick="loadBarFromFrame(1);" oncomplete="loadBarFromFrame(0);"
           execute="@this" action="#{pc_DeploymentHistory3.setDeploymentStatusSuccess}">
           <h:graphicImage value="/images/checked.gif" alt="set status to 'success'" style="border:none;"/>
           <f:setPropertyActionListener
             target="#{jmxDepBean.currentDeployment}"
             value="#{vardepHistList}" />
          </a4j:commandLink>
          <a4j:commandLink styleClass="no-decor" render="depHistList1" onclick="loadBarFromFrame(1);" oncomplete="loadBarFromFrame(0);"
           execute="@this" action="#{pc_DeploymentHistory3.setDeploymentStatusFailed}">
           <h:graphicImage  value="/images/delete.gif" alt="set status to 'failed'" style="border:none;"/>
           <f:setPropertyActionListener
             target="#{jmxDepBean.currentDeployment}"
             value="#{vardepHistList}" />
          </a4j:commandLink>
          </rich:column>
          <f:facet name="footer">
           <rich:dataScroller page="#{jmxDepBean.page}" />
          </f:facet>
         </rich:dataTable>


         <rich:popupPanel header="View Deployment Details" id="editPane"
          autosized="true" moveable="true" modal="true"
          domElementAttachment="parent">
          <h:panelGrid columns="1" id="editGrid">


           <table style="border: thin;border-width: 1px;">
            <tr>
             <th class="rf-dt-shdr-c">#{msgs['ears.deployments.deploymenthistory.deploydate']}
             </th>
             <td>#{jmxDepBean.currentDeployment.dateTime} </td>
            </tr>
            <tr>
             <th class="rf-dt-shdr-c"> #{msgs['ears.deployments.deploymenthistory.project']}
             </th>
             <td >#{jmxDepBean.currentDeployment.project}</td>
            </tr>
            <tr>
             <th class="rf-dt-shdr-c">#{msgs['ears.deployments.deploymenthistory.earfile']}
             </th>
             <td>#{jmxDepBean.currentDeployment.earName}</td>
            </tr>
            <tr>
             <th class="rf-dt-shdr-c">#{msgs['ears.deployments.deploymenthistory.propsfile']}
             </th>
             <td>#{jmxDepBean.currentDeployment.propsFile}</td>
            </tr>
            <tr>
             <th class="rf-dt-shdr-c">#{msgs['ears.deployments.deploymenthistory.env']}
             </th>
             <td>#{jmxDepBean.currentDeployment.envType}</td>
            </tr>
            <tr>
             <th class="rf-dt-shdr-c">#{msgs['ears.deployments.deploymenthistory.node']}
             </th>
             <td>#{jmxDepBean.currentDeployment.envLabel}</td>
            </tr>
            <tr>
             <th class="rf-dt-shdr-c">#{msgs['ears.deployments.deploymenthistory.username']}
             </th>
             <td>#{jmxDepBean.currentDeployment.userName}</td>
            </tr>
            <tr>
             <th class="rf-dt-shdr-c">#{msgs['ears.deployments.deploymenthistory.supportuser']}
             </th>
             <td>#{jmxDepBean.currentDeployment.supportUser}</td>
            </tr>
            <tr>
             <th class="rf-dt-shdr-c">#{msgs['ears.deployments.deploymenthistory.status']}
             </th>
             <td nowrap="nowrap">#{jmxDepBean.currentDeployment.status}
            
        
             </td>
            </tr>
            <tr>
             <th class="rf-dt-shdr-c">#{msgs['ears.deployments.deploymenthistory.log']}
             </th>
             <td nowrap="nowrap">#{jmxDepBean.currentDeployment.logFile}</td>
            </tr>
           </table>
          </h:panelGrid>

          <a4j:commandButton value="Ok"
           onclick="#{rich:component('editPane')}.hide()" />
         </rich:popupPanel>
        </h:form>

      </ui:define>

      </ui:composition>
      </html>