2 Replies Latest reply on Aug 9, 2010 4:04 AM by Ilya Shaikovsky

    Problem firing checkbox action in extendedDataTable with contextMenu

    Blu3 Ros3 Newbie

      I have an extended dataTable that must support two different kind of action items:

       

      1. based on a single row, e.g. edit user --> using contextMenu

      2. based on multiple rows, e.g. delete users --> using checkbox

       

      Now the problem is, everytime I click on the checkbox, the contextMenu would appear. I use "event.stopPropagation()" to disable the contextMenu, e.g. prevent the event from the contextMenu to bubble up. At a glance, this seems to take care of it, e.g. I could check the checkbox without having the contextMenu displayed. However, the value in the backing bean never gets updated when I clicked on the checkbox. If I removed "onclick="event.stopPropagation()", the backing bean gets updated accordingly but the context menu appears everytime the checkbox is clicked. This is undesirable.

       

      This is the code:

       

      <rich:extendedDataTable id="userTable" value="#{userForm.userList}" var="user"

           width="800px" height="400px" rowKeyVar="rkvar" sortMode="single" selectionMode="single">

       

                <rich:column id="checkboxCol" width="30px" height="10px">
                      <h:selectBooleanCheckbox onclick="event.stopPropagation();" value="#{user.selected}" >

                             <a4j:support event="onclick" ajaxSingle="true" action="#{userForm.addUserToSelection}" />
                     </h:selectBooleanCheckbox>   

                </rich:column>

       

      </rich:extendedDataTable>