2 Replies Latest reply on Jun 18, 2010 2:07 PM by Tom Todaro

    Can't get extendedDataTable onselectionchange to fire

    Tom Todaro Newbie

      rich:extendeddatatable: if I click on a row, I get "event not defined" in the scripting error log. I have other Ajax requests on the page which work fine; it's just the one attached to the table that fails.  v 3.3.2.

       

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

       


      <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:s="http://jboss.com/products/seam/taglib"
          xmlns:a4j="http://richfaces.org/a4j"
          xmlns:rich="http://richfaces.org/rich" xml:lang="en" lang="en">

       


      <body>

       



          <ui:composition template="template.xhtml">
          
              <ui:param name="title" value="IBI Price Calculator"/>
              <ui:define name="mainmenu"></ui:define>
              <ui:define name="mainbody">
                  <rich:messages layout="list" ajaxRendered="true"
                           infoClass="infoMessage"
                           warnClass="errorMessage"
                           errorClass="errorMessage"
                           fatalClass="errorMessage" />

       


             
          <h:panelGrid columns="1" columnClasses="gridContent">
              <rich:panel bodyClass="inpanelBody">
                      <f:facet name="header">
                          Fee Schedule
                      </f:facet>
                        <h:panelGrid id="schedulePanel" columns="4"  width="800px;">
                              <h:outputText value="Schedule Type: " />
                              <h:selectOneMenu id="schedTypeSelectOneMenu" value="#{pricingManager.scheduleGroup}"
                                      required="true"    styleClass="inputItem">
                                      <s:selectItems value="#{pricingManager.scheduleGroups}" var="group" label="#{group.description}" itemValue="#{group}"
                                          noSelectionLabel="Please select..." />
                                      <s:convertEnum />
                                      <a4j:support id="schedGroupA4j" event="onchange" reRender="schedDateSelectOneMenu" ajaxSingle="true" />
                                  </h:selectOneMenu>
                                 
                              <h:outputText value="Schedule Date: " />
                              <h:selectOneMenu id="schedDateSelectOneMenu" value="#{pricingManager.scheduleDate}"
                                      required="true"    styleClass="inputItem">
                                      <s:selectItems value="#{pricingManager.scheduleDates}" var="date" label="#{pricingManager.formatScheduleDate(date)}" itemValue="#{date}"
                                          noSelectionLabel="Please select..." />
                                  </h:selectOneMenu>

       


                        </h:panelGrid>
              </rich:panel>
          </h:panelGrid>
                       
          <h:panelGrid columns="1" columnClasses="gridContent">
              <rich:panel bodyClass="inpanelBody">
                      <f:facet name="header">
                          Machine
                      </f:facet>
                  <h:panelGrid id="sitePanel" columns="2"  width="800px;">
                      <h:panelGrid columns="2">
                             <h:outputText value="Model # Search: " />
                              <h:inputText id="mod"/>   
                                     <rich:suggestionbox width="200" for="mod" var="result" fetchValue="" minChars="3"   
                                      suggestionAction="#{siteManager.suggestModel}">       
                                  <h:column>
                                      <h:outputText value="#{result.fullDescription}" />
                                      </h:column>
                                    <a4j:support event="onselect" ajaxSingle="true" reRender="sitePanel">
                                      <f:setPropertyActionListener value="#{result}" target="#{siteManager.modelFromSearch}" />
                                      </a4j:support>
                                   </rich:suggestionbox>
                               <h:outputText value=" " />

       


                              <h:outputText value="Manufacturer: "/>
                                <h:selectOneMenu id="manufacturerSelectOneMenu" value="#{siteManager.manufacturer}"
                                      required="true" styleClass="inputItem">
                                      <s:selectItems value="#{siteManager.manufacturers}" var="mfg" label="#{mfg.description}" itemValue="#{mfg}"
                                          noSelectionLabel="Please select..." />
                                      <f:converter converterId="manufacturerConverter" />
                                      <a4j:support id="manufacturerA4j" event="onchange" ajaxSingle="true"
                                          action="#{siteManager.findSeries}" reRender="seriesSelectOneMenu,modelSelectOneMenu,osSelectOneMenu,sitePanel" />
                                  </h:selectOneMenu>

       


                               <h:outputText value="Series: " />
                              <h:selectOneMenu id="seriesSelectOneMenu" value="#{siteManager.series}"
                                      required="true"    styleClass="inputItem">
                                      <s:selectItems value="#{siteManager.serieses}" var="ser" label="#{ser.description}" itemValue="#{ser}"
                                          noSelectionLabel="Please select..." />
                                      <f:converter converterId="seriesConverter" />
                                          <a4j:support id="seriesA4j" event="onchange" ajaxSingle="true"
                                          action="#{siteManager.findModelsAndOperatingSystems}" reRender="modelSelectOneMenu,osSelectOneMenu,sitePanel" />
                                  </h:selectOneMenu>
                                 
                                  
                               <h:outputText value="Model: " />
                              <h:selectOneMenu id="modelSelectOneMenu" value="#{siteManager.model}"
                                      required="true"    styleClass="inputItem">
                                      <s:selectItems value="#{siteManager.models}" var="modl" label="#{modl.description}" itemValue="#{modl}"
                                          noSelectionLabel="Please select..." />
                                      <f:converter converterId="modelConverter" />
                                      <a4j:support id="modelA4j" event="onchange" reRender="processors,osPanel" ajaxSingle="true" />
                                  </h:selectOneMenu>
                                 
                              <h:outputText value="Processors: " />
                               <h:inputText id="processors" value="#{siteManager.hardwareConfig.numProcessors}" size="8" styleClass="inputItem"/>   
                          </h:panelGrid>

       


                          <h:panelGrid columns="2" id="osPanel">                   
                               <h:outputText value="Operating System: " />
                              <h:selectOneMenu id="osSelectOneMenu" value="#{siteManager.operatingSystem}"
                                      required="true"    styleClass="inputItem">
                                      <s:selectItems value="#{siteManager.operatingSystems}" var="os" label="#{os.description}" itemValue="#{os}"
                                          noSelectionLabel="Please select ..." />
                                      <f:converter converterId="operatingSystemConverter" />
                                  </h:selectOneMenu>

       


                               <h:outputText value="Standard Tier: " />
                               <h:outputText value="#{siteManager.hardwareConfig.standardTier}"/>   
                               <h:outputText value="iWay Tier: " />
                               <h:outputText value="#{siteManager.hardwareConfig.iwayTier}"/>   
                               <h:outputText value="Mainframe Tier: " />
                               <h:outputText value="#{siteManager.hardwareConfig.focusTier}"/>   
                                <h:outputText value="MSU Rating: " />
                               <h:outputText value="#{siteManager.hardwareConfig.totalMsus}"/>   
                          </h:panelGrid>
                         
                     </h:panelGrid>
              </rich:panel>
          </h:panelGrid>

       


              
          <h:panelGrid columns="1" columnClasses="gridContent">

       


                  <rich:panel bodyClass="inpanelBody">
                      <f:facet name="header">
                          Feature/Inforesponse
                      </f:facet>
                     
                  <h:panelGrid id="featurePanel" columns="3"  width="800px;">
                      <h:panelGrid columns="2">
                              <h:outputText value="Feature Code: " />
                               <h:inputText id="featCode" value="#{pricingManager.featureCode}"/>   
                                     <rich:suggestionbox id="featureSuggest" width="500" for="featCode" var="feature" fetchValue="#{result.code}"
                                      suggestionAction="#{pricingManager.suggestFeature}">
                                  <h:column>
                                      <h:outputText value="#{feature.code}" />
                                      </h:column>
                                  <h:column>
                                      <h:outputText value="#{feature.description}" />
                                      </h:column>
                                    <a4j:support event="onselect" ajaxSingle="true">
                                      <f:setPropertyActionListener value="#{feature.code}" target="#{pricingManager.featureCode}" />
                                      </a4j:support>
                                 </rich:suggestionbox>
                              <h:outputText value=" " />

       


                              <h:outputText value="Pricing Type: " />
                              <h:selectOneMenu id="pricingTypeSelectOneMenu" value="#{pricingManager.pricingSettings.pricingType}"
                                      required="true"    styleClass="inputItem">
                                      <s:selectItems value="#{domainManager.pricingTypes}" var="pricingType" label="#{pricingType.toString()}"
                                          noSelectionLabel="Please select..." />
                                      <s:convertEnum />
                                  </h:selectOneMenu>
                             
                              <h:outputText value="Ownership Type: " />
                              <h:selectOneMenu id="ownTypeSelectOneMenu" value="#{pricingManager.pricingSettings.ownershipType}"
                                      required="true"    styleClass="inputItem">
                                      <s:selectItems value="#{domainManager.ownershipTypes}" var="ownType" label="#{ownType.toString()}"
                                          noSelectionLabel="Please select..." />
                                      <s:convertEnum />
                                      <a4j:support id="ownTypeA4j" event="onchange" reRender="months,billCycleSelectOneMenu" ajaxSingle="true" />
                                  </h:selectOneMenu>
                                 
                              <h:outputText value="Months: " />
                               <h:inputText id="months" value="#{pricingManager.pricingSettings.contractCommitment}"/>   
                              
                               <h:outputText value="Billing Cycle: " />
                               <h:selectOneMenu id="billCycleSelectOneMenu" value="#{pricingManager.pricingSettings.billingCycle}"
                                      required="true"    styleClass="inputItem">
                                      <s:selectItems value="#{domainManager.billingCycles}" var="billCycle" label="#{billCycle.toString()}"
                                          noSelectionLabel="Please select..." />
                                      <s:convertEnum />
                                  </h:selectOneMenu>
                      </h:panelGrid>
                     
                        <h:panelGrid columns="2">                           
                              <h:outputText value="Users: " />
                               <h:inputText id="users" value="#{pricingManager.pricingSettings.users}"/>   
                              
                              <h:outputText value="Copies: " />
                               <h:inputText id="copies" value="#{pricingManager.pricingSettings.copies}"/>   
                              
                              <h:outputText value="Connections: " />
                               <h:inputText id="connections" value="#{pricingManager.pricingSettings.connections}"/>   
                              
                               <h:outputText value="Images: " />
                               <h:inputText id="images" value="#{pricingManager.pricingSettings.images}"/>   
                       </h:panelGrid>
                      
                         <h:panelGrid id="maintPanel" columns="2">
                              <h:outputText value="IR Type: " />
                              <h:selectOneMenu id="irTypeSelectOneMenu" value="#{pricingManager.pricingSettings.maintType}"
                                      required="false"    styleClass="inputItem">
                                      <s:selectItems value="#{domainManager.maintTypes}" var="maintType" label="#{maintType.toString()}"
                                          noSelectionLabel="Please select..." />
                                      <s:convertEnum />
                                      <a4j:support id="maintTypeA4j" event="onchange" reRender="maintPanel" ajaxSingle="true" />
                                  </h:selectOneMenu>   

       


                              <h:outputText value="Standard Rate: " />
                               <h:inputText id="stdRate" value="#{pricingManager.pricingSettings.stdPercentage}"/>                           

       


                               <h:outputText value="Premium Rate: " />
                               <h:inputText id="extRate" value="#{pricingManager.pricingSettings.extPercentage}"/>   

       


                               <a4j:commandButton value="Add" reRender="resultsPanel" action="#{pricingManager.addLicensedFeature}"/>
                               <h:outputText value=" " />
          
                        </h:panelGrid>
                  </h:panelGrid>
                 
                 </rich:panel>
              </h:panelGrid>
                     
          <a4j:commandButton styleClass="button" value="Reprice" reRender="resultsPanel" action="#{pricingManager.refreshLicensedFeatures}"/>


       


                     <rich:extendedDataTable id="resultsPanel"
                             width="900px" height="300px" sortMode="single" cellpadding="1"
                             selectionMode="multi"
                             var="deliverable" value="#{pricingManager.deliverables}"
                            selection="#{pricingManager.selection}">
                        
                         <rich:column width="75px">
                                 <h:outputText value="#{deliverable.featureCode}"></h:outputText>
                               <f:facet name="header"><h:outputText value="Code" /></f:facet>
                              </rich:column>
                         <rich:column width="200px">
                                 <h:outputText value="#{deliverable.description}"></h:outputText>
                               <f:facet name="header"><h:outputText value="Description" /> </f:facet>
                                 </rich:column>
                        <rich:column width="100px">
                                 <h:outputText value="#{deliverable.ownershipType}"></h:outputText>
                               <f:facet name="header"><h:outputText value="Ownership" /> </f:facet>
                                 </rich:column>
                        <rich:column width="100px">
                                 <h:outputText value="#{deliverable.billingCycle}"></h:outputText>
                               <f:facet name="header"><h:outputText value="BillCycle" /> </f:facet>
                                 </rich:column>
                        <rich:column width="100px">
                                 <h:outputText value="#{deliverable.contractCommitment}"></h:outputText>
                               <f:facet name="header"><h:outputText value="Months" /> </f:facet>
                                 </rich:column>
                         <rich:column width="100px">
                                 <h:outputText value="#{deliverable.netPrice}"><f:convertNumber currencySymbol="$" type="currency" /></h:outputText>
                               <f:facet name="header"><h:outputText value="Net Price" /> </f:facet>
                              </rich:column>
                         <rich:column width="200px">
      <div style="width 100%;overflow:hidden;">  
                              <h:outputText id="pricingText" value="#{deliverable.pricingMethodText}" ></h:outputText>
      </div>
                               <f:facet name="header"><h:outputText value="Pricing Description" /> </f:facet>
                              </rich:column>                       
             <a4j:support event="onselectionchange"
                      action="#{pricingManager.takeSelection}" immediate="true"/>


              </rich:extendedDataTable>                           

       


                     
          </ui:define>
          </ui:composition>
          </body>
      </html>

       

        • 1. Re: Can't get extendedDataTable onselectionchange to fire
          Ilya Shaikovsky Master

          1) please also show template.

          2) provide more details about where the error occured.

          3) check please with 3.3.3 jars(but I believe should works fine for 3.3.2 also.)

          • 2. Re: Can't get extendedDataTable onselectionchange to fire
            Tom Todaro Newbie

            Template is below. The error occurs any time I click on a row in the data table. The instance I click on it, the error appears in the error console.

             

             

             

            <?xml version="1.0" encoding="UTF-8"?>
            <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

             

            <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:s="http://jboss.com/products/seam/taglib"
                xmlns:a4j="http://richfaces.org/a4j"
                xmlns:rich="http://richfaces.org/rich">
               
                <head>
                    <title>#{title}</title>
                    <meta http-equiv="pragma" content="no-cache"></meta>
                    <meta http-equiv="cache-control" content="no-cache"></meta>
                    <meta http-equiv="expires" content="0"></meta>
                    <link rel="stylesheet" type="text/css" href="../css/common.css"></link>
                    <link rel="stylesheet" type="text/css" href="../css/style.css"></link>
                </head>

             

               
                <body>
               
                    <div style="min-width=810px">
                        <img src="./images/info_builders.gif" />
                        <ui:insert name="logoutButton">
                            <h:panelGrid cellpadding="0" cellspacing="0" columns="2"
                                style="width:80px;vertical-align:middle;float:right;"
                                rendered="#{empty callerUrl}">
                                <s:link action="#{identity.logout}">
                                    <h:graphicImage style="border:0px;" value="./images/kdeicons/exit.png" />
                                </s:link>
                                <s:link styleClass="regularlink" action="#{identity.logout}"
                                                value="Close" />
                            </h:panelGrid>
                            <h:panelGrid cellpadding="0" cellspacing="0" columns="2"
                                style="width:80px;vertical-align:middle;float:right;"
                                rendered="#{not empty callerUrl}">
                                <s:link action="#{applicationManager.jumpToCallerWithoutResult}">
                                    <h:graphicImage style="border:0px;" value="./images/kdeicons/exit.png" />
                                </s:link>
                                <s:link styleClass="regularlink" action="#{applicationManager.jumpToCallerWithoutResult}"
                                                value="Cancel" />
                            </h:panelGrid>
                        </ui:insert>
                    </div>
                   
                    <div>
                        <h:form id="mainmenuForm">
                        <ui:insert name="mainmenu">
                            <rich:toolBar height="34" >
                                <rich:toolBarGroup>
                                    <h:outputText value="#{(not (empty user))? (user.firstName) :'Not logged in'}" />
                                </rich:toolBarGroup>

             

                                <!-- TO DO: Define the Specialized menus for your application here.  Below is an example -->
                                <rich:dropDownMenu>
                                    <f:facet name="label">
                                    <h:panelGrid cellpadding="0" cellspacing="0" columns="2" style="vertical-align:middle">
                                        <h:graphicImage value="images/kdeicons/viewmag.png" />
                                        <h:outputText value="View"></h:outputText>
                                    </h:panelGrid>
                                    </f:facet>
                                   
                                    <rich:menuItem submitMode="ajax" value="Home" action="home" />
                                    <ui:insert name="additionalViewMenuItems"/>
                                </rich:dropDownMenu>
                                <ui:insert name="additionalMenus" />
                                <!-- End Menu Group -->
                               
                                <rich:toolBarGroup location="right">
                                    <ui:insert name="additionalRightMenus" />
                                </rich:toolBarGroup>                   
                            </rich:toolBar>
                        </ui:insert>
                        </h:form>
                    </div>

             


                    <div>
                        <ui:insert name="mainbody">content</ui:insert>
                    </div>
                   
                </body>
            </html>