How-to hide or show components in printable pages

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

Comments:

Post a Comment:
Comments are closed for this entry.
About

A blog on Oracle JDeveloper, ADF, MAF, MCS and other mobile and web topics inspired by questions and answers posted on the OTN forums.



Frank Nimphius

Search

Archives
« September 2015
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today