0 Replies Latest reply on Jun 5, 2008 4:27 PM by anb1

    onclick to trigger an action

    anb1

      Hello,


      I have a h:selectBooleanCheckbox at each rows of a rich:dataTable and I would like to trigger an

      action="#{toto.action}"

      when the checkbox is clicked to that I can update a list somewhere, rerender the page and have the checkbox take a new value. So far I tried this:


      <rich:column>
      <h:selectBooleanCheckbox  value="#{taskManager.selectedTaskIdList.contains(task.id)}" >
          <a4j:support event="onclick" action="#{taskManager.selectTask}" >
              <f:param name="taskId" value="#{task.id}" />
          </a4j:support>
      </h:selectBooleanCheckbox>
      </rich:column>
      



      Without success ! Another idea I had was to use @DataModel and @DataModelSelection but I could only have an s:link trigger the action and I could not have a click on the selectbooleancheckbox trigger the action, even through javascript and a hidden s:link .... (mostly because of the id generated by JSF for the table.


      Any help / suggestion would be appreciated :)