Posts

Showing posts from August, 2014

Problem with multiple delete with CTRL+A in table in ADF

Scenario: When we do a CTRL+A to select all record in table in ADF and perform delete action, It will not delete all the record in table. Only some of record will get deleted and some left undelete in table. To delete the record programatically usually we write code like this: RowKeySet rowKeySet = getTableName().getSelectedRowKeys();         CollectionModel cm = (CollectionModel)getTableName().getValue();         for (Object facesTreeRowKey : rowKeySet) {             tableName.setRowKey(facesTreeRowKey);             JUCtrlHierNodeBinding rowData =                 (JUCtrlHierNodeBinding)cm.getRowData();             if (rowData != null) {      ...

Clear selection of row of table in ADF

        RowKeySet rks = empTable.getSelectedRowKeys();         if (null != rks) {           rks.clear();         } Note: empTable is the binding of table of which you want to clear the selection of row.

From Date and To Date Validation in ADF.

Image
Scenario: Many times we may have requirements that we need to perform from date and to date validation in ADF. Means From Date should not be greater than To Date or To Date should not be smaller than From Date as shown below. Solution: This can be achieved in following manner. Suppose you have a view object with two attribute namely "DateFrom" and "DateTO" on which you need to perform validation. Now drag and drop this view object on you page fragment as form and put autoSubmit="true" for both the attribute. Also you can specify the date format if you want as shown below: Now go to you taskflow and drag and drop createInsert of the corresponding view object as default activity and then drag and drop your fragment and then put a control flow. Then create one jspx page and drag and drop your taskflow as "region" on your jspx page as shown below. Then go to the binding of you jsff page and put "changeEve...

Getting value from table filter in ADF

Image
Scenario: In many case we may need to override the default filter of af:table. Here I am going to show you how you can override the default table filter and getting the entered values from table filter along with attribute names. Solution : Suppose you have a af:table which is build on EmployeesVO. Now go to you table source code in jspx/jsff and override the default queryListener and create a binding of your table to your bean as shown below:  <af:table value="#{bindings.EmployeesVO1.collectionModel}" var="row"                     rows="#{bindings.EmployeesVO1.rangeSize}"                     emptyText="#{bindings.EmployeesVO1.viewable ? 'No data to display.' : 'Access Denied.'}"                  ...