ADF Faces binding mystery…

Posted: July 1, 2011 in ADF, ADFBC, HowTo, Oracle, resources, Tips, WebProgramming

Source: https://sites.google.com/site/joeztechland/how-to–in-adf

ADF BC (Model)

ADF Faces (UI)
Bindings:
– DataProvider code example: here

VOs: Single, Shared VO Instance or Multiple?

Page Behavior:
– Prevent initial page render: adfFacesInitialContext Render Issues: here and here

Passing Data as Parameters (how to get data from point A to point B)
1. Data Bindings
– Value is set in bindings tab via NDValue property: This value can be EL and reference backing bean methods (that return a value), scopes (pageFlowScope, requestScope)
— this makes the value available to the resource that it is bound to and whose param has the NDValue. T

2. Task Flows
– URL Params: Capture in Task Flow properties. Move to a scope: ex: pageFlowScope.varname (tf param is copied to destination)
– Method Calls:
Created w/ TF Method Call: Method name entered manaully into Method call or through D&D onto TF method Call.
Params set in Property Window for Method
Can use return value for Navigation or not
— Create method call in TF and then associate method with it and then its params
– Method call via D&D from Data Control onto TF:
Params set in PageDef

3. SetCurrentRowWithKey (or KeyValue)
– With Command Link:
Set row – in bindings row.RowKeyStr (rowkey=row.rowKeyStr)
And link sends action for navigation
Command link action listener calls rowkey.execute – passes current row and navigate to destination and executes query from rowkey.execute

4. Page Params
– Add Params to Pagedef. Give Params a source (value = ex: pageFlowScope.xxx)
– then , can use params w/ service methods
Method: param1 NVDValue = bindings.paramname (note: bindings not pageFlowScope)

5. SetAction Listener to store values: main way to copy values using from: and to:

Use setCurrentRowWithKey/Value (video)
– use setCurrent to auto fire findbykey() – on entry to new page – keeps the new page current withthe current row
– can fire action so can be used (typically IS used ) for navigation
– task flow with search and edit forms and flows
– table in edit – add setcurr call. set its text value to column EL value and delete that value
– in bindings, setcurrr rowKey NDValue to value from column (key col)
— If key value is a string and can be viewed as normal data, use …WithKeyValue
— If key is obtained by getKey() on a VO , then it is sthe serialized string version of key and use …WithKey

Use ExecuteWithParams

Expose ADFbc as Web Service

Expose Web Service as Data Control

Query Component:
– Read only fields in query comp: open ER#10431603
– Capture internal components events/reference: ER or not possible
– Auto suggest on internal fields: ER#9797027
– Popup content headers not sizing correctly: Fixed in 11.1.1.4
– How to tell view criteria used by query comp: here
– Save Queries across sessions: here

Train Component:
– Validating train flow: here

Exception Handling:
– multiple callbacks to DCErrorHandlerImpl http://forums.oracle.com/forums/thread.jspa?threadID=1805073
– how to show multiple messages for a single exception http://forums.oracle.com/forums/thread.jspa?threadID=1805074
– how to configure logging for Utils buildFacesMessage http://forums.oracle.com/forums/thread.jspa?threadID=1805075
– HTML tags returned from DCErrorMessage.getHTMLText() http://forums.oracle.com/forums/thread.jspa?threadID=1805076
– DCErrorHandlerImpl sub-class super(true) or super(false)at http://forums.oracle.com/forums/thread.jspa?threadID=1805078
– DCErrorHandlerImpl.processMessage() method http://forums.oracle.com/forums/thread.jspa?threadID=1807859

and more
– the phase when exceptions are translated to JSF FacesMessage objects http://forums.oracle.com/forums/thread.jspa?threadID=2134598
– an EL expression that evaluates the type of exception http://forums.oracle.com/forums/thread.jspa?threadID=2151981
– abstract method handleException() cannot be accessed directly http://forums.oracle.com/forums/thread.jspa?threadID=2151982
– how to designate custom code as an exception handler http://forums.oracle.com/forums/thread.jspa?threadID=2151983
– ExceptionHandler implementation and activity marked as “Exception
– Handler” http://forums.oracle.com/forums/thread.jspa?threadID=2151984

Tips and Tricks:
LOVs:
Returning non key value: query lov col, as “code” make attribute a key attribute. In LOV usage on VO, return code into the desired text field

ViewCriteria
Can have VC criteria = literal with no value if bind vars will not be used.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s