4 Replies Latest reply on Nov 9, 2007 2:03 PM by John Tsimikas

    h:commandLink action method does not execute when using h:da

    John Tsimikas Newbie

      I am using Seam 1.2.1

      Seems that all my commandLink action methods do not get executed if I have a h:dataTable component on the same page. Once the dataTable is removed, all the action methods for the command links do execute.

      Anybody have any idea why this is happening? The commandLink components are not embedded within the h:dataTable.

      The commandLinks are part of my footer to navigate the site.

      Is this a bug?
      My beans are set to @Stateful

      Thanks
      John

        • 1. Re: h:commandLink action method does not execute when using
          Daniel Hinojosa Master

          should work...can you post your bean/page for us to see?

          • 2. Re: h:commandLink action method does not execute when using
            John Tsimikas Newbie

            Here is the code as requested:



            <!DOCTYPE html PUBLIC
            "-//W3C//DTD XHTML 1.0 Transitional//EN"
            "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
            
            
            <div class='divPage' 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:corejsf="http://java.sun.com/upload"
             align='center'>
            
            
            
             <h:form id="physicalInsertForm">
            
             <h:panelGrid columns="1" styleClass="solidBorder" headerClass="largeHeader" >
             <f:facet name="header">
             <h:outputText value="SCS - Physical Inserts" />
             </f:facet>
            
            
            
             <h:panelGrid columns="3" cellpadding='2' cellspacing='2'
             styleClass="width100"
             columnClasses='width40,width30,width30'>
             <h:panelGroup style="display:block; text-align:left">
             <h:outputText value="Institution : " styleClass='labelTD'/>
             <h:outputText value="#{mainClientInfo.institutionName}" styleClass='selectTD'/>
             </h:panelGroup>
             <h:panelGroup >
             <h:outputText value="Charter : " styleClass='labelTD'/>
             <h:outputText value="#{cuClientInfo.charterNbr}" styleClass='selectTD'/>
             </h:panelGroup>
             <h:panelGroup >
             <h:outputText value="Client Id : " styleClass='labelTD'/>
             <h:outputText value="#{fdrClientId}" styleClass='selectTD'/>
             </h:panelGroup>
             </h:panelGrid>
            
             <h:panelGrid columns="1" cellpadding='2' cellspacing='2'
             styleClass="width100"
             columnClasses='width100' >
             <h:panelGroup style="display:block; text-align:left">
             <h:outputText value="User Name : " styleClass='labelTD'/>
             <h:outputText value="#{identity.userFullName}" styleClass='selectTD'/>
             </h:panelGroup>
             </h:panelGrid>
            
             <h:panelGrid columns="1" cellpadding='4' cellspacing='4'
             styleClass='divider' style="">
             <h:panelGroup >
             <h:outputText value=" " styleClass='labelTD'/>
             </h:panelGroup>
             </h:panelGrid>
            
             <h:panelGrid columns="1" cellpadding='4' cellspacing='4'
             styleClass='width100' >
             <h:panelGroup styleClass="InsertTable">
             <h:dataTable id="PhysicalInserts"
             value="#{scsGraphicInserts}" var="inserts"
             styleClass="width100" >
            
             <h:column styleClass="InsertTable" >
             <f:facet name="header" styleClass="">
             <h:outputText value="This page allows you to include Physical Inserts with the statement."
             styleClass='pageHeaderText'/>
             </f:facet>
            
            
             <h:panelGrid columns="2" cellpadding='4' cellspacing='4'
             columnClasses='width50,width50'
             styleClass='width100' >
             <h:panelGroup>
             <h:outputText value="Insert Description " styleClass='insertLabel'/>
             <h:inputText value="#{inserts.description}" size="40" maxlength="50"
             styleClass='selectTD'/>
             </h:panelGroup>
            
             <h:panelGroup>
             <h:outputText value="Disclosure " styleClass='insertLabel'/>
             <h:selectBooleanCheckbox value="#{inserts.disclosure}" id="Disclosure" >
             </h:selectBooleanCheckbox>
             </h:panelGroup>
             </h:panelGrid>
            
             <h:panelGrid columns="2" cellpadding='4' cellspacing='4'
             columnClasses='width50,width50'
             styleClass='width100' >
             <h:panelGroup>
             <h:outputText value="Destroy Excess Inventory " styleClass='insertLabel'/>
             <h:selectBooleanCheckbox value="#{inserts.destroyInventory}"
             id="DestroyInventory"
             onclick="enableDisableShipping();" >
             </h:selectBooleanCheckbox>
             </h:panelGroup>
            
             <h:panelGroup>
             <h:outputText value="Retain Future Use " styleClass='insertLabel'/>
             <h:selectBooleanCheckbox value="#{inserts.retainFutureUse}"
             id="RetainFutureUse" >
             </h:selectBooleanCheckbox>
             </h:panelGroup>
             </h:panelGrid>
            
            
             <h:panelGrid id="panelGridShip" columns="4" cellpadding='4' cellspacing='4'
             columnClasses='width25,width25,width25,width25'
             styleClass='width100' >
            
             <h:panelGroup>
             <h:outputText id="labelAddress" value="Address " styleClass='insertLabel'/>
             <h:inputText id="Address" value="#{inserts.addr}" styleClass='selectTD'/>
             </h:panelGroup>
            
             <h:panelGroup>
             <h:outputText id="labelCity" value="City " styleClass='insertLabel'/>
             <h:inputText id="City" value="#{inserts.city}" styleClass='selectTD'/>
             </h:panelGroup>
            
             <h:panelGroup>
             <h:outputText id="labelState" value="State " styleClass='insertLabel'/>
             <h:inputText id="State" value="#{inserts.state}" size="2" styleClass='selectTD'/>
             </h:panelGroup>
            
             <h:panelGroup>
             <h:outputText id="labelZipcode" value="Zipcode " styleClass='insertLabel'/>
             <h:inputText id="Zipcode" value="#{inserts.zipcode}"
             size="10" styleClass='selectTD'/>
             </h:panelGroup>
            
             </h:panelGrid>
            
             <h:panelGrid id="panelGridContact" columns="2" cellpadding='4' cellspacing='4'
             columnClasses='width50,width50'
             styleClass='width100' >
             <h:panelGroup>
             <h:outputText id="labelContact" value="Contact Person " styleClass='insertLabel'/>
             <h:inputText id="Contact" size="30"
             value="#{inserts.contact}" styleClass='selectTD'/>
             </h:panelGroup>
            
             <h:panelGroup>
             <h:outputText id="labelPhone" value="Telephone Nbr " styleClass='insertLabel'/>
             <h:inputText id="Phone" value="#{inserts.phone}" size="15"
             styleClass='selectTD'/>
             </h:panelGroup>
            
             </h:panelGrid>
            
             <h:panelGrid columns="2" cellpadding='4' cellspacing='4'
             styleClass='width100'
             columnClasses="width75,width25">
            
             <h:panelGroup >
             <h:outputText value="File : " styleClass='labelTD'/>
             <h:outputText value="No attachment" styleClass='selectTD'/>
             </h:panelGroup>
            
             <h:panelGroup >
             <h:commandButton value="Attach Insert.."
             styleClass='attachFileButton'
             action="#{scsMain.gotoAttachInserts}" immediate="true" />
             </h:panelGroup>
            
             </h:panelGrid>
            
             <h:panelGrid columns="1" cellpadding='4' cellspacing='4'
             styleClass='divider' style="">
             <h:panelGroup >
             </h:panelGroup>
             </h:panelGrid>
            
            
             </h:column>
            
             </h:dataTable>
             </h:panelGroup>
            
             <h:panelGroup>
             <h:commandButton value=" Apply Changes "
             styleClass='attachFileButton'
             immediate="true" />
             </h:panelGroup>
            
             </h:panelGrid>
            
            
            
             <h:panelGrid columns="1" cellpadding='4' cellspacing='4' >
             <h:panelGroup >
             <h:outputText value="To select a Statement Page click on the thumbnail below."
             styleClass='grayText'/>
            
             </h:panelGroup>
             </h:panelGrid>
            
            
             <h:panelGrid columns="1" cellpadding='2' cellspacing='2' styleClass="thumbnailTable" >
             <h:panelGroup styleClass="thumbnailTR">
            
             <h:commandLink styleClass="thumbLink" action="#{scsMain.gotoPage1}" >
             <h:graphicImage styleClass="thumbnail" value='/images/page1thumb.png'/>
             </h:commandLink>
            
             <h:outputText styleClass="thumbSep" value=" " />
            
             <h:commandLink styleClass="thumbLink" action="#{scsMain.gotoPage2}" >
             <h:graphicImage styleClass="thumbnail" value='/images/page2thumb.png'/>
             </h:commandLink>
            
             <h:outputText styleClass="thumbSep" value=" " />
            
            
             <h:commandLink styleClass="thumbLink" action="#{scsMain.gotoPage3}">
             <h:graphicImage styleClass="thumbnail" value='/images/page3thumb.png'/>
             </h:commandLink>
            
             <h:outputText styleClass="thumbSep" value=" " />
            
             <h:commandLink styleClass="thumbLink" action="#{scsMain.gotoConvCheckFront}"
             rendered="#{scsMainBackBean.couponOrCheck eq 'Check'}" >
             <h:graphicImage styleClass="thumbnail" value='/images/page4-convcheck-thumb.png'/>
             </h:commandLink>
            
             <h:outputText styleClass="thumbSep" value=" "
             rendered="#{scsMainBackBean.couponOrCheck eq 'Check'}" />
            
             <h:commandLink styleClass="thumbLink" action="#{scsMain.gotoConvCheckBack}"
             rendered="#{scsMainBackBean.couponOrCheck eq 'Check'}" >
             <h:graphicImage styleClass="thumbnail" value='/images/page5-convcheck-thumb.png'/>
             </h:commandLink>
            
             <h:outputText styleClass="thumbSep" value=" "
             rendered="#{scsMainBackBean.couponOrCheck eq 'Check'}" />
            
             <h:commandLink styleClass="thumbLink" action="#{scsMain.gotoCouponFront}"
             rendered="#{scsMainBackBean.couponOrCheck eq 'Coupon'}" >
             <h:graphicImage styleClass="thumbnail" value='/images/page4-coupon-thumb.png'/>
             </h:commandLink>
            
             <h:outputText styleClass="thumbSep" value=" "
             rendered="#{scsMainBackBean.couponOrCheck eq 'Coupon'}" />
            
             <h:commandLink styleClass="thumbLink" action="#{scsMain.gotoCouponBack}"
             rendered="#{scsMainBackBean.couponOrCheck eq 'Coupon'}" >
             <h:graphicImage styleClass="thumbnail" value='/images/page5-124-125-127-thumb.png'/>
             </h:commandLink>
            
            
             </h:panelGroup>
             </h:panelGrid>
            
             <h:panelGrid columns="1" cellpadding='4' cellspacing='4' >
             <h:panelGroup >
             <h:commandLink action="#{scsMain.gotoMainPage}" styleClass='goBackLink'>
             <h:outputText value="[Back To Main Page] " />
             </h:commandLink>
            
             <h:outputText value=" " />
            
             <h:commandLink action="#{scsMain.gotoCriteria}" styleClass='goBackLink'>
             <h:outputText value=" [Edit/View Criteria Sets]" />
             </h:commandLink>
             </h:panelGroup>
             </h:panelGrid>
            
            
            
            </h:panelGrid>
            
            
            
            </h:form>
            
            </div>
            



            • 3. Re: h:commandLink action method does not execute when using
              John Tsimikas Newbie

              Action Bean

              @Stateful
              @Name("scsMain")
              @CacheConfig(idleTimeoutSeconds=3600) /* 60 minutes */
              @Scope(ScopeType.SESSION)
              
              ....
              
               public String gotoPage1() {
               return "page1";
               }
               //////////////////////////////////////////////////////////////////////////////
               public String gotoPage2() {
               return "page2";
               }
               //////////////////////////////////////////////////////////////////////////////
               public String gotoPage3() {
               return "page3";
               }
               //////////////////////////////////////////////////////////////////////////////
               public String gotoConvCheckFront() {
               return "pageConvCheckFront";
               }
               //////////////////////////////////////////////////////////////////////////////
               public String gotoConvCheckBack() {
               return "pageConvCheckBack";
               }
               //////////////////////////////////////////////////////////////////////////////
               public String gotoCouponFront() {
               return "pageCouponFront";
               }
               //////////////////////////////////////////////////////////////////////////////
               public String gotoCouponBack() {
               return "pageCouponBack";
               }
               //////////////////////////////////////////////////////////////////////////////
               public String gotoInserts() {
               return "inserts";
               }
               //////////////////////////////////////////////////////////////////////////////
               public String gotoMainPage() {
               return "mainPage";
               }
               public String gotoCriteria() {
               log.info("gotoCriteria()");
               return "gotoCriteria";
               }
               public String gotoOnsertHistory() {
               return "gotoOnsertHistory";
               }
              



              faces-config.xml
               <navigation-rule>
               <from-view-id>/webpages/SCSPhysicalInserts.xhtml</from-view-id>
              
               <navigation-case>
               <from-outcome>gotoAttachInserts</from-outcome>
               <to-view-id>/webpages/SCSFileUpload.xhtml</to-view-id>
               </navigation-case>
              
               <navigation-case>
               <from-outcome>page1</from-outcome>
               <to-view-id>/webpages/SCSAccountTrans.xhtml</to-view-id>
               </navigation-case>
              
               <navigation-case>
               <from-outcome>page2</from-outcome>
               <to-view-id>/webpages/SCSLegalMessagesFront.xhtml</to-view-id>
               </navigation-case>
              
               <navigation-case>
               <from-outcome>page3</from-outcome>
               <to-view-id>/webpages/SCSLegalMessagesBack.xhtml</to-view-id>
               </navigation-case>
              
               <navigation-case>
               <from-outcome>pageConvCheckFront</from-outcome>
               <to-view-id>/webpages/SCSConvCheckFront.xhtml</to-view-id>
               </navigation-case>
              
               <navigation-case>
               <from-outcome>pageConvCheckBack</from-outcome>
               <to-view-id>/webpages/SCSConvCheckBack.xhtml</to-view-id>
               </navigation-case>
              
               <navigation-case>
               <from-outcome>pageCouponFront</from-outcome>
               <to-view-id>/webpages/SCSCouponFront.xhtml</to-view-id>
               </navigation-case>
              
               <navigation-case>
               <from-outcome>pageCouponBack</from-outcome>
               <to-view-id>/webpages/SCSCouponBack.xhtml</to-view-id>
               </navigation-case>
              
               <navigation-case>
               <from-outcome>inserts</from-outcome>
               <to-view-id>/webpages/SCSPhysicalInserts.xhtml</to-view-id>
               </navigation-case>
              
               <navigation-case>
               <from-outcome>mainPage</from-outcome>
               <to-view-id>/webpages/SCSMain.xhtml</to-view-id>
               </navigation-case>
              
               <navigation-case>
               <from-outcome>gotoCriteria</from-outcome>
               <to-view-id>/webpages/SCSViewCriteriaSets.xhtml</to-view-id>
               </navigation-case>
               </navigation-rule>
              
              
              


              • 4. Re: h:commandLink action method does not execute when using
                John Tsimikas Newbie

                Using s:link instead of h:commandLink fixes the problem when using a h:dataTable