0

I have my datatable with selections and ajax event:

     <p:dataTable id="targetTable" value="#{targetController.targetList}" var="target emptyMessage="No result found with given criteria"
            widgetVar="targetTable" paginator="true" rows="20" selection="#{targetController.editTarget}" selectionMode="single" paginatorPosition="top"
           rowsPerPageTemplate="5,20,50" lazy="true"
            >
            <p:ajax event="rowSelect" listener="#{targetController.editTarget}" />

            ... columns ..
      </p:dataTable>

And I added column with button like this:

      <p:column width="100"><f:facet name="header">#{i.m['Changes history']}</f:facet>
                <p:commandButton id="showChangesHistory" value="#{i.m['Show Changes']}"  onclick="return false;" type="button" />
      </p:column>

My problem is that targetController.editTarget activates on button click.

Primefaces version: 3.3.1

Krever
  • 1,371
  • 1
  • 13
  • 32
  • would you consider using the `selectionMode` attribute on a column, instead of the whole table? like this: `` – tt_emrah Jul 21 '14 at 07:18
  • specifing `selectionMode` on a column would be enough or I need to specify `selection` also ? – Krever Jul 21 '14 at 07:23
  • `selection` can remain on the table, as it is done in this tutorial: http://www.primefaces.org/showcase/ui/data/datatable/selection.xhtml – tt_emrah Jul 21 '14 at 07:26
  • unfortunately, current behavior is that edit page launches on click on a row. Adding selectionMode=single on column transforms it to column of radiobuttons and remove current on click event, so it is not an acceptable solution. – Krever Jul 21 '14 at 07:46
  • Could you try process="@this" on the button – Jaqen H'ghar Jul 21 '14 at 07:54
  • It doesn't work. I added info about my primefaces version. – Krever Jul 21 '14 at 08:12
  • 1
    please take a look at here: http://stackoverflow.com/questions/14879193/primefaces-exclude-column-from-row-selection-in-pdatatable – tt_emrah Jul 21 '14 at 08:31

0 Answers0