Tuesday, November 29, 2011

Event handling for single record in ADF Table.

Scenario: The scenario is, that in the ADF table, when there is a single record, then it comes auto selected and no click event happens there after on the table row.

Solution approach: To use adf component to specifically handle the row selection event over the auto selected row.

Solution:
Add a client listener to the adf table tag by dragging and dropping the clientListener component from the Operations in the Component Palette. Add the method name (of the javascript method which will call the popup in turn). Also give the event name as click. After this add the below code snippet to call the popup defined on the jspx page.

<af:resource type="javascript">
        function showPopup()
       {
          var popupId = "p1";
          var popup = AdfPage.PAGE.findComponentByAbsoluteId(popupId);
          popup.show();
        }
</af:resource>

Also, this solution could be used to call the server listner, by calling the javascript method using the clientListener as described above. then use the AdfCustomEvent.queue() method to call the serverListener (again a component from the Operations in the Component Palette), which in turn declares the managed bean method that needs to be called.

No comments:

Post a Comment