12 June, 2012

Genius ADF Buttons

I will present some genius ADF buttons that doing specific actions using Javascript

Print Page
I use the following button to print page content using window.print() method in Javascript.

 <af:commandButton text="Print Page" id="print_cb">  
     <af:clientListener type="click" method="window.print"/>  

Note you can use Show Printable Page Behavior operation to do the same purpose

<af:commandButton text="Print Page" id="print_cb">  

Open Website
I use the following button for opening a website in new window.

  <af:commandButton text="Open Dive in Oracle" id="open_cb">  
     <af:clientListener type="click"   
        method="window.open('http://www.mahmoudoracle.blogspot.com', '_blank')"/>  

Note you can use Go button for the same operation.

 <af:goButton text="Open Dive in Oracle (Go)" id="gb1" targetFrame="_blank"  

Close Window
I use the following button to close browser window

 <af:commandButton text="Close Page" id="close_cb">  
      <af:clientListener type="action" method="window.close"/>  


1 comment:

  1. I recently came across your blog and have been reading along. I thought I would leave my first comment. I don't know what to say except that I have enjoyed reading. Nice blog. I will keep visiting this blog very often.


    Diverticulitis Treatment Diverticulitis Diet


ADF : Scope Variables

Oracle ADF uses many variables and each variable has a scope. There are five scopes in ADF (Application, Request, Session, View and PageFl...