Thursday, October 23, 2014

ADF BC View Object SQL Query Customization with MDS

This post is based on my previous article about MDS Seeded Customization - MDS Seeded Customization Approach with Empty External Project. Today I will focus on explaining how to customise SQL query for read-only VO. This is not so obvious as it sounds. However, it is doable - I will explain how.

Sample application - MDSCustomizationsApp_v2.zip contains both main and customisation projects. Main project implements read-only VO for Jobs data, it doesn't include Job Title attribute:


This is how SQL query looks for such VO in the wizard:


We should take a look into the source code, SQL query is defined by SQLQuery tag. Tag doesn't have ID, this would disable tag customisation using JDEV MDS wizards:


No matter there is no ID set, we still could customise it - I will show you how. Here is the example of SQL query customisation stored in MDS customisation file. Firstly you should remove SQL query completely from VO and then add it again (this will create two entries in MDS customisation file). Once SQL query is written to the MDS customisation file, we can change it as we would like to - Job Title attribute is added to the SQL statement:


We need to add separately VO attribute for Job Title, this can be done through JDEV MDS customisation wizard. Make sure to set IsSelected=true property, otherwise attribute will not be set from the query:


You should drag and drop Job Title attribute from Data Control into the fragment, this will generate binding entry in the page definition file:


UI component for Job Title will be generated as ADF Faces output text:


You should notice on runtime customised SQL statement executed, this statement would include Job Title added through MDS customisation:


Job Title value is fetched and displayed on UI:

Saturday, October 18, 2014

Video and Slides - Data Caching Strategies for Oracle Mobile Application Framework

I have recorded a video tutorial, based on my OOW'14 session - Data Caching Strategies for Oracle Mobile Application Framework. ADF developers who could not attend OOW'14 in San Francisco, this is for you !

Here you can view the slides:

Watch the first part of the tutorial:


Watch the second part of the tutorial:


Described solution is based on the sample application from the blog post - Transactional Data Caching for ADF Mobile MAF Application.

Sunday, October 12, 2014

Workaround for ADF 12c Choice List Blank Selection Issue

I would like to share a workaround for Choice List component in ADF 12c. There is specific issue, related to blank selection - as soon as user selects blank selection in the choice list, it starts to invoke value change listener for that list, each time when any other element is selected in the table. This is quite annoying and could lead to unexpected results, especially if you depend on logic implemented in value change listener.

Workaround is implemented in the sample application - ADFChoiceList12cApp.zip. We should take a look first, how it works without workaround applied. Imagine you have a table and one of the columns implements a choice list. Go and select a blank selection for a couple of rows:


Navigate between rows, do couple of clicks - you should notice in the log information about value change listener invoked. This is quite strange, it should not call value change listener each time, just only first time after selection was changed in the list:


Choice list UI component is set with AutoSubmit=true and assigned with value change listener method:


Choice list is configured with blank item selection in ADF BC:


To apply workaround, go and uncheck blank item selection in ADF BC, make sure checkbox for 'Include No Selection Item' is unchecked:


On UI side, provide any value for UnselectedLabel property of the choice list component, this will generate property in the source (alternatively you could just type it manually directly in the source):


Make sure UnselectedLabel property is set to be blank, this will generate blank item on the runtime (it works much better than the one enabled from ADF BC):


User could navigate through the table, there will be no value change listener triggered anymore (besides one time, when value was actually changed):


Exciting as usual - new features and new bugs :)

Wednesday, October 8, 2014

New Alta UI for ADF UI Shell Application

I have applied new Alta UI for customised ADF UI Shell application. Customised version of ADF UI Shell is taken from my previous blog post - ADF UI Shell Usability Improvement - Tab Contextual Menu. Old application with new Alta UI looks fresh and clean. Runtime performance is improved - ADF transfers less content to the browser, this makes application load and run faster.

Here you can download my sample application with Alta UI applied to ADF UI Shell - MultiTaskFlowApp_v12c.zip.

All three ADF UI Shell tabs are opened and Master-Detail data is displayed in this example:


New style is applied for LOV component and buttons, making all buttons and controls more visible and natural:


Customized ADF UI Shell supports tab menu - user can close current tab or other tabs:


There was a change in 12c related to the tab menu, we need to set align ID property differently. You can see this change in ADF UI Shell template file - Java Script function gets tab ID to align directly from component client ID property:


Alta UI is applied simply by changing a skin name in trinidad file:


This hidden gem was packaged with current JDEV 12.1.3 release, you don't need to download anything extra.

Monday, October 6, 2014

New ADF Alta UI for ADF UI Shell

New skin for ADF in 12c looks great, I have applied it for one of my sample application with ADF UI Shell and it works smoothly. Check Oracle documentation how to apply Alta UI, really easy.

ADF UI Shell with Alta UI - clean and light:


Friday, October 3, 2014

REST Support for ADF BC in 12c

Frank Nimphius have announced REST support for ADF BC feature on OOW today. Probably this functionality will be available in the next JDeveloper 12c update release.

Once REST will be enabled for Application Module, new XML definition file and project will be created. Here you can see how new wizard will look like for REST definition on top of ADF BC:

Saturday, September 27, 2014

Suppressing ADF LOV Like Operator Filtering

ADF LOV component provides filtering option with STARTSWITH operation. This is used to check if similar value exists in the LOV, if such value exists - LOV popup is opened with all the suggested values. If user types 10 and there are 100, 1000 in the LOV, instead of accepting value 10 - LOV popup will be opened and all three values 10, 100, 1000 will be displayed. While this is useful, there is no option to turn off such functionality. My post describes a solution, that can be used to disable suggested LOV filtering.

Here you can see, how it works by default. User types 10, there is 100 in the LOV. LOV popup is opened with both suggested values. This can be annoying for advanced user, who already know the code and they don't need to use LOV popup to select it:


We can check generated SQL statement. Original LOV SQL was updated with LIKE and this was applied for bind variable value. This is how suggested LOV values are retrieved:


LIKE is applied for DepartmentID (LOV key), even we have set it explicitly in the LOV View Criteria to use EQUALS operator:


The solution is to override buildViewCriteriaClauses method in VO Impl class. ADF executes additional View Criteria to retrieve suggested LOV values, this criteria name is "__lov__filterlist_vcr___". We can intercept this View Criteria and replace all STARTSWITH operators with EQUALS:


With this fix applied, user could type 10 and there is no LOV popup opened anymore with suggested values:


Same SQL as before is generated, but LIKE is changed to =, this is the result of our fix:


New LOV value can be successfully saved to the DB:


Download  - ADFTableApp.zip.