0 Replies Latest reply on Jan 22, 2008 6:15 AM by vijay kumar

    context menu not showing in dataTable

    vijay kumar Novice

      hii everybody

      i have to use contextmenu inside a dataTable. that is if i click a row a menu must come

      i am using richfaces 3.1.3

      my code is

      <h:form id="form">
       <rich:contextMenu attached="false" id="menu1" submitMode="ajax" >
       <rich:menuItem ajaxSingle="true">
       <b>{car} {model}</b> details
       <a4j:actionparam name="det" assignTo="#{ddmenu.current}"
       value="{car} {model} details" />
       </rich:menuItem>
       <rich:menuGroup value="Actions">
       <rich:menuItem ajaxSingle="true">
       Put <b>{car} {model}</b> To Basket
       <a4j:actionparam name="bask"
       assignTo="#{ddmenu.current}" value="Put {car} {model} To Basket" />
       </rich:menuItem>
       <rich:menuItem value="Read Comments" ajaxSingle="true">
       <a4j:actionparam name="bask" assignTo="#{ddmenu.current}"
       value="Read Comments" />
       </rich:menuItem>
       <rich:menuItem ajaxSingle="true">
       Go to <b>{car}</b> site
       <a4j:actionparam name="bask"
       assignTo="#{ddmenu.current}" value="Go to {car} site" />
       </rich:menuItem>
       </rich:menuGroup>
       </rich:contextMenu>
      
       <h:panelGrid columns="2" id="panel">
       <rich:dataTable value="#{dataTableScrollerBean.addressBookList}"
       var="car" id="table">
       <rich:column>
       <f:facet name="header">
       Make
       </f:facet>
       <h:outputText value="#{car.name}" />
       </rich:column>
       <rich:column>
       <f:facet name="header">
       Model
       </f:facet>
       <h:outputText value="#{car.city}" />
       </rich:column>
       <rich:column>
       <f:facet name="header">
       Price
       </f:facet>
       <h:outputText value="#{car.phoneNo}" />
       </rich:column>
      
       <rich:componentControl event="onRowClick" for="menu1"
       operation="show" id="cc">
      
       <f:param value="#{car.name}" name="model" />
      
       <f:param value="#{car.city}" name="car" />
      
       </rich:componentControl>
      
       </rich:dataTable>
       <a4j:outputPanel ajaxRendered="true">
       <rich:panel>
       <f:facet name="header">Last Menu Action</f:facet>
       <h:outputText value="#{ddmenu.current}"></h:outputText>
       </rich:panel>
       </a4j:outputPanel>
       </h:panelGrid>
       </h:form>
      


      i had taken the code from the demo page
      but the menu is not comming.

      thanks in advance
      cheers