0 Replies Latest reply on Jul 24, 2008 3:57 AM by M H

    RichFaces3.1.6 contextMenu does not work in a certain condit

    M H Newbie

      I use RichFaces3.1.6, JSF1.1, JDK1.4
      rich:contextMenu does not work in a certain condition.

      Following example 1 and 2 do not work, and only 3 works.

      However, you must describe the same menu every each item, and, in the case of example 3, it is non-efficiency.

      Is this a bug?
      Besides, is there a good hand?

      ===============================
      Example 1
      ===============================

      <rich:contextMenu attached="false" id="menu001" submitMode="ajax">
       <rich:menuItem ajaxSingle="false" reRender="table01" value="Menu001#{TestBean2.selectRow1}">
       <a4j:actionparam name="rowid1" assignTo="#{TestBean2.selectRow1}" value="{rkv}"/>
       </rich:menuItem>
       </rich:contextMenu>
       <rich:dataTable id="table01" value="#{TestBean2.datalist}" var="user" rowKeyVar="rkv">
       <h:column>
       <f:facet name="header">
       <h:outputText value="ID" />
       </f:facet>
       <h:outputText value="#{user.id}" />
       </h:column>
       <h:column>
       <f:facet name="header">
       <h:outputText value="NAME" />
       </f:facet>
       <h:outputText value="#{user.name}" />
       </h:column>
       <rich:componentControl event="onRowClick" for="menu001" operation="show">
       <f:param value="#{rkv}" name="rkv" />
       </rich:componentControl>
       </rich:dataTable>
       <h:inputText id="Text1" value="#{TestBean2.text}">
       <rich:componentControl event="onclick" for="menu001" operation="show">
       <f:param value="0" name="rkv" />
       </rich:componentControl>
       </h:inputText>
      

      ===============================
      Example 2
      ===============================
      <rich:dataTable id="table01" value="#{TestBean2.datalist}" var="user" rowKeyVar="rkv">
       <h:column>
       <f:facet name="header">
       <h:outputText value="ID" />
       </f:facet>
       <h:outputText value="#{user.id}" />
       </h:column>
       <h:column>
       <f:facet name="header">
       <h:outputText value="NAME" />
       </f:facet>
       <h:outputText value="#{user.name}" />
       </h:column>
       <rich:contextMenu attached="true" id="menu001" event="onclick" submitMode="ajax">
       <rich:menuItem ajaxSingle="false" reRender="table01" value="Menu001#{TestBean2.selectRow1}">
       <a4j:actionparam name="rowid1" assignTo="#{TestBean2.selectRow1}" value="#{rkv}"/>
       </rich:menuItem>
       </rich:contextMenu>
       </rich:dataTable>
      

      ===============================
      Example 3
      ===============================
      <rich:dataTable id="table01" value="#{TestBean2.datalist}" var="user" rowKeyVar="rkv">
       <h:column>
       <f:facet name="header">
       <h:outputText value="ID" />
       </f:facet>
       <h:outputText value="#{user.id}" />
       <rich:contextMenu attached="true" id="menu001" event="oncontextmenu" submitMode="ajax">
       <rich:menuItem ajaxSingle="false" reRender="table01" value="Menu001#{TestBean2.selectRow1}">
       <a4j:actionparam name="rowid1" assignTo="#{TestBean2.selectRow1}" value="#{rkv}"/>
       </rich:menuItem>
       </rich:contextMenu>
       </h:column>
       <h:column>
       <f:facet name="header">
       <h:outputText value="NAME" />
       </f:facet>
       <h:outputText value="#{user.name}">
       <rich:contextMenu attached="true" id="menu002" event="oncontextmenu" submitMode="ajax">
       <rich:menuItem ajaxSingle="false" reRender="table01" value="Menu001#{TestBean2.selectRow1}">
       <a4j:actionparam name="rowid1" assignTo="#{TestBean2.selectRow1}" value="#{rkv}"/>
       </rich:menuItem>
       </rich:contextMenu>
       </h:outputText>
       </h:column>
       </rich:dataTable>
       <h:inputText id="Text1" value="#{TestBean2.text}">
       <rich:contextMenu attached="true" id="menu003" event="oncontextmenu" submitMode="ajax">
       <rich:menuItem ajaxSingle="false" reRender="table01" value="Menu001#{TestBean2.selectRow1}">
       <a4j:actionparam name="rowid2" assignTo="#{TestBean2.selectRow1}" value="-1"/>
       </rich:menuItem>
       </rich:contextMenu>
       </h:inputText>