0

I'm using Primefaces 4.0 in my application. Single row selection feature is implemented for the p:datatable as shown below:

     <p:dataTable id="assignmentList" var="assignment"
     value="#{shortageController.allAssignments}"
     rowKey="#{assignment.transportAssignment.id}"
     selection="#{shortageController.selectedAssignment}"
     selectionMode="single" emptyMessage="#{common['no.assignments.found.with.given.criteria']}"
     rowStyleClass="#{assignment.assignmentStyleClass}">

I want the selection feature to be disabled when a particular condition is satisfied. How to do that?Is disabledSelection attribute used in primefaces 4.0.Kindly advise.

Kukeltje
  • 12,223
  • 4
  • 24
  • 47
  • 3
    When you look into the [corresponding documentation](https://www.primefaces.org/documentation/) you see PF 4 dataTable also provides a disabledSelection attribute. – Selaron Oct 23 '19 at 07:38
  • 1
    @Selaron if there is no duplicate, why not answer it? – Jasper de Vries Oct 23 '19 at 08:55
  • But the 'sort of duplicate' states this attribute is only available for 5.0+ https://stackoverflow.com/questions/6395593/disable-row-selection-for-a-few-rows-only-primefaces – Kukeltje Oct 23 '19 at 09:01
  • 1
    @Kukeltje it's wrong. It's there since 4. – Jasper de Vries Oct 23 '19 at 09:40
  • 3
    Possible duplicate of [Disable row selection for a few rows only - Primefaces](https://stackoverflow.com/questions/6395593/disable-row-selection-for-a-few-rows-only-primefaces) – Jasper de Vries Oct 23 '19 at 09:40
  • 1
    @JasperdeVries I hadn't searched for a duplicate because I considered it more streight forward to take a look into the docs first. This Q lacks on research and own attempt so I did'nt think it's worth keeping/answering for future readers. Now that a dup was found I agree to CV. My first comment was just ment to be the friendly variant of r-t-f-m ;) – Selaron Oct 23 '19 at 10:06

0 Answers0