This tabular form prevents you from selecting more than 2 rows in the tabular form - as described here: https://forums.oracle.com/forums/thread.jspa?threadID=2524295&tstart=0
- Give the tabular form a static ID. I called this one max2-tabular.
- Figure out the name attribute of the check box. This is typically f01, but its worth double checking.
- Create a new dynamic action:
Event: Change
Selection Type: jQuery selector
jQuery Selector: #max2-tabular input[name="f01"]
Condition: Javascript Expression
Value: $('#max2-tabular input[name="f01"]:checked').size() > 2
- True Action: Alert - just to give the user feedback that they can't select more than two rows.
- True Action: Execute JavaScript code
Code:
event.stopPropagation();
event.preventDefault();
- Hide the check all checkbox by adding some css to the page. If you inspect the check-all checkbox, you can see it has an id of check-all-rows. So add the following css to the page attribute inline, to the css section:
#max2-tabular #check-all-rows {
visibility: hidden;
}
- It is important to update the dynamic action and specify the Event Scope as Dynamic, so that and additional rows that are added are still affected.