Hi,
A quick code snippet how to execute Javascript in java in Oracle ADF.
Have a nice day,
Zeeshan Baig
A quick code snippet how to execute Javascript in java in Oracle ADF.
import javax.faces.context.FacesContext; import org.apache.myfaces.trinidad.render.ExtendedRenderKitService; import org.apache.myfaces.trinidad.util.Service; ....... . FacesContext fctx = FacesContext.getCurrentInstance(); ExtendedRenderKitService erks = Service.getRenderKitService(fctx, ExtendedRenderKitService.class); String myJavaScriptCode = "alert( "+"Hello World"+");"; erks.addScript(fctx, myJavaScriptCode );
Have a nice day,
Zeeshan Baig
java.lang.NullPointerException
ReplyDeletehi,
ReplyDeleteHow to call existing JavaScript function that take an Arguments.
I want to pass some variables from the Bean to to a JavaScript function that take an arguments.
Hi,
DeleteYou need to add af:resource tag to include java script on your page then call in a similar way
af resource tag http://www.baigzeeshan.com/2011/05/how-to-load-javascript-and-css-files.html
Check this whitepaper as well http://www.oracle.com/technetwork/developer-tools/jdev/1-2011-javascript-302460.pdf
Hope it helps,
Zeeshan