Andrejus Baranovski

Subscribe to Andrejus Baranovski feed
Blog about Oracle technology
Updated: 2 hours 17 min ago

Video - Live Webinar - Master Class - ADF Bindings Explained

Thu, 2016-12-08 09:47
Posting 2 hours long video recording for yesterday webinar - Master Class - ADF Bindings Explained. Thanks to everyone for attending. It was large crowd, nearly 100 attendees live. I enjoyed answering to all of your questions, hopefully this will be useful in your daily work.


Webinar topics:

1. ADF Bindings overview. Why ADF Bindings are required and how they are useful
2. Drill down into ADF Bindings. Explanation how binding object is executed from UI fragment down to Page Definition
3. ADF Binding types explanation. Information about different bindings generated, when using JDeveloper wizards. What happens with ADF Bindings, when using LOV, table, ADF Query, Task Flow wizards.
4. Declarative ADF binding access with expressions
5. Programmatic ADF binding access from managed beans
6. ADF binding sharing and access from ADF Task Flows. How to create binding layer for Task Flow method call or router activities.
7. Best practices for ADF Bindings
8. Your questions

Download webinar ADF 12c app from GitHub - ADFAltaApp

Simple CRUD Implementation with Oracle JET - Part III

Mon, 2016-12-05 12:09
This is third and last part in JET CRUD series. I already had a post about JET CRUD few months ago - Very Practical CRUD with JET and ADF BC - POST and DELETE Methods. But current approach is more simple and better structured. I will go through CREATE, UPDATE and DELETE operations.

You can download or view source code (JET app and ADF BC REST app) directly in GitHub  repository - jetcrud.

CREATE

We need to initalize new model when creating new row, this is done in addCustomer.js - empty model is initialized. Model is initialized from common module definition - customController (read more about it in my previous post - Better Oracle JET Code Structuring with Your Own Modules - Part II):


Important trick which will save lines of code - you can reference model attributes directly, no need to list all of them in advance. Data bind form component to JET model variable:


Each input could point to the attribute, this is UI will get/set value to View Model:


New model must be posted through JET model API create operation. Here we can convert model to JSON and use it as parameter for create:


This is how it looks on UI - form with new customer data. Press Save button:


Behind the scenes REST POST method will be executed and data will be posted to the backend, where it will be processed and inserted into DB:


New row is saved and visible in the results table:


UPDATE

Edit form implementation is very similar to create, actually it can be even combined into one. The only difference is how you initialize current row for editing (check - Oracle JET CRUD - Search and Edit Form - Part I). And how you save the changes - must use different method from Oracle JET model API - save. The rest is very similar to create operation handling:


Edit form UI - it renders different set of fields:


Behind the scenes it executes REST PATCH method, which will update only changed attributes:


DELETE

This is the simplest operation from all three. You should get instance of row to delete. This can be done through JavaScript promise, JET would not return actual model instantly. It return promise and you get model asynchronously. Call JET model API destroy operation to remove row entry:


Row is selected and removed:


Behind the scenes it calls REST DELETE method and removes row from backend:


Read previous posts:

1. Oracle JET CRUD - Search and Edit Form - Part I
2. Better Oracle JET Code Structuring with Your Own Modules - Part II

Oracle Developer Cloud Service and ADF Build/Deployment Automation Summary

Sun, 2016-12-04 00:12
We are moving our internal development to Oracle Cloud production instance. This weekend I was going through build automation and deployment process with Oracle Developer Cloud Service. I would like to share few hints with you.

There are excellent video tutorials recorded by Shay Schmeltzer, I would not repeat here all the steps, will post only key steps in the process and few extra tips. Watch Shay's videos to get understanding how it works and how to configure Developer Cloud Service (UI was changed since then, but still all config steps are valid):

1. Using Oracle Developer Cloud Service for Git and code review with JDeveloper Applications

2. Oracle ADF Build Automation on the Oracle Developer Cloud Service

Download ADF 12.2.1.1/12.2.1.2 example configured with Ant scripts for build automation on Dev CS - ADFAltaApp.

JDeveloper/ADF version. When I run OJDeploy build in Dev CS (Developer Cloud Service), I can see in the log it prints version 12.2.1.1. This means currently Dev CS supports ADF up to 12.2.1.1:


Locally I prefer working on 12.2.1.2, since JDeveloper is more stable in 12.2.1.2. When I was trying to build code commited from 12.2.12, Dev CS complained it can't open project file. I have solved it by changing 12.2.1.2 to 12.2.1.1 in *.jws and *.jpr files (luckily my local JDeveloper 12.2.1.2 doesn't complain about it and continues to work with the application). With such changes, Dev CS is able to recognize project files and runs build process. Change in the project file:


Development process is centralized around pushing your local changes to Dev CS Git repository branch (this can be done directly from JDeveloper):


In this example, I commit my local changes into fixbugs branch, later changes can be merged into master branch through Dev CS UI:


Build. To merge changes in Dev CS into master branch, we need to register merge request. In the wizard you can specify Git repository name, target branch and review branch (the one from where we are going to get changes and apply to master branch):


You can specify approvers and later when changes are approved, they are merged to master branch.

Next step is build automation (this can invoked on demand or automatically). You can associate build process to Git branch and review past build results:


If you are building with Ant, make sure to add build.properties and build.xml files into ADF application (described in Shay's video). Here is example of build.properties file I'm using in the sample app for ADF 12.2.1.1/12.2.1.2:

Example of build.xml file to run build automation in Dev CS for ADF 12.2.1.1/12.2.1.2:

At first build process was always returning success, even I there were compilation issues left in the code on purpose. In order to force build process to return failure when it should, you need to check "Archive the artifacts" option in Post Build section of build job configuration. This will force build process to produce EAR and if this fails (because of compilation issues), it marks build process failure:


Deploy. Dev CS knows how to deploy EAR into Java Cloud Service. This can be done on demand or automatically, when build is successfully completed. Configuration is simple and straightforward, you need to provide connection details to Java Cloud Service and it works - you can deploy or redeploy:


Application is successfully deployed to Java Cloud Service and visible in EM:


Besides all this, Dev CS offers Wiki's, issue tracking and bunch of other useful features for day to day work in development. So far no complaints, good job Oracle.

Better Oracle JET Code Structuring with Your Own Modules - Part II

Thu, 2016-12-01 10:14
You can end up into long lines of JavaScript code when implementing more complex use cases in JET. This will complicate maintenance and make code hardly readable. To prevent this - plan code structure carefully and use your own modules. Structure code into different modules - to reuse common code across multiple use cases.

Check my JET/ADF BC sample available on GitHub - jetcrud. This sample implements one common module - Customer Controller. Module is responsible to define ADF BC REST service connection. It contains REST service URL, JET model definition with ID attribute and JET collection created based on JET model and assigned with fetch size. This allows not to repeat same definitions again and again in each of JET modules implementing use cases (edit, add, etc.):


Such module is created as any other JET module with define header. We can use it in any other JET module, by specifying module name in define block. For example customers.js module imports Customer Controller through define block:


Within customer.js module we access function from Customer Controller to obtain collection.

Same Customer Controller module is reused inside another module editCustomer.js. Here we are accessing function from Customer Controller to obtain model:


Such approach allows to simplify JavaScript code and render different UIs based on one module. Readonly table is based on customerController.js:


Edit form is based on same customerController.js:


Read previous post - Oracle JET CRUD - Search and Edit Form - Part I.

Red Samurai - Oracle Cloud Customer (DBaaS, JCS, DevCS)

Mon, 2016-11-28 05:55
We understand importance of Cloud services and decided to move out internal development infrastructure (ADF and JET) into Oracle Cloud. From today we are Oracle Cloud customers and users for the following services:

1. Oracle Database Cloud Service

2. Oracle Java Cloud Service

3. Oracle Developer Cloud Service

Exciting times ahead. Expect more interesting topics about Oracle Cloud and ADF/JET.

ADF 12.2.1.1 New Feature - Masonry Layout Custom Size Dashboard

Sat, 2016-11-26 13:44
ADF 12.2.1.1 and 12.2.1.2 respectively comes with improvement for Masonry Layout component. Now we can define custom sizes for tiles - 9.4.1 How to Use a masonryLayout Component. This helps to define larger tiles and organize dashboard layout in more accurate way.

I have uploaded working demo app on GitHub, you can download it directly from repository or browse through the code - ADFAltaApp. I will be using this app for ADF Bindings webinar - Live Webinar - Master Class - ADF Bindings Explained.

To access Masonry Layout dashboard with custom tile sizes, go to Employees section and open Profile tab. You should see such dashboard layout (one tile 2x4, one tile 4x2 and two tiles 2x2). All four tiles are defined with custom size:


Masonry Layout is responsive out of the box. On narrow screen tiles will be re-arranged automatically:


Custom tiles for Masonry Layout are defined through CSS. You should create custom style class and set it for Masonry Layout component. I have define custom style class - RedSamuraiDashboard:


Each tile group with custom size must be defined in CSS separately. Width and hight should be proportional. If you define 250px for size 2, this means size for 4 must be 500px:


Masonry Layout tiles are assigned with style class which defines size:


You could have ADF region inside tile, it renders perfectly well:

Oracle JET CRUD - Search and Edit Form - Part I

Sat, 2016-11-19 03:36
I'm going to post a series of articles about CRUD functionality (on top of ADF BC) implementation in JET. I already had a couple of posts about JET CRUD implementation, this new series will bring improved and simplified structure for JET code implementation.

Today I will start with explanation and example how to pass selected object ID from search screen into edit screen. I have uploaded complete sample (with ADF BC and JET) into GitHub repository. Download ready to be run code or browse it directly from GitHub repository.

There are two essential parts to understand, when you implement search/edit form.

1. How to get selected object ID

I have implemented read-only table where user could select a record and navigate to edit form. JET table is enhanced with template. Each row renders edit action link. When this link is pressed, it calls our custom editCustomer function and also it sends across a key value from selected row (EmployeeId):


Inside editCustomer function we can access key parameter value and store it into JET router (this will make it accessible from another JET module, where we navigate for editing - editCustomer):


2. How to use selected object ID for edit

Edit module contains initialize function. It gets invoked automatically, each time we navigate to edit screen. Inside this function we can can access and retrieve parameter value stored in JET router. It can be used to fetch data model for editing:


This is how it looks like. User can select a row in JET table (enabled with pagination) and click on edit action:


Edit module will be loaded and data will be fetched for editing by key passed through JET router:

Live Webinar - Master Class - ADF Bindings Explained

Tue, 2016-11-15 10:09
I will be running free online webinar on Wed, Dec 7, 2016 7:00 PM - 9:00 PM CET. Everyone who wants to learn more about ADF Bindings is welcome to join !

Registration URL: https://attendee.gotowebinar.com/register/3325820742563232258
Webinar ID: 806-309-947

Title

Master Class - ADF Bindings Explained (Andrejus Baranovskis, Oracle ACE Director)

Description

This 2 hours long webinar is targeted for ADF beginners with main goal to explain ADF bindings concept and its usage to the full potential. ADF Bindings is one of the most complex parts to learn in ADF, every ADF developer should understand how ADF bindings work. Goal is to have interactive session, participants could ask questions and get answers live. This live event is completely free - join it on December 7th at 7:00 PM CET (Central European Time) (which is respectively 12:00 PM New York and 10:00 AM San Francisco on December 7th).

In order to join live webinar, you need to complete registration form on GoToWebinar. Number of participants is limited, don't wait - register now.

Topics to be covered: 

1. ADF Bindings overview. Why ADF Bindings are required and how they are useful
2. Drill down into ADF Bindings. Explanation how binding object is executed from UI fragment down to Page Definition
3. ADF Binding types explanation. Information about different bindings generated, when using JDeveloper wizards. What happens with ADF Bindings, when using LOV, table, ADF Query, Task Flow wizards.
4. Declarative ADF binding access with expressions
5. Programmatic ADF binding access from managed beans
6. ADF binding sharing and access from ADF Task Flows. How to create binding layer for Task Flow method call or router activities.
7. Best practices for ADF Bindings
8. Your questions

ADF LOV Auto Suggest Functionality

Thu, 2016-11-10 10:34
ADF Faces LOV component can be easily enabled with auto suggest functionality. This is really powerful feature and should save time for user to search for required list values.

Auto suggest can be configured to be invoked only when certain number of characters is entered. I have configured Job ID list to trigger auto suggest, when two or more characters are entered. No auto suggest with single character:


Two or more characters entered - auto suggest displays filtered LOV values. What is nice about it - it automatically shows all these attributes included into LOV list:


In the background ADF BC executes SQL with bind variable from auto suggest:


LOV is defined on attribute in standard way, nothing special here:


To enable auto suggest behaviour, enough to drag and drop ADF af:autoSuggestBehavior tag into ADF Faces LOV component. Point suggestItems property to LOV binding suggestItems expression. Number of characters when to start auto suggest search is configure through minChars property:


Download sample application - ADFLovAutoSuggestApp.zip

Oracle JET Composite Component and ADF BC REST

Thu, 2016-11-03 11:28
I decided to implement sample app for JET composite component. This is powerful thing, it allows to build pretty much any UIs with HTML - package as components and reuse in the apps. Not only UI - JET composite component gets data as any other standard JET component. This allows to build your own components for forms, tables, various widgets. It allows to simplify code complexity, you could hide frequently used code into JET components and use component with parameters only on the page.

My sample is based on example from Geertjan Wielenga blog - Minimal Oracle JET Composite Component and I show how to supply data from ADF BC REST to be displayed in JET composite component. Read more about JET composite components in JET Cookbook - Composite Components. Sample is implemented with latest JET distribution 2.2.0 (it didn't work for me with 2.1.0 - JET app was blocked, after composite component was displayed) - JETSimpleCompositeApp.zip.

Composite component from sample app renders a list of customers including last and first names:


To attach composite component to JET project, you need to copy (or just implement inside existing project) package into the project. Composite component resides in simple folder structure and is based on HTML implementation, metadata JSON file and JavaScript loader file:


HTML implementation for this sample is simple, renders two text entries (binded to properties, so we could provide dynamic values in the consumer later) with different heading. You can implement here pretty much anything supported by HTML:


Metadata JSON file contains description for properties referenced in HTML UI implementation:


JavaScript loader is a central registry where HTML implementation is mapped with metadata:


Composite component is consumed in customer module. To consume it, make sure to add required references into module define block - highlighted:


On HTML side of customer module, composite component is rendered in the loop - for each entry from the array fetched from ADF BC REST service. We provide array elements as values for composite component attributes:


Data is fetched from ADF BC REST service by executing fetch operation on top of JET collection and then processing results into observable array (each entry is displayed by composite component on the UI):

ADF Regions and Shared Data Control Bindings Use Case

Thu, 2016-10-27 10:02
While teaching ADF trainings and talking to ADF developers, often I can see people think about ADF bindings as about some mistery and try to avoid using full potential of ADF Data Control. I would like to give simple, but practical example in this post, which describes how to use ADF bindings and access these bindings across different ADF regions.

This diagram shows how sample application (BindingAccessApp.zip) is implemented:


There are two regions (task flows), both are configured with Shared Data Control (means they will share same AM instance). Employees region could change current row. From Jobs region we can access bindings updated in Employees (Email attribute in this case).

Two regions are rendered side by side. I can move to different row in Employees and press button Set Current. This will set displayed row as current:


Current row in Employees region is set through custom method:


Button in Jobs region - Show Employee displays Email value from Employees region. Such functionality can be important, when you need to implement data exchange functionality between regions. Simply rely on ADF bindings in Shared Data Control - this would work:


Main page contains both regions:


Email field value is set in Employees region, through ADF bindings:


Binding attribute for Email is defined in Page Definition and attached to Data Control:


Make sure TF is set to default Shared transaction, otherwise changes in the ADF bindings values will not be visible outside of current task flow/region:


Email attribute is referenced through the binding in Jobs region:


You must include Email attribute binding into Jobs region page definition. Its value will be automatically set to the one from Employees region:


Hopefully this will explain how powerful ADF bindings are.

Oracle JET Example - Implementing Editable Collection Table

Tue, 2016-10-18 13:09
Oracle JET allows to implement inline editable tables. User can double click row or press Enter to switch to edit mode. Use Esc to switch back to readonly mode. With F2 can toggle between editable and readonly. Check it yourself in JET cookbook Editable Collection Table to see how it works.

I have followed instructions from the cookbook and implemented editable JET table on top of ADF BC REST service. Row with key 201 is switched to edit mode:


When we exit edit mode, event is handled in JavaScript and changed row is printed to the log. Here we can collect all changed rows into array and submit to the server all at once or we can fire individual REST calls per each changed row - depends on implementation:


To handle row edit, table must be set with editMode: 'rowEdit' property:


Row template property must be defined to render different HTML elements in readonly and editable modes. This property can be initialized dinamically with different template name retrieved from function:


Based on row edit mode, function returns template name:


Readonly template renders output texts, editable template renders input texts:


Changed row data is logged by ojbeforeroweditend listener function:


Download sample application - JETEditableTableApp.zip.

JDeveloper 12.2.1.1 Bug and Workaround - Wrong Instance Name for Method Action Binding

Sat, 2016-10-15 10:34
After upgrade to JDeveloper 12.2.1.1 I have noticed issue related to Method Action binding instance name. This is not ADF 12.2.1.1 bug, but JDeveloper bug. JDeveloper sets incorrect name for Method Action binding instance name.

If you are going to create custom method in VO/AM and expose it through interface to be called in bindings layer - there will be similar error as below on runtime:


Source of this error is in the method binding definition:


Go to page definition source view and you will find instance name highlighted with warning. JDeveloper is able to recognize invalid expression, but still it generates it. ADF 12.2.1.1 runtime quality is improved, but can't say the same about JDeveloper IDE. Oracle focus is on Cloud, but still there is a lot to do to improve development tools quality:


Expression must be replaced manually to correct one (the one previous JDeveloper version used to generate) - data.DataControlName.VOInstanceName:


With correct expression for instance name, custom method is invoked correctly without error:


Download sample application - ADFOperationBindingApp.zip.

Oracle JET and ADF BC REST Security Integration Approach

Thu, 2016-10-06 10:20
I have promised to atendee of my OOW'16 session (Building Enterprise-Grade Mobile Apps with Oracle JET and Cordova [CON5731]) to post a blog about ADF BC REST security and integration with Oracle JET. This post is to demonstrate how we could reuse cookie ID generated by ADF BC REST Web session for REST requests from JET.

First thing first, here you can download source code - jet_adfbc_security.zip. This archive contains ADF BC REST application and JET source code (you need to copy it into your local JET application).

Take a look first into JET login form. This is where we collect username/password and call login function. One important detail - invalidComponentTracker, this allows to report required validation error, when user hits login button with empty username or password:


Here is the login function in JET. If there are no validation errors, it executes POST against ADF BC REST service custom method. In response we could return user info, preferences, etc. This is the only one request where we are using username/password. Key point of this request is to get JSESSIONID from ADF BC REST server, so we could use it for subsequent requests, without sending username/password again. This is similar concept to ADF Faces, it is also using JSESSIONID to track web user and HTTP session on the server. If login is successful, we are reading custom parameter from response with JSESSIONID value. JET router is updated to render different menu structure after login:


Custom response parameter is populated on the server in Filter class. On authentication request this parameter is set once:


ADF BC REST application is enabled with standard ADF Security:


This is how it works. Login form in JET:


Login is successful with redsam/welcome1 user. Two tabs are rendered - Home and People. Home tab displays chart with employees:


We should dive deeper and check what happens with REST communication. POST method in response gets custom parameter with JSESSIONID value, if authentication is successful based on Authorization header parameter:


Chart data in Home tab is retrieved through GET method and this method is not using Authorization header anymore. It calls REST method using JSESSIONID in URL. JESSIONID must be before URL parameters:


Home tab is implemented with JET chart component:


JSESSIONID is included into REST call URL through getURL method, which is referenced by JET collection:


People tab implements table with pagination support:


Same approach is applied in People tab. JSESSIONID is appended into URL through getURL method, before URL parameters:


People UI with paginated table in JET:


REST request URL contains JSESSIONID:

BPM Worklist API 12.2.1.1 and Custom ADF 12.2.1.1 Application

Tue, 2016-09-27 12:57
I have updated my sample app with BPM API usage in ADF application to 12.2.1.1. Originally this was developed with ADF/BPM 11.1.1.7 - Dynamic ADF Buttons Solution for Oracle BPM Outcomes. There are several changes in BPM libraries usage. I will describe it all step by step.

Download sample application - adfbpm12211.zip. This archive contains both BPM and ADF app. BPM process implements two roles - request holiday and approve holiday:


Main goal of such use case - we don't want to use out of the box Oracle Worklist app, but prefer to develop our own business logic and manage BPM process from custom ADF app through BPM API. It is important to initialize Workflow context one time during login, this can be heavy operation and we should not call it each time when BPM API is invoked:


I'm using authenticateOnBehalfOf method. This allows to use admin user as a proxy for business user connection. Once Workflow context is established, we can get BPM context to use it for BPM API calls, all this is done during login into ADF app:


Assigned tasks are fetched through Workflow context:


We can initiate new task through BPM API in our custom ADF app:


There is a way to generate buttons to control task actions dynamically. Buttons can be generated on top of task outcomes list obtained from BPM API:


Task action can be executed with payload info, this allows to pass correct info to the next step in the process:


Let's see how it works. User can start new BPM task from ADF:


When task is submitted to approval, manager is assigned task to approve or reject holiday request. Buttons are generated dynamically based on task outcomes:


To double check executed flow from BPM API in ADF we can review it in EM control:


ADF application must import BPM API JARs to be able to compile Java code. In ADF 12.2.1.1 it is enough to import BPM Services JARs:


There is no need to package these JARs into application archive, these should be referenced for compile time only:

Slides Available - End-to-End Cloud: Oracle Java Cloud, Oracle Mobile Cloud Service, Oracle MAF, and Oracle JET [CON2388]

Mon, 2016-09-19 17:03
I have completed my OOW'16 session [CON2388] today. For those of you who could not attend it, check slides online (I will post sample code later, read more about the session here):


Dynamic Flying Dashboard UI in ADF 12.2.1.1

Fri, 2016-09-16 23:43
I took my old sample application implemented in 2010 - Dynamic Flying Dashboard UI Shell and upgraded it to recent ADF 12.2.1.1. It runs pretty well, without major changes - this proves ADF migration between releases can be smooth (well, not always in practice - but let's be positive).

I have recorded gif to give you an impression how it runs and how UI switch works in ADF UI panel dashboard component:


There are four blocks in the dashboard, user can remove each of the blocks or select predefined group of blocks:


It is possible to maximize selected block to occupy more space:


Some of the blocks can be minimized and only a subset of blocks will be displayed:


Such functionality is implemented with out of the box ADF UI components - af:panelStretchLayout, af:panelSplitter and af:panelDashboard. Depending on selection, block is minimized, displayed or maximized:


Toolbar items (minimize, maximize and restore) are implemented in the separate JSF container and reused in the main page:


Hopefully you will find such use case interesting and will have a chance to apply in the project. Download sample application - ADFIntegrationDashboard_v2.zip.

Workaround for ADF 12.2.1.1 Match Media Behavior Tag

Thu, 2016-09-08 15:00
If you run ADF 12.2.1.1 application with adaptive UI implemented by af:matchMediaBehavior tag (ADF 12.2.1 Responsive UI Improvements), most likely you will face Null Pointer Exception in Match Media Behavior tag class. Apparently af:matchMediaBehavior tag expects default value to be set on UI component. If default value is not set explicitly, it fails to read it and generates exception (this was not the case in ADF 12.2.1).

This example contains three af:matchMediaBehavior tags, properties orientation and styleClass are not set on panel spitter by default:


This leads into Null Pointer exception on runtime:


To fix this, we can set default values for orientation and styleClass explicitly. Propety styleClass can be assigned with empty value, this helps:


UI is loaded this time:


UI is resized on narrow screen - panel splitter orientation is changed:


Download application with workaround for af:matchMediaBehavior - ADFResponsiveUIApp_v2.zip.

Speaking on Oracle OOW'16 - MCS, JET, ACS, JCS and MAF

Wed, 2016-09-07 13:08
With Oracle Open World'16 around the corner, I have prepared demo use case including Mobile Cloud Service (MCS), JavaScript Extension Toolkit (JET), Application Cloud Service (ACS) and Java Cloud Service (JCS). I will describe what Oracle Cloud offers to implement end-to-end enterprise solution.

This year I will be speaking on two sessions.

- End-to-End Cloud: Oracle Java Cloud, Oracle Mobile Cloud Service, Oracle MAF, and Oracle JET [CON2388]

Monday, Sep 19, 12:30 p.m. - 1:15 p.m. | Moscone West - 2012

I will be co-presenting and talking about Oracle JET Hybrid implementation:

- Building Enterprise-Grade Mobile Apps with Oracle JET and Cordova [CON5731]

Thursday, Sep 22, 12:00 p.m. - 12:45 p.m. | Moscone West - 2016

Demo use case will be based on JET application running on Application Container Cloud and integrated with Mobile Cloud Service (MCS) REST services:


There will be JET Hybrid application listening for MCS notifications:


You will learn how to process notifications:


Display and synch data from MCS in JET Hybrid application:


Functionality to be described during [CON2388] session:

MAF:

- Integration with MCS

JCS:

- ADF BC REST development and deployment
- Security implementation

ACS:

- JET application depoyment process with Node.JS application

JET:

- JET application implementation tips & tricks
- JET oAuth security integration with MCS
- JET and REST calls
- JET and MCS notifications

MCS:

- Custom API implementation tips & tricks
- Security configuration
- MCS DB API
- MCS Notifications API
- MCS Connector API to call ADF BC REST

Generic BigDecimal Formatter in ADF 12.2.1.1

Tue, 2016-08-30 11:39
I have implemented couple of improvements for BigDecimal formatter based on ADF 12.2.1.1. Originally formatter was implemented and described in this post - Handling Format for BigDecimal Numbers in ADF BC. New improvements: option to support trailing zeros and disabling number rounding.

1. Support for trailing zeros

If you type number 3000.10, BigDecimal type attribute will keep it as 3000.10. But in database it will be saved without trailing zero as 3000.1. This would lead to "Another user has changed the row" issue, as there will be mismatch between value in DB and value in ADF BC.

Try to enter 3000.10:


Save, change any other field and try to save again. You will get error:


Double check in DB, value is saved without trailing zero. Thats the reason for the error, data mismatch:


Solution is to parse entered value into BigDecimal without trailing zeros in generic formatter class:


2. Disabling number rounding

By default when you type 2500.209 (and if only 2 digits after dot are allowed):


This will be rounded to 2500.21:


While rounding can be useful, most of the time it will be confusing. There is a way to disable rounding by removing af:convertNumber tag for UI component. Formatting still will be applied through generic formatter class:


If user enters incorrect number, instead of rounding it - formatting error message will be displayed:


Download sample application - ADFFormattingApp_12211.zip.

Pages