Tuesday, September 25, 2012

ADF GUI : Print Navigation in showPrintablePageBehavior

One of my customer want simple print behavior. I thought it is simple with showPrintablePageBehavior component provided by ADF.

When I tried it , I noticed it will not print hyperlink and other navigation component which is correct as per definition of this component . It is common to have hyperlink in Table or Form component , But fortunately , I found the work around which made my life simple.

Develop simple page with table component and make sure where ever hyperlink is present repeat that definition of that command link with output text rendered only in print version.

i.e.

Add following tag inside command or menu item which will enable print behavior of particular page. Add extra output text corresponding for each hyperlink component. This output text will be visible only when you go to page with print behavior.

Enabling Print Behavior

<af:showPrintablePageBehavior/>

Printable behavior check condition

#{adfFacesContext.outputMode eq 'printable'}

In navigation component do the following.

<af:outputText value="#{row.columnname}" rendered="#{adfFacesContext.outputMode eq 'printable'}"/>

No comments:

Post a Comment