X

The blog for hints & tips about Oracle Application Development Framework and Mobile Application Framework

  • ADFv
    August 16, 2011

How-to hide or show components in printable pages

Frank Nimphius
Master Principal Product Manager

Not all web pages
are suitable for printing, which means they contain components that either should
not print, print different or should be replaces by other content. ADF Faces
allows you to print pages using the af:showPrintableBehavior tag, which you add as a child to
a command component.

http://download.oracle.com/docs/cd/E21764_01/apirefs.1111/e12419/tagdoc/af_showPrintablePageBehavior.html

The ADF Faces context object exposes an outputMode property that you can use to
determine whether or not a page is rendered in printable mode. For example, the following EL is used on the Rendered properties of a column that
should be hidden in a table for printable pages:
<af:column sortProperty="PhoneNumber" sortable="false" 
           headerText="…" id="c5"
           rendered="#{adfFacesContext.outputMode!= 'printable'}"> <af:outputText value="…" id="ot11"/>
</af:column>

Similar, components can be added to the printable page. An af:switcher component
could be used to change complete sections of a page for the printable output.

See also: http://download.oracle.com/docs/cd/E16162_01/web.1112/e16181/ad_output.htm#CHDIDBAB

Be the first to comment

Comments ( 0 )
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.