How-to hide the close icon for task flows opened in dialogs

Posted by frank.nimphius on Oracle Blogs See other posts from Oracle Blogs or by frank.nimphius
Published on Thu, 23 Dec 2010 11:35:18 +0000 Indexed on 2010/12/23 11:56 UTC
Read the original article Hit count: 318

Filed under:
|

ADF bounded task flows can be opened in an external dialog and return values to the calling application as documented in chapter 19 of Oracle Fusion Middleware Fusion Developer's Guide for Oracle Application Development Framework11g:

http://download.oracle.com/docs/cd/E15523_01/web.1111/b31974/taskflows_dialogs.htm#BABBAFJB

Setting the task flow call activity property Run as Dialog to true and the Display Type property to inline-popup opens the bounded task flow in an inline popup. To launch the dialog, a command item is used that references the control flow case to the task flow call activity

<af:commandButton text="Lookup" id="cb6"
        windowEmbedStyle="inlineDocument" useWindow="true"
        windowHeight="300" windowWidth="300"
        action="lookup" partialSubmit="true"/>

By default, the dialog that contains the task flow has a close icon defined that if pressed closes the dialog and returns to the calling page. However, no event is sent to the calling page to handle the close case.

To avoid users closing the dialog without the calling application to be notified in a return listener, the close icon shown in the opened dialog can be hidden using ADF Faces skinning.

The following skin selector hides the close icon in the dialog

af|panelWindow::close-icon-style{ display:none; }

To learn about skinning, see chapter 20 of Oracle Fusion Middleware Web User Interface Developer's Guide for Oracle Application Development Framework

http://download.oracle.com/docs/cd/E15523_01/web.1111/b31973/af_skin.htm#BAJFEFCJ

However, the skin selector that is shown above hides the close icon from all af:panelWindow usages, which may not be intended. To only hide the close icon from dialogs opened by a bounded task flow call activity, the ADF Faces component styleClass property can be used.

The af:panelWindow component shown below has a "withCloseWindow" style class property name defined. This name is referenced in the following skin selector, ensuring that the close icon is displayed

af|panelWindow.withCloseIcon::close-icon-style{ display:block; }

In summary, to hide the close icon shown for bounded task flows that are launched in inline popup dialogs, the default display behavior of the close icon of the af:panelWindow needs to be reversed. Instead to always display the close icon, the close icon is always hidden, using the first skin selector. To show the disclosed icon in other usages of the af:panelWindow component, the component is flagged with a styleClass property value as shown below

<af:popup id="p1">
  <af:panelWindow id="pw1" contentWidth="300" contentHeight="300"
                                styleClass="withCloseIcon"/>
</af:popup>

The "withCloseIcon" value is referenced in the second skin definition

af|panelWindow.withCloseIcon::close-icon-style{ display:block; }

The complete entry of the skin CSS file looks as shown below:

af|panelWindow::close-icon-style{ display:none; }
af|panelWindow.withCloseIcon::close-icon-style{ display:block; }


© Oracle Blogs or respective owner

Related posts about adfc

Related posts about ADFv