Flipkart Search

Showing posts with label adf table column. Show all posts
Showing posts with label adf table column. Show all posts

Tuesday, 30 December 2014

Merge two Columns into one column while showing data Seperately

Use case scenario:  You may need to show your two column header as well as data into a single ADF Table column. 
Please refer the below image for use case:

ADF has made this use case very simple.
You have just wrap your existing(required) Columns into a single column and its done.

Here is the required code sample:
 <af:column headerText="Emplyee Name"  id="c5" align="center">
          <af:column headerText="First Name" id="c8">
                     <af:outputText value="F_Name #{vs.index+1} " id="ot6"/>
          </af:column>
          <af:column headerText="Last Name" id="c9">
                    <af:outputText value="L_Name #{vs.index+1}" id="ot5"/>
          </af:column>
 </af:column>

Implement selectBooleanRadio in Table Column and show it selected by row selection

Here is use case scenarios:
1. A column with radio button. At a single point of time only one radio button should be shown selected in that column.
2. Selecting the radio button will select that row and vice-versa.

Point no. 1 is achieved by simply drag and drop of selectBooleanRadio component.


 <af:column headerText="Select" id="cs4" rowHeader="true" width="50">       <af:selectBooleanRadio text="" label="Label 1" group="RadioButtons"                                 id="sbr1"/> </af:column>
 Remember to add group="RadioButtons" attribute.

For point no. 2 we have to make a javaScript call.
And here is the required code in jspx or jsff.
  <af:resource type="javascript" source="/js/custom.js"/>
And in custom.js add these Lines.

function rowSelectionListener(evt) {
    var table = evt.getSource();
    var selectedRowKey;
    for (key in table.getSelectedRowKeys()) {
        table.findComponent('sbr1', key).setValue(false);
        selectedRowKey = key;
        break;
    }
    table.findComponent('sbr1', selectedRowKey).setValue(true);

Special thanks for point 2 goes to ADF Goodies.
Here is the Link

Friday, 6 April 2012

Clean Adf Table filter without Managed Bean

When you have a Adf filterable table then you may have noticed that the text inside the filter don't clear itself when you navigate to other page . It remains there. There are two ways to clear the filters as far as I know.
1. Setting One of the output text column header true
2. A button with managed bean

Adf table's column property RowHeader is set to true then this column renders as a non filterable column with a Clear All icon which clears all filters and reloads the table

1. Setting a Column which is Output Text type to RowHeader=true

2. Earlier look   RowHeader=false
3. Now with  RowHeader=true