Home > Article > Web Front-end > Output style of ADF page_html/css_WEB-ITnose
JDev version: 11.1.2.0.0
The printing style and email style of ADF pages are usually simpler than ordinary styles, and there are many things that do not need to be displayed when printing. content (buttons, scroll bars), the email style should be as simple as possible so that it works well in the email.
You can use the variable adfFacesContext.outputMode provided by ADF to control whether the component is displayed:
rendered="#{adfFacesContext.outputMode != "email"}"/> API corresponding to adfFacesContext.outputMode As follows, you can use it to get the page style: AdfFacesContext.getOutputMode() 1, printing style printable showPrintablePageBehavior is added to commandButton to print the content contained in the layout control panelSplitter, panelAccordion, or the root node of the page tag tree where commandButton is located. Buttons, tabs, and scrollbars will be ignored when printing. ADF page: Corresponding printing style: 2, email style emailable 1) Unable Referring to external stylesheets, the email page will definitely be different from the original page. 2) ADF will automatically convert the JSF page to adapt to Microsoft Outlook, Mozilla Thunderbird, Gmail 3) Not all components can be displayed in the email style. The following are the ones that can be converted to Mail-style components document panelHeader panelFormLayout panelGroupLayout panelList spacer showDetailHeader inputText (renders as readOnly) inputComboBoxListOfValues (renders as readOnly) inputNumberSlider (renders as readOnly) inputNumberSpinbox (r enders as readOnly ) inputRangeSlider (renders as readOnly) outputText selectOneChoice (renders as readOnly) panelLabelAndMessage image table column goLink (renders as text) commandImageLink (renders as text) commandLink (renders as text) goImageLink (renders as text) How to create an email style: Add org.apache.myfaces.trinidad to the current URL .agent.email=true Email style skin: af|table { border: 1px solid # 636661; } @agent email { af|table {border:none} } Runtime: In the Render Response phase, if the ADF Faces framework After receiving the request parameter org.apache.myfaces.trinidad.agent.email=true, the listener sets an internal identifier, and then the framework performs the following processing: 1) Remove any JavaScript from the HTML. 2) Add all CSS to the page, but only for components included on the page. 3) Remove the CSS link from the HTML. 4) Convert all relative links to absolute links. 5) Render images with absolute URLs. Add oracle.adf.view.rich.render.emailContentType=multipart/related to the URL to convert HTML to MIME (pictures can be browsed offline). The complete request parameters are: org.apache.myfaces.trinidad.agent.email=true&oracle.adf.view.rich.render.emailContentType=multipart/related ADF page: Corresponding email style: Tips: 1) Use inlineStyle to display the Email style normally while ensuring that the ordinary ADF page layout remains unchanged. 2) For the last column stretch, you need to set a reasonable width for the last column. 3) CSS problem causes af:table to have no upper border. You can set the header style of Column. 4) Set the af:table column header to the center, column content to the left, right, etc.