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"/>  


OAF :Formatting DateTime Fields

Use the following code to format DateTime feilds in OAF OAWebBean departureDateBean = webBean.findChildRecursive("DepartureDate"...