Max Selection

Cancel Delete Submit
(null)
1701
1721
1881
1901
1921
1941
1961
1981
2001
2021
Next
Add Row

Instructions

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

  1. Give the tabular form a static ID. I called this one max2-tabular.
  2. Figure out the name attribute of the check box. This is typically f01, but its worth double checking.
  3. 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
  4. True Action: Alert - just to give the user feedback that they can't select more than two rows.
  5. True Action: Execute JavaScript code
    Code:
    
    event.stopPropagation();
    event.preventDefault();
    
    
  6. 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;
    }
    
    
  7. 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.