Anil's Blog is Best Viewed on GOOGLE CHROME

Saturday, May 2, 2009

To Find out the event Occur

Controller Code:

String event = pageContext.getParameter(EVENT_PARAM);

Table Events

The various table events are:
1. Navigation - user selects the Next or Previous link to navigate between different ranges of rows.
2. Sorting - user selects a beveled column heading to sort that column in ascending or descending order.
3. Insertion of a new row - user selects the Add Another Row button.
4. Recalculate column Total - user selects the Recalculate button to update the column total.
5. Detail Disclosure - user selects the Hide or Show link to collapse or expand the detail disclosure region.
6. Table Control - user selects the Action/Navigation button in the table Control bar.

You may wish to familiarize yourself with the set of UIX "hidden" fields so you can capture these events and implement custom behavior on them. The "hidden" fields are UIX attributes in the UIConstants interface.

These parameters are set only when a form submit event is induced from a table. They are:
1. SOURCE_PARAM - indicates the source of the event that is generating the current browser request.
This maps to the name attribute of the web bean. If you wish to check whether a table generated an event, you include in your code:

if (tableBean.getName().equals(pageContext.getParameter(SOURCE_PARAM)))

2. EVENT_PARAM - indicates the event generated by a web bean (a table, in this case). The possible events generated by a table are:

3. GOTO_EVENT - when 'Next' or 'Previous' navigation links are selected

4. SORT_EVENT - when a column header is selected to sort that column

5. HIDE_EVENT - when the 'Hide' link of a detail disclosure is selected

6. SHOW_EVENT - when the 'Show' link of a detail disclosure is selected

7. ADD_ROWS_EVENT - when the 'Add Another Row' button is selected

8. UPDATE_EVENT - when the total row 'Recalculate' button is selected

9. VALUE_PARAM - indicates a value that is relevant to a particular event:

10.When a detail disclosure Hide/Show is selected, the value parameter contains the row index
corresponding to the row whose Hide/Show was selected.

11. When the 'Next' or 'Previous' link of table navigation bar is selected, the value parameter contains the index of the first row of the current range. For example, when the row range 1-10 is displayed, the value is 1 and when the row range 11-20 is displayed, the value is 11.

12. SIZE_PARAM - indicates the number of rows currently displayed in the table (relevant only to the navigation event).

13. STATE_PARAM - indicates the current sort state (ascending or descending) of the column on which sorting is invoked (relevant only for the sort event). Example Usage

To check for the "Add Rows" event:

if (tableBean.getName().equals(pageContext.getParameter(SOURCE_PARAM)))
&& ADD_ROWS_EVENT.equals(pageContext.getParameter(EVENT_PARAM)))

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.