9 Replies Latest reply on Aug 6, 2013 6:05 AM by Immo Benjes

    Urgent: upgrade richfaces 4.2 error with <rich:componentControl> inside <rich:dataTable>

    Ngan Lee Newbie

      Our application that was working fine in richfaces 3.x. I'm upgrading to RF 4.3 and myfaces 2.1.9 and got problem with the <rich:componentControl> being used inside <rich:dataTable>.

      I tested out with RF 4.1 and got no problem, but other components that we used in 3.x is not ported in 4.1. This drives me crazy. Could someone tell me what's going on? Thanks.

       

       

      javax.faces.view.facelets.TagAttributeException: /pages/listAssayBatch.xhtml at line 205 and column 89 event="onclick" eventName onclick not found on component instance

                at org.apache.myfaces.view.facelets.tag.jsf.BehaviorTagHandlerDelegate.applyAttachedObject(BehaviorTagHandlerDelegate.java:172)

                at org.apache.myfaces.view.facelets.tag.jsf.BehaviorTagHandlerDelegate.apply(BehaviorTagHandlerDelegate.java:71)

                at org.richfaces.view.facelets.html.BehaviorTagHandlerDelegate.apply(BehaviorTagHandlerDelegate.java:79)

                at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:53)

                at org.richfaces.taglib.ComponentControlHandler.apply(ComponentControlHandler.java:56)

                at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:49)

                at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:58)

                at org.richfaces.view.facelets.html.BehaviorsAddingComponentHandlerWrapper.applyNextHandler(BehaviorsAddingComponentHandlerWrapper.java:53)

                at org.apache.myfaces.view.facelets.tag.jsf.ComponentTagHandlerDelegate.apply(ComponentTagHandlerDelegate.java:294)

                at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:53)

                at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:58)

                at org.richfaces.view.facelets.html.BehaviorsAddingComponentHandlerWrapper.applyNextHandler(BehaviorsAddingComponentHandlerWrapper.java:53)

                at org.apache.myfaces.view.facelets.tag.jsf.ComponentTagHandlerDelegate.apply(ComponentTagHandlerDelegate.java:294)

                at javax.faces.v

       

      This happens when I have the following <rich:componentControl> inside <rich:dataTable> :

      <rich:componentControl event="onclick" target="menu" operation="show">

                                <f:param value="#{assayBatchItem.title}" name="title"/>

                                <f:param value="#{assayBatchItem.assayBatchId}" name="ID" />

                                <f:param value="#{assayBatchItem.locked}" name="datalocked" />

                               

                            </rich:componentControl>

       

       

      The whole content of the JSF page:

      <?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">

       

       

      <ui:composition 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:t="http://myfaces.apache.org/tomahawk"

            xmlns:acegijsf="http://sourceforge.net/projects/jsf-comp/acegijsf"

            xmlns:a4j="http://richfaces.org/a4j"

            xmlns:rich="http://richfaces.org/rich">

       

       

      <head>

          <link rel="stylesheet" type="text/css" href="../css/global.css"/>

          <script type="text/javascript" src="../js/global.js"></script>  

      </head>

       

       

       

       

      <body><center>

                <h:panelGrid columns="1" border="0" cellspacing="0" cellpadding="0" style="text-align: center">

       

                                      <h:panelGroup>

                                              <h:outputText value="List Alls Assay Batches" styleClass="style1"/>

                                </h:panelGroup>                                   

                                     <br/>

                              <h:messages styleClass="errors"/>

       

                        <h:form id="editAssayBatchForm">

                                  <br/><br/>

       

                          <rich:contextMenu attached="false" id="menu" submitMode="ajax">

       

                            <rich:menuItem ajaxSingle="true" action="#{assayDataBean.editAssayMetaData}" disabled="#{assayDataBean.assayBatchItem.locked}" >

                                 Edit/View Assay Batch ID <b>1548</b>

                                <a4j:param name="batchId" assignTo="#{assayDataBean.assayBatchItem.assayBatchId}" value="1548"/>

                                 <a4j:param name="locked" assignTo="#{assayDataBean.assayBatchItem.locked}" value="{datalocked}"/>

                            </rich:menuItem>

       

                            <rich:menuGroup value="Actions">

                                <rich:menuItem ajaxSingle="true" action="#{assayDataBean.doAction}" value="List Assay Runs {datalocked}">

                                    <a4j:param name="batchId" assignTo="#{assayDataBean.assayBatchItem.assayBatchId}" value="1548"/>

                                    <a4j:param name="selectedAction" assignTo="#{assayDataBean.selectedAction}" value="List Assay Runs" />

                                      <a4j:param name="locked" assignTo="#{assayDataBean.assayBatchItem.locked}" value="{locked}"/>

                                </rich:menuItem>

                                                         <rich:menuItem ajaxSingle="true" action="#{assayDataBean.doAction}" value="Create New Assay Run"  disabled="#{assayDataBean.assayBatchItem.locked}" >

                                    <a4j:param name="batchId" assignTo="#{assayDataBean.assayBatchItem.assayBatchId}" value="1548"/>

                                    <a4j:param name="selectedAction" assignTo="#{assayDataBean.selectedAction}" value="Create New Assay Run" />

                                      <a4j:param name="locked" assignTo="#{assayDataBean.assayBatchItem.locked}" value="{datalocked}"/>

                                </rich:menuItem>

       

       

                                 <rich:menuItem ajaxSingle="true" action="#{assayDataBean.doAction}" value="Edit SOMAmer Mix Formulations">

                                                                                           <a4j:param name="batchId" assignTo="#{assayDataBean.assayBatchItem.assayBatchId}" value="1548"/>

                                    <a4j:param name="selectedAction" assignTo="#{assayDataBean.selectedAction}" value="Edit SOMAmer Mix Formulations" />

                                    <a4j:param name="locked" assignTo="#{assayDataBean.assayBatchItem.locked}" value="{datalocked}"/>

                                </rich:menuItem>

                                 <rich:menuItem ajaxSingle="true" action="#{assayDataBean.doAction}" value="List SOMAmer Mix Formulations">

                                    <a4j:param name="batchId" assignTo="#{assayDataBean.assayBatchItem.assayBatchId}" value="1548"/>

                                    <a4j:param name="selectedAction" assignTo="#{assayDataBean.selectedAction}" value="List SOMAmer Mix Formulations" />

                                </rich:menuItem>

                                 <rich:menuItem ajaxSingle="true" action="#{assayDataBean.doAction}" value="List Critical Materials">

                                    <a4j:param name="batchId" assignTo="#{assayDataBean.assayBatchItem.assayBatchId}" value="1548"/>

                                    <a4j:param name="selectedAction" assignTo="#{assayDataBean.selectedAction}" value="List Critical Materials" />

                                </rich:menuItem>                       

                                 <rich:menuItem ajaxSingle="true" action="#{assayDataBean.doAction}" value="List Non-Critical Materials">

                                    <a4j:param name="batchId" assignTo="#{assayDataBean.assayBatchItem.assayBatchId}" value="1548"/>

                                    <a4j:param name="selectedAction" assignTo="#{assayDataBean.selectedAction}" value="List Non-Critical Materials" />

                                </rich:menuItem>

                                 <rich:menuItem ajaxSingle="true" action="#{assayDataBean.doAction}" value="Import Critical Materials">

                                    <a4j:param name="batchId" assignTo="#{assayDataBean.assayBatchItem.assayBatchId}" value="1548"/>

                                    <a4j:param name="selectedAction" assignTo="#{assayDataBean.selectedAction}" value="Import Critical Materials" />

                                </rich:menuItem>                         

       

       

                                 <rich:menuItem ajaxSingle="true" action="#{assayDataBean.doAction}" value="Import Non-Critical Materials">

       

       

                                    <a4j:param name="batchId" assignTo="#{assayDataBean.assayBatchItem.assayBatchId}" value="1548"/>

                                    <a4j:param name="selectedAction" assignTo="#{assayDataBean.selectedAction}" value="Import Non-Critical Materials" />

                                </rich:menuItem>                                                   

       

       

                                 <rich:menuItem ajaxSingle="true" action="#{assayDataBean.doAction}" value="View/Add Sample Submission Form">

       

       

                                    <a4j:param name="batchId" assignTo="#{assayDataBean.assayBatchItem.assayBatchId}" value="1548"/>

                                    <a4j:param name="selectedAction" assignTo="#{assayDataBean.selectedAction}" value="View Sample Submission Form" />

                                </rich:menuItem>

                                <rich:menuItem ajaxSingle="true" action="#{assayDataBean.doAction}" value="View Assay Check List">

                                    <a4j:param name="batchId" assignTo="#{assayDataBean.assayBatchItem.assayBatchId}" value="1548"/>

                                    <a4j:param name="selectedAction" assignTo="#{assayDataBean.selectedAction}" value="Assay Check List" />

                                </rich:menuItem>

                                <rich:menuItem ajaxSingle="true" action="#{assayDataBean.doAction}" value="Reset Calculations" onmousedown="startProgressBar();">

                                    <a4j:param name="batchId" assignTo="#{assayDataBean.assayBatchItem.assayBatchId}" value="1548"/>

                                    <a4j:param name="selectedAction" assignTo="#{assayDataBean.selectedAction}" value="Reset Calculations" />

                                </rich:menuItem>

                            </rich:menuGroup>

       

       

                             <rich:menuGroup value="Reports">

       

                              <rich:menuItem ajaxSingle="true" action="#{assayDataBean.doAction}" value="ADAT Report">

                                    <a4j:param name="batchId" assignTo="#{assayDataBean.assayBatchItem.assayBatchId}" value="1548"/>

                                    <a4j:param name="selectedAction" assignTo="#{assayDataBean.selectedAction}" value="doADATReport" />

                                </rich:menuItem>

                                <rich:menuItem submitMode="server" action="#{assayDataBean.doAction}" value="QA Report">

                                    <a4j:param name="runId" assignTo="#{assayDataBean.assayBatchItem.assayBatchId}" value="1548"/>

                                    <a4j:param name="selectedAction" assignTo="#{assayDataBean.selectedAction}" value="doBatchQAReport" />

                                </rich:menuItem>

                             </rich:menuGroup>

       

                                           </rich:contextMenu>

                    <h:panelGrid width="1300px" columns="1">      

                                      <rich:dataTable width="75%" value="#{assayDataBean.assayBatchList}"

                                                                    onRowMouseOver="this.style.backgroundColor='#ccc'"

                                                          onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"                                          

                                                          var="assayBatchItem" styleClass="list" rowClasses="cur" columnClasses="column10px,column150px,column100px,column5px,column100px,column100px,column250px,column50px,column10px,column5px,column5px,column50px" headerClass="headerAlignment">                                         

       

                         <rich:column sortBy="#{assayBatchItem.assayBatchId}">

                             <f:facet name="header">

                                 <h:outputText value="ID" styleClass="style2"/>

                              </f:facet>

                             <h:outputText value="#{assayBatchItem.assayBatchId}" rendered="#{assayBatchItem.assayBatchId != null}" styleClass="style5"/>

                         </rich:column>

       

                         <rich:column sortBy="#{assayBatchItem.title}"

                         filterBy="#{assayBatchItem.title}" filterEvent="onkeyup" filterValue="#{assayDataBean.curTitleFilterValue}">                 

                             <f:facet name="header">

                                 <h:outputText value="Title" styleClass="style2"/>

                             </f:facet>

                             <h:outputText value="#{assayBatchItem.title}" rendered="#{assayBatchItem.title != null}" styleClass="style5"/>

                         </rich:column>

       

       

                         <rich:column sortBy="#{assayBatchItem.clientName}"

                          filterBy="#{assayBatchItem.clientName}" filterEvent="onkeyup" filterValue="#{assayDataBean.curClientFilterValue}">

                             <f:facet name="header">

                                 <h:outputText value="Client" styleClass="style2"/>

                             </f:facet>

                             <h:outputText value="#{assayBatchItem.clientName}" rendered="#{assayBatchItem.clientName != null}" styleClass="style5"/>

                         </rich:column>

                          <h:column>

                             <f:facet name="header">

                                 <h:outputText value="Sample Type" styleClass="style2"/>

                             </f:facet>

                             <h:outputText value="#{assayBatchItem.sampleType}" rendered="#{assayBatchItem.sampleType != null}" styleClass="style5"/>

                         </h:column>

                          <rich:column sortBy="#{assayBatchItem.enteredDate}">     

                             <f:facet name="header">

                                 <h:outputText value="Entered Date" styleClass="style2"/>

                             </f:facet>

                             <h:outputText value="#{assayBatchItem.enteredDate}" rendered="#{assayBatchItem.enteredDate != null}" styleClass="style5"/>

                          </rich:column>

       

                          <rich:column sortBy="#{assayBatchItem.enteredBy}"

                          filterBy="#{assayBatchItem.enteredBy}" filterEvent="onkeyup" filterValue="#{assayDataBean.curEnteredByFilterValue}">

                             <f:facet name="header">

                                 <h:outputText value="Entered By" styleClass="style2"/>

                             </f:facet>

                             <h:outputText value="#{assayBatchItem.enteredBy}" rendered="#{assayBatchItem.enteredBy != null}" styleClass="style5"/>

                          </rich:column>

       

                           <rich:column>

                             <f:facet name="header">

                                 <h:outputText value="Notes" styleClass="style2"/>

                             </f:facet>

                             <h:outputText value="#{assayBatchItem.notes}" rendered="#{assayBatchItem.notes != null}" styleClass="style5"/>

                          </rich:column>

       

                                 <rich:column>

                             <f:facet name="header">

                                 <h:outputText value="Protocol" styleClass="style2"/>

                             </f:facet>

                             <h:outputText value="#{assayBatchItem.protocolVersion}" rendered="#{assayBatchItem.protocolVersion != null}" styleClass="style5"/>

                          </rich:column>                

       

                          <rich:column>

                             <f:facet name="header">

                                 <h:outputText value="Slidelot Id" styleClass="style2"/>

                             </f:facet>

                             <h:outputText value="#{assayBatchItem.slidelot}" rendered="#{assayBatchItem.slidelot != null}" styleClass="style5"/>

                          </rich:column>

       

                                 <rich:column>

                             <f:facet name="header">

                                 <h:outputText value="Data Finalized" styleClass="style2"/>

                             </f:facet>

                             <h:outputText value="#{assayBatchItem.finalized}" rendered="#{assayBatchItem.finalized != null}" styleClass="style5"/>

                          </rich:column>

       

       

                      <rich:column>

                             <f:facet name="header">

                                 <h:outputText value="Project Locked" styleClass="style2"/>

                             </f:facet>

                             <h:outputText value="#{assayBatchItem.locked}" rendered="#{assayBatchItem.locked != null}" styleClass="style5"/>

                          </rich:column>

       

                                <rich:column>

                             <f:facet name="header">

                                                 <h:outputText value="Action" styleClass="style2"/>

                             </f:facet>

                              <acegijsf:authorize ifAnyGranted="ROLE_MANAGER,ROLE_OPERATOR">

                              <h:commandButton id="finalizeData" actionListener="#{assayDataBean.finalizeData}" value="Finalize Data" rendered="#{assayBatchItem.finalized == false}" styleClass="style2">

                                                                            <f:attribute name="assayBatchId" value="#{assayBatchItem.assayBatchId}"/>                                 

                              </h:commandButton>

                             </acegijsf:authorize>

                             <h:outputText value="locked" rendered="#{assayBatchItem.locked == true}" styleClass="style5"/>

                         </rich:column>

                          <f:facet name="footer">

                                                             <rich:dataScroller id="ds" renderIfSinglePage="true" ajaxSingle="false"></rich:dataScroller>

                                                        </f:facet>

                        <rich:componentControl event="onclick" target="menu" operation="show">

                                <f:param value="#{assayBatchItem.title}" name="title"/>

                                <f:param value="#{assayBatchItem.assayBatchId}" name="ID" />

                                <f:param value="#{assayBatchItem.locked}" name="datalocked" />

       

                            </rich:componentControl>             

       

                     </rich:dataTable>

                     </h:panelGrid>

       

                  <!--            <h:message for="action" styleClass="errors"/> -->                                      

                  </h:form>

       

                </h:panelGrid>

                Note: When an assay batch is finalized, data is locked and no updates can be done.

                </center>

      </body>

       

       

      </ui:composition>

        • 1. Re: Urgent: upgrade richfaces 4.2 error with <rich:componentControl> inside <rich:dataTable>
          Chris Dollar Novice

          Try using event="click" instead of event="onclick". That's one of the things that has changed with RF4.

          • 2. Re: Urgent: upgrade richfaces 4.2 error with <rich:componentControl> inside <rich:dataTable>
            Pavol Pitonak Master

            Hi,

             

            Chris is right, you need to change event's name. For more information about migration, see https://community.jboss.org/wiki/RichFacesMigrationGuide33x-4xMigration

             

            Regards,

            Palo

            • 3. Re: Urgent: upgrade richfaces 4.2 error with <rich:componentControl> inside <rich:dataTable>
              Ngan Lee Newbie

              Thanks Palo and Chris for your quick response. I tried with event="click" and got the same error. This works in 4.1 but 4.1 is missing other components that I was using in 3.x. Can you write a small test having <rich:componentControl> inside <rich:dataTable> to see if it works for you? Can someone make sure this works in 4.2 and above? I've been fiddling with this for days and still stuck with this.

               

              Here is the error with event="click"

               

               

              Jan 24, 2013 6:54:50 AM org.apache.catalina.core.StandardWrapperValve invoke

              SEVERE: Servlet.service() for servlet Faces Servlet threw exception

              javax.faces.view.facelets.TagAttributeException: /pages/listAssayBatch.xhtml at line 205 and column 87 event="click" eventName click not found on component instance

                        at org.apache.myfaces.view.facelets.tag.jsf.BehaviorTagHandlerDelegate.applyAttachedObject(BehaviorTagHandlerDelegate.java:172)

                        at org.apache.myfaces.view.facelets.tag.jsf.BehaviorTagHandlerDelegate.apply(BehaviorTagHandlerDelegate.java:71)

                        at org.richfaces.view.facelets.html.BehaviorTagHandlerDelegate.apply(BehaviorTagHandlerDelegate.java:79)

                        at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:53)

                        at org.richfaces.taglib.ComponentControlHandler.apply(ComponentControlHandler.java:56)

                        at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:49)

                        at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:58)

                        at org.richfaces.view.facelets.html.BehaviorsAddingComponentHandlerWrapper.applyNextHandler(BehaviorsAddingComponentHandlerWrapper.java:53)

                        at org.apache.myfaces.view.facelets.tag.jsf.ComponentTagHandlerDelegate.apply(ComponentTagHandlerDelegate.java:294)

                        at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:53)

                        at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:58)

                        at org.richfaces.view.facelets.html.BehaviorsAddingComponentHandlerWrapper.applyNextHandler(BehaviorsAddingComponentHandlerWrapper.java:53)

                        at org.apache.myfaces.view.facelets.tag.jsf.ComponentTagHandlerDelegate.apply(ComponentTagHandlerDelegate.java:294)

                        at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:53)

                        at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:49)

                        at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:58)

                        at org.richfaces.view.facelets.html.BehaviorsAddingComponentHandlerWrapper.applyNextHandler(BehaviorsAddingComponentHandlerWrapper.java:53)

                        at org.apache.myfaces.view.facelets.tag.jsf.ComponentTagHandlerDelegate.apply(ComponentTagHandlerDelegate.java:294)

                        at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:53)

                        at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:49)

                        at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:58)

                        at org.richfaces.view.facelets.html.BehaviorsAddingComponentHandlerWrapper.applyNextHandler(BehaviorsAddingComponentHandlerWrapper.java:53)

                        at org.apache.myfaces.view.facelets.tag.jsf.ComponentTagHandlerDelegate.apply(ComponentTagHandlerDelegate.java:294)

                        at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:53)

                        at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:49)

                        at org.apache.myfaces.view.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:158)

                        at org.apache.myfaces.view.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:5

              • 4. Re: Urgent: upgrade richfaces 4.2 error with <rich:componentControl> inside <rich:dataTable>
                Chris Dollar Novice

                Ngan, based on your code I don't see how it could work.... You've got your rich:componentControl outside of all the columns of the datatable, and you're trying to use the "var" you called "assayBatchItem" in the component control. I can't see that that will work since that assayBatchItem will change with each row. How does the component control know which row it is using? Perhaps you should attach the componentControl tag (many of them) to the rich:column and see what you get.

                • 5. Re: Urgent: upgrade richfaces 4.2 error with <rich:componentControl> inside <rich:dataTable>
                  Ngan Lee Newbie

                  a component control is attached to each row linked to each "assayBatchItem" in the datatable, the list of value="#{assayDataBean.assayBatchList}". When a row is clicked, used to be in RF 3.x:

                   

                  <rich:componentControl id="action" event="onRowClick" for="menu" operation="show">

                                            <f:param value="#{assayBatchItem.title}" name="title"/>

                                            <f:param value="#{assayBatchItem.assayBatchId}" name="ID" />

                                             <f:param value="#{assayBatchItem.locked}" name="datalocked" />

                                           

                                        </rich:componentControl>

                   

                  I get these values out of the object "assayBatchItem or row being clicked and send them to each menuItem built out of a menuContext. Ok. Let me paste the version of 3.x that always works:

                   

                  <?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:c="http://java.sun.com/jstl/core"

                            xmlns:t="http://myfaces.apache.org/tomahawk"

                            xmlns:f="http://java.sun.com/jsf/core" xml:lang="en" lang="en"

                            xmlns:acegijsf="http://sourceforge.net/projects/jsf-comp/acegijsf"

                            xmlns:a4j="http://richfaces.org/a4j"

                      xmlns:rich="http://richfaces.org/rich">

                   

                   

                  <head>

                            <link rel="stylesheet" type="text/css" href="../css/global.css" />

                            <script type="text/javascript" src="../js/global.js"></script>

                  </head>

                  <body><center>

                            <h:panelGrid columns="1" border="0" cellspacing="0" cellpadding="0" style="text-align: center">

                                          

                                                  <h:panelGroup>

                                                          <h:outputText value="List Assay Batches" styleClass="style1"/>

                                            </h:panelGroup>                                   

                                                 <br/>

                                          <h:messages styleClass="errors"/>

                                                                        

                                    <h:form id="editAssayBatchForm">

                                              <br/><br/>

                                        <rich:contextMenu attached="false" id="menu" submitMode="ajax">

                                        <rich:menuItem ajaxSingle="true" action="#{assayDataBean.editAssayMetaData}" disabled="#{assayDataBean.assayBatchItem.locked}" >

                                             Edit/View Assay Batch ID <b>{ID} {datalocked}</b>

                                            <a4j:actionparam name="batchId" assignTo="#{assayDataBean.assayBatchItem.assayBatchId}" value="{ID}"/>

                                             <a4j:actionparam name="locked" assignTo="#{assayDataBean.assayBatchItem.locked}" value="{datalocked}"/>

                                        </rich:menuItem>

                                       

                                        <rich:menuGroup value="Actions">

                                            <rich:menuItem ajaxSingle="true" action="#{assayDataBean.doAction}" value="List Assay Runs {datalocked}">

                                                <a4j:actionparam name="batchId" assignTo="#{assayDataBean.assayBatchItem.assayBatchId}" value="{ID}"/>

                                                <a4j:actionparam name="selectedAction" assignTo="#{assayDataBean.selectedAction}" value="List Assay Runs" />

                                                  <a4j:actionparam name="locked" assignTo="#{assayDataBean.assayBatchItem.locked}" value="{locked}"/>

                                            </rich:menuItem>

                                                                                    <rich:menuItem ajaxSingle="true" action="#{assayDataBean.doAction}" value="Create New Assay Run"  disabled="#{assayDataBean.assayBatchItem.locked}" >

                                                <a4j:actionparam name="batchId" assignTo="#{assayDataBean.assayBatchItem.assayBatchId}" value="{ID}"/>

                                                <a4j:actionparam name="selectedAction" assignTo="#{assayDataBean.selectedAction}" value="Create New Assay Run" />

                                                  <a4j:actionparam name="locked" assignTo="#{assayDataBean.assayBatchItem.locked}" value="{datalocked}"/>

                                            </rich:menuItem>

                   

                   

                                             <rich:menuItem ajaxSingle="true" action="#{assayDataBean.doAction}" value="Edit SOMAmer Mix Formulations">

                                                                                                                      <a4j:actionparam name="batchId" assignTo="#{assayDataBean.assayBatchItem.assayBatchId}" value="{ID}"/>

                                                <a4j:actionparam name="selectedAction" assignTo="#{assayDataBean.selectedAction}" value="Edit SOMAmer Mix Formulations" />

                                                <a4j:actionparam name="locked" assignTo="#{assayDataBean.assayBatchItem.locked}" value="{datalocked}"/>

                                            </rich:menuItem>

                                             <rich:menuItem ajaxSingle="true" action="#{assayDataBean.doAction}" value="List SOMAmer Mix Formulations">

                                                <a4j:actionparam name="batchId" assignTo="#{assayDataBean.assayBatchItem.assayBatchId}" value="{ID}"/>

                                                <a4j:actionparam name="selectedAction" assignTo="#{assayDataBean.selectedAction}" value="List SOMAmer Mix Formulations" />

                                            </rich:menuItem>

                                             <rich:menuItem ajaxSingle="true" action="#{assayDataBean.doAction}" value="List Critical Materials">

                                                <a4j:actionparam name="batchId" assignTo="#{assayDataBean.assayBatchItem.assayBatchId}" value="{ID}"/>

                                                <a4j:actionparam name="selectedAction" assignTo="#{assayDataBean.selectedAction}" value="List Critical Materials" />

                                            </rich:menuItem>                       

                                             <rich:menuItem ajaxSingle="true" action="#{assayDataBean.doAction}" value="List Non-Critical Materials">

                                                <a4j:actionparam name="batchId" assignTo="#{assayDataBean.assayBatchItem.assayBatchId}" value="{ID}"/>

                                                <a4j:actionparam name="selectedAction" assignTo="#{assayDataBean.selectedAction}" value="List Non-Critical Materials" />

                                            </rich:menuItem>

                                             <rich:menuItem ajaxSingle="true" action="#{assayDataBean.doAction}" value="Import Critical Materials">

                                                <a4j:actionparam name="batchId" assignTo="#{assayDataBean.assayBatchItem.assayBatchId}" value="{ID}"/>

                                                <a4j:actionparam name="selectedAction" assignTo="#{assayDataBean.selectedAction}" value="Import Critical Materials" />

                                            </rich:menuItem>                         

                   

                   

                                             <rich:menuItem ajaxSingle="true" action="#{assayDataBean.doAction}" value="Import Non-Critical Materials">

                   

                   

                                                <a4j:actionparam name="batchId" assignTo="#{assayDataBean.assayBatchItem.assayBatchId}" value="{ID}"/>

                                                <a4j:actionparam name="selectedAction" assignTo="#{assayDataBean.selectedAction}" value="Import Non-Critical Materials" />

                                            </rich:menuItem>                                                   

                   

                   

                                             <rich:menuItem ajaxSingle="true" action="#{assayDataBean.doAction}" value="View/Add Sample Submission Form">

                   

                   

                                                <a4j:actionparam name="batchId" assignTo="#{assayDataBean.assayBatchItem.assayBatchId}" value="{ID}"/>

                                                <a4j:actionparam name="selectedAction" assignTo="#{assayDataBean.selectedAction}" value="View Sample Submission Form" />

                                            </rich:menuItem>

                                            <rich:menuItem ajaxSingle="true" action="#{assayDataBean.doAction}" value="View Assay Check List">

                                                <a4j:actionparam name="batchId" assignTo="#{assayDataBean.assayBatchItem.assayBatchId}" value="{ID}"/>

                                                <a4j:actionparam name="selectedAction" assignTo="#{assayDataBean.selectedAction}" value="Assay Check List" />

                                            </rich:menuItem>

                                            <rich:menuItem ajaxSingle="true" action="#{assayDataBean.doAction}" value="Reset Calculations" onmousedown="startProgressBar();">

                                                <a4j:actionparam name="batchId" assignTo="#{assayDataBean.assayBatchItem.assayBatchId}" value="{ID}"/>

                                                <a4j:actionparam name="selectedAction" assignTo="#{assayDataBean.selectedAction}" value="Reset Calculations" />

                                            </rich:menuItem>

                                        </rich:menuGroup>

                   

                   

                                         <rich:menuGroup value="Reports">

                                        

                                          <rich:menuItem ajaxSingle="true" action="#{assayDataBean.doAction}" value="ADAT Report">

                                                <a4j:actionparam name="batchId" assignTo="#{assayDataBean.assayBatchItem.assayBatchId}" value="{ID}"/>

                                                <a4j:actionparam name="selectedAction" assignTo="#{assayDataBean.selectedAction}" value="doADATReport" />

                                            </rich:menuItem>

                                            <rich:menuItem submitMode="server" action="#{assayDataBean.doAction}" value="QA Report">

                                                <a4j:actionparam name="runId" assignTo="#{assayDataBean.assayBatchItem.assayBatchId}" value="{ID}"/>

                                                <a4j:actionparam name="selectedAction" assignTo="#{assayDataBean.selectedAction}" value="doBatchQAReport" />

                                            </rich:menuItem>

                                         </rich:menuGroup>

                                        

                                                       </rich:contextMenu>

                                <h:panelGrid width="1300px" columns="1">      

                                                  <rich:dataTable width="75%" value="#{assayDataBean.assayBatchList}"

                                                                      onRowMouseOver="this.style.backgroundColor='#ccc'"

                                                                      onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"                                          

                                                                      var="assayBatchItem" styleClass="list" rowClasses="cur" columnClasses="column10px,column150px,column100px,column5px,column100px,column100px,column250px,column50px,column10px,column5px,column5px,column50px" headerClass="headerAlignment">                                         

                                                

                                     <rich:column sortBy="#{assayBatchItem.assayBatchId}">

                                         <f:facet name="header">

                                             <h:outputText value="ID" styleClass="style2"/>

                                          </f:facet>

                                         <h:outputText value="#{assayBatchItem.assayBatchId}" rendered="#{assayBatchItem.assayBatchId != null}" styleClass="style5"/>

                                     </rich:column>

                                    

                                     <rich:column sortBy="#{assayBatchItem.title}"

                                     filterBy="#{assayBatchItem.title}" filterEvent="onkeyup" filterValue="#{assayDataBean.curTitleFilterValue}">                 

                                         <f:facet name="header">

                                             <h:outputText value="Title" styleClass="style2"/>

                                         </f:facet>

                                         <h:outputText value="#{assayBatchItem.title}" rendered="#{assayBatchItem.title != null}" styleClass="style5"/>

                                     </rich:column>

                   

                   

                                     <rich:column sortBy="#{assayBatchItem.clientName}"

                                      filterBy="#{assayBatchItem.clientName}" filterEvent="onkeyup" filterValue="#{assayDataBean.curClientFilterValue}">

                                         <f:facet name="header">

                                             <h:outputText value="Client" styleClass="style2"/>

                                         </f:facet>

                                         <h:outputText value="#{assayBatchItem.clientName}" rendered="#{assayBatchItem.clientName != null}" styleClass="style5"/>

                                     </rich:column>

                                      <h:column>

                                         <f:facet name="header">

                                             <h:outputText value="Sample Type" styleClass="style2"/>

                                         </f:facet>

                                         <h:outputText value="#{assayBatchItem.sampleType}" rendered="#{assayBatchItem.sampleType != null}" styleClass="style5"/>

                                     </h:column>

                                      <rich:column sortBy="#{assayBatchItem.enteredDate}">     

                                         <f:facet name="header">

                                             <h:outputText value="Entered Date" styleClass="style2"/>

                                         </f:facet>

                                         <h:outputText value="#{assayBatchItem.enteredDate}" rendered="#{assayBatchItem.enteredDate != null}" styleClass="style5"/>

                                      </rich:column>

                   

                                      <rich:column sortBy="#{assayBatchItem.enteredBy}"

                                      filterBy="#{assayBatchItem.enteredBy}" filterEvent="onkeyup" filterValue="#{assayDataBean.curEnteredByFilterValue}">

                                         <f:facet name="header">

                                             <h:outputText value="Entered By" styleClass="style2"/>

                                         </f:facet>

                                         <h:outputText value="#{assayBatchItem.enteredBy}" rendered="#{assayBatchItem.enteredBy != null}" styleClass="style5"/>

                                      </rich:column>

                                     

                                       <rich:column>

                                         <f:facet name="header">

                                             <h:outputText value="Notes" styleClass="style2"/>

                                         </f:facet>

                                         <h:outputText value="#{assayBatchItem.notes}" rendered="#{assayBatchItem.notes != null}" styleClass="style5"/>

                                      </rich:column>

                                     

                                             <rich:column>

                                         <f:facet name="header">

                                             <h:outputText value="Protocol" styleClass="style2"/>

                                         </f:facet>

                                         <h:outputText value="#{assayBatchItem.protocolVersion}" rendered="#{assayBatchItem.protocolVersion != null}" styleClass="style5"/>

                                      </rich:column>                

                                    

                                      <rich:column>

                                         <f:facet name="header">

                                             <h:outputText value="Slidelot Id" styleClass="style2"/>

                                         </f:facet>

                                         <h:outputText value="#{assayBatchItem.slidelot}" rendered="#{assayBatchItem.slidelot != null}" styleClass="style5"/>

                                      </rich:column>

                                       

                                             <rich:column>

                                         <f:facet name="header">

                                             <h:outputText value="Data Finalized" styleClass="style2"/>

                                         </f:facet>

                                         <h:outputText value="#{assayBatchItem.finalized}" rendered="#{assayBatchItem.finalized != null}" styleClass="style5"/>

                                      </rich:column>

                   

                   

                                  <rich:column>

                                         <f:facet name="header">

                                             <h:outputText value="Project Locked" styleClass="style2"/>

                                         </f:facet>

                                         <h:outputText value="#{assayBatchItem.locked}" rendered="#{assayBatchItem.locked != null}" styleClass="style5"/>

                                      </rich:column>

                                     

                                            <rich:column>

                                         <f:facet name="header">

                                                             <h:outputText value="Action" styleClass="style2"/>

                                         </f:facet>

                                          <acegijsf:authorize ifAnyGranted="ROLE_MANAGER,ROLE_OPERATOR">

                                          <h:commandButton id="finalizeData" actionListener="#{assayDataBean.finalizeData}" value="Finalize Data" rendered="#{assayBatchItem.finalized == false}" styleClass="style2">

                                                                                        <f:attribute name="assayBatchId" value="#{assayBatchItem.assayBatchId}"/>                                 

                                          </h:commandButton>

                                         </acegijsf:authorize>

                                         <h:outputText value="locked" rendered="#{assayBatchItem.locked == true}" styleClass="style5"/>

                                     </rich:column>

                                      <f:facet name="footer">

                                                                         <rich:datascroller id="ds" renderIfSinglePage="true" ajaxSingle="false"></rich:datascroller>

                                                                    </f:facet>

                                    <rich:componentControl id="action" event="onRowClick" for="menu" operation="show">

                                            <f:param value="#{assayBatchItem.title}" name="title"/>

                                            <f:param value="#{assayBatchItem.assayBatchId}" name="ID" />

                                             <f:param value="#{assayBatchItem.locked}" name="datalocked" />

                                           

                                        </rich:componentControl>                                                                              

                                 </rich:dataTable>

                                 </h:panelGrid>

                                

                                         <h:message for="action" styleClass="errors"/>                                      

                              </h:form>

                                                                                                                                         

                            </h:panelGrid>

                            Note: When an assay batch is finalized, data is locked and no updates can be done.

                            </center>

                  </body>

                  </html>

                  • 6. Re: Urgent: upgrade richfaces 4.2 error with <rich:componentControl> inside <rich:dataTable>
                    Ngan Lee Newbie

                    I used the following example (the second) in this link with the list of cars. When a car is clicked, a menu popped up, select Actions from the menuGroup, then select the first item, "Put {car} to Basket", this is similar to what I have and it used to work.

                    http://livedemo.exadel.com/richfaces-demo/richfaces/contextMenu.jsf?c=contextMenu&tab=usage

                     

                    Would someone please fix to have this work in >= 4.2? It's urgent and we've been spending lots of time on this already.

                    Thanks,

                    Ngan

                    • 8. Re: Urgent: upgrade richfaces 4.2 error with <rich:componentControl> inside <rich:dataTable>
                      Ngan Lee Newbie

                      Thanks, I'm reworking our existing page and using the contextMenu design in this link. But I'm curious if anyone is looking into making componentControl backward compatible, and have it continue to work inside <rich:dataTable> tag when a row is clicked.

                      • 9. Re: Urgent: upgrade richfaces 4.2 error with <rich:componentControl> inside <rich:dataTable>
                        Immo Benjes Newbie

                        I've used the rich:componentControl and rich:contextMenu in a similar way as Ngan, that worked great in RF 3.3 but not anymore.

                         

                        I don't like 'right-click' in websites as the user does not know that a right click in this particular case results in a different menu then when he right clicks anywhere else (normal browser menu). I prefer to show an 'action' icon which brings up a contextMenu.

                         

                        I was able to set the label of the menu item based on which 'action icon' was clicked

                         

                        {code}

                        <rich:contextMenu attached="false" submitMode="ajax" id="testMenu">

                        <rich:menuItem value="{actionStr}" action="#{taskActionHandler.action(task)}" status="STload">

                                                          <f:facet name="icon">

                                                              <s:span styleClass="icon icon-action"/>

                                                        </f:facet>

                                                    <a:actionparam name="taskId" value="{taskId}" assignTo="#{taskActionHandler.viewTaskId}" ajaxSingle="true"/>

                           </rich:menuItem>

                        ...

                        </rich:contextMenu>

                        {code}

                         

                        and in the componentControl:

                         

                         

                        {code}

                        <rich:column id="link" width="40px" sortable="false">

                         

                                                   <f:facet name="header"><s:fragment rendered="#{taskGroup.hasNext}"><a:commandLink action="#{taskGroup.nextPage}" ajaxSingle="true" status="STload" reRender="DVtgroup"><h:graphicImage url="#{staticContent}/img/resultset_next.png" height="12"/></a:commandLink></s:fragment>

                                                    </f:facet>

                                                        <h:panelGroup id="acgroup">

                                                            <s:span styleClass="icon icon-action" id="aic"/>

                                                            <rich:componentControl event="onclick" for="testMenu" operation="show" attachTo="aic">

                                                                <f:param value="#{task.taskId}" name="taskId" />

                                                                <f:param value="#{taskGroup.getActionString(task)}" name="actionStr"/>

                                                            </rich:componentControl>

                                                        </h:panelGroup>

                                                </rich:column>

                        {code}

                         

                         

                        Now with RIchFaces 4.3 this doesn't work anymore. The contextMenu is shown but in the top left corner of the table and not where the actual click happened. The contextMenu is hidden straight away probably because the mouse is not over the menu.

                         

                        The text doesn't get set, so you can only use 'static' text in the contextMenu

                         

                        I know I can use the row select feature of the extendedDataTable but I have a rich:dataTabel with a collapsibleSubTable and that didn't work too well when I changed it to an extendedDataTable.

                         

                        Are there any workarounds?