1 2 Previous Next 16 Replies Latest reply on Apr 22, 2010 9:36 AM by Sefai Tando?an

    Clicking button on row of datatable

    Luke Twardowsky Newbie

       

      <rich:contextMenu hideDelay="100" attached="false" id="contextMenu">
      <rich:menuItem value="Item1" action="{cardBean.viewCard}">
       <a4j:actionparam assignTo="#{bean.param1}" value="{value1}"/>
      </rich:menuItem>
      </rich:contextMenu>
      
      
      <rich:panel id="panel1">
       <f:facet name="header">
       <h:outputText value="Header"/>
       </f:facet>
      
      <rich:dataTable id="list" value="#{bean.list}" var="var" onRowMouseOver="this.style.backgroundColor='#ECF4FE'" onRowMouseOut="this.style.backgroundColor=''" styleClass="dataTable" rowClasses="firstRow, secondRow">
       <a4j:support event="onRowClick" action="#{bean.mainView}" ignoreDupResponses="true"/>
      
       <f:facet name="header">
       <rich:columnGroup>
      ...
      ...
      ...
       </rich:columnGroup>
       </f:facet>
      
       <rich:column>
       <h:outputText value="first />
       </rich:column>
       <rich:column>
       <h:outputText value="second"/>
       </rich:column>
      ...
      ...
      ...
       <rich:column styleClass="col20">
       <div>
      <a4j:commandLink id="clickViewsSubmit" action="#{bean.actionCol}" type="button">
       <rich:componentControl for="contextMenu" operation="show">
       <f:param value="#{var.first}" name="value"/>
       </rich:componentControl>
       <h:graphicImage url="../images/search_trans.gif"/>
      </a4j:commandLink>
       </div>
       </rich:column>
      </rich:dataTable>
      


      I have table like this above. In the last column of dataTable I want to have button/link to show context menu by clicking on this image. But beacuse this button/link is part of row in datatable so when I'm clicking this button I'm also clicking row and action onRowClick is calling needlessly. I would like to avoid this situation. Is is possible?Any ideas?

      Thanks for all responses.

        1 2 Previous Next