Showing posts with label ADF. Show all posts
Showing posts with label ADF. Show all posts

13 October 2015

ADF Table column filters making it case insensitive



When you drag a view from data control and drop it on a page as ADF Table and mark it filterable, filters are added on each table column.


The problem here is when you enter any text on filter and hit enter, the table is filtered, but you will notice that its a case sensitive filtering and you cannot see the results if the data contains characters in different case (small or capital letters). 

You can overcome this issue by following this:

1. select table column from structure window


2. Go to properties for the table column

3. Select Behavior tab

4. In FilterFeatures property write "caseInsensitive".


5. Hit enter, save all changes and you are done !!






12 March 2015

ADF DVT : How to get multi-selection values from a pie chart

When you want to perform some action on click and get the clicked value (one or more than one pie slice) from the pie chart, you can use ClickAction added to the page bean. Here is how you can do it:

1. Add pie chart on the page

2. Bind the pie chart with a bean UIGraph component 
[code] private UIGraph myPie;  [/code]
3. Pay close attention to dataSelection attribute in the pie properties, if you want to get value of one pie slice then select "single" or select "multiple" for more than one values from a pie (default is "none"). you page should look like the code below:
[code] [/code]
4. Add this method to your bean (myBean)
[code]public String myPieSelectionAction(){ Object value1 = null; Object value2 = null; Set selectionSet = (Set) myPie.getSelection(); if (selectionSet == null) { //Show message to select pie slice return null; } for (GraphSelection selection: selectionSet) { if (selection instanceof DataSelection) { DataSelection ds = (DataSelection) selection; value1= ds.getSeriesKey().get("myAttribute1"); value2 = ds.getSeriesKey().get("myArrribute2"); } } // Do whatever you want with collected values return null; }[/code]


06 March 2015

ADF : Use Database Sequence in Entity Object

ADF Entity Object : How to use database sequence to populate EO attribute


If there is a requirement to use database sequence to populate an attribute of  ADF entity object, do the following:

1. Select the attribute where you want to use a sequence from attributes tab of an entity object
2. In details pane below, go to default value section
3. select "expression" radio button (one of three radio buttons - Literal, Expression and SQL)
4. add following groovy expression in the box provided below radio button

(new oracle.jbo.server.SequenceImpl("YOUR_SEQUENCE_NAME", adf.object.getDBTransaction())).getSequenceNumber()

5. Make sure that the sequence is available in the database you are connecting.
6. Save details and you are done, test your EO from Application Module tester or from the page.

Use Logger in ADF application

How to use ADF Logger in ADF Application


If you want to use Logger in your ADF application, add following to any Java class in your ADF application

First declare it

ADFLogger log = ADFLogger.createADFLogger(this.getClass());

or

private static final ADFLogger log =                ADFLogger.createADFLogger(MyClassName.class);

and the use it as

log.info("Logger output");