Skip to main content

Posts

Showing posts with the label Table

ADF 12.1.3 : Implementing Default Table Filter Values

In one of my projects I ran into a requirement where the end user needs to be presented with default values in the table filters. This sounds like it is a common requirement, which is easy to implement. However it proved to be not so common, as it is not in the documentation nor are there any Blogpost to be found that talk about this feature. In this blogpost I describe how to implement this. The Use Case Explained Users of the application would typically enter today's date in a table filter in order to get all data that is valid for today. They do this each and every time. In order to facilitate them I want to have the table filter pre-filled with today's date (at the moment of writing July 31st 2015). So whenever the page is displayed, it should display 'today' in the table filter and execute the query accordingly. The problem is to get the value in the filter without the user typing it. Lets first take a look at how the ADF Search and Filters are implemented by...

ADF 11g : How to control where a new row is inserted

On the JDeveloper forum a question was asked how to insert a new row in an ADF table after the selected row. Default behavior is insertion before the current row. In this short post I describe how to achieve this. In order to do this I create a custom method on the application module that takes the position (BEFORE or AFTER) as an argument. Based on this argument the new row is inserted at the appropriate position. public void createRow(String beforeOrAfter){ Row newRow = getJobsView1().createRow(); newRow.setNewRowState(Row.STATUS_INITIALIZED); //get instance of the above created view object ViewObjectImpl vo=getJobsView1(); // to insert row at the end of the table if (beforeOrAfter.equalsIgnoreCase("AFTER")){ vo.next(); vo.insertRow(newRow); } else { vo.insertRow(newRow); } } I publish the method, and drop it as a Button on the page. I copied the button so I have one for each option. <af:panelCollection ...

ADF 11g : SelectOneRadio in Table Layout

Today at one of my customers I was asked the question if you can use a SelectOneRadio component in table layout. I know that the first thing they should have done is try Google to find a solution. As a matter of fact they did and found this blogpost by Frank Nimphius. This however is based on ADF 10g. The part where Frank converts the InputText to a selectOneRadio isn't available in ADF 11g anymore. It can be achieved in ADF 11g very simple as well. Based on an example I will explain how to do this in ADF 11g. For this I added an extra column to the EMPLOYEES table. This column called "OutOfOffice" holds the status of the selected employee. I created ADF BC for the Employees table. When dropping this as an ADF table you will see the result as below. Not user-friendly at all. But how can we change this ? Actually it's simple. First remove the inputText field from the column. Next drop the OutOfOffice attribute from the datacontrol on the column as a selectOneRadio. I...