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




No comments: