Thursday, August 29, 2013

why do sometimes partial trigger on a component doesn't work as expected in ADF?

with the visible property
https://forums.oracle.com/thread/1072582

Wednesday, August 28, 2013

ADF Table didn't refresh after adding new rows from procedure

After calling a stored procedure(which adds new rows to a table) , table didn't refresh on programmatic partial trigger to show up the latest rows

Even re-executed the query did not works.

Thursday, August 22, 2013

Call AM Method from VORowImpl ADF

In an ExampleVORowImpl, we can overwrite the getters of the attributes to customize the return values, Here we see the count value appended with ' ( ' , ' ) '  and the count value is returned from the AM method

import com.fdny.example.model.service.ExampleAppModuleImpl;                                                      


Friday, August 16, 2013

Pass Parameter from JavaScript to a ManagedBean ADF

http://naive-amseth.blogspot.com/2011/02/passing-parameters-from-javascript-to.html
http://adfjavacodes.blogspot.com/2013/06/adf-calling-java-code-from-javascript.html

This sample code demonstartes how to pass a parameter to a backing bean method using JavaScript
   clientListener calls the javascript method
   serverListener is used to call the managed bean method
   (*serverListener is triggered only when AutoSubmit    or the partial submit property of the component is           enabled)


backing bean method:

This is the other way of passing parameter to backing bean

 In the clientListenerMethod of JavaScript var parameter is initialized here


sample JavaScript code to trigger the button

 function buttonListenerMethod() {
         //get a button and click it
         var proxyButton = AdfPage.PAGE.findComponentByAbsoluteId('cb1');
     
         var parameter = {city:"Manhattan", country:"US"};
         //click the button
         AdfCustomEvent.queue(proxyButton ,"customButtonEvent",parameter, true);
       }

or

One more good usecase where we can use ClientListener/ServerListener

http://adf-tips-neetika.blogspot.com/2014/09/client-and-server-listener.html




Tuesday, August 13, 2013

View Object with Bind Variable as view accessor

Best practice tip:
A View Object with Bind Variable should be used with a View Criteria when used as view accessor to another object.

*This has to be done to void some weird SQLException errors with bind parameter :vctemp1  etc..

Navigate to a page in an unbounded taskflow without action ADF


Monday, August 5, 2013

Contextual Events ADF

http://www.oracle.com/technetwork/issue-archive/2011/11-may/o31adf-352561.html

Check out the sample example application ContextualEventsApp code


Usecase:
Submit Button click triggers the region-consumertaskflow1 
Last Name Input text value change triggers the region-consumertaskflow2

  • Run Producer.jspx page

                This page contains regions(consumertaskflow1 and consumertaskflow2) which are refreshed                   by some actions of the page using  contextual events


  • consumertaskflow contains a page consumer.jsff which has EventHandler methods in its bindings

Methods handleEventStringPayload and handleEventObjectPayload accepts customPayLoad parameter.
consumertaskflow1 consumertaskflow2










    JBO-25014: Another user has changed the row

    oracle.jbo.RowInconsistentException: JBO-25014: Another user has changed the row with primary key oracle.jbo.Key[8110 ].

    try by checking the Change Indicator of one of the attribute of entity object (for e.g primary key)  . There could be a trigger on update of the row if is trying to lock the row



      

    https://forums.oracle.com/thread/2309847


    if you get this error only when you commit the  transaction for the 1st time...
    We can overcome it with the help of a procedure which tries to commit some trivial data by accepting a parameter or by just closing the window after committing the data ...this makes the cursor on page load not to update the data again

    http://matt-shanto.blogspot.com/2012/09/oraclejborowinconsistentexception-jbo.html

    By doing this - if the data on the screen is updated by a PL/SQL or a trigger we don't want the user to show an error ...like 'Another user has changed the row'...if the change indicator is set to true..the framework would catch the error and hold the lock on updated data 'row'..

    https://blogs.oracle.com/emeapartnerweblogic/entry/explaining_change_indicator_property_for


    One more way:


    Oracle ADF info : to avoid this Exception Another user has changed the row with primary key oracle.jbo.Key[1 ]. override this Method in Entity Impl And write this code inside it
    public void lock() { try { super.lock(); } catch (RowInconsistentException e) { // checkInconsistentAttrs(); refresh(REFRESH_WITH_DB_ONLY_IF_UNCHANGED ); super.lock(); } }




    JSF Expression Language