可以将ADF Bounded Task Flow运行为Dialog,而并修改Bounded Task Flow的配置,保留了Bounded Task Flow的重用性。
1,创建Unbounded Task Flow,并创建以处两个Activity和control flow:
2,创建Home页面,其中只加了一个Command Button。确保userWindow为true。
- <af:commandButton text="Call Popup" id="cb1" action="callTF"
- useWindow="true" windowEmbedStyle="inlineDocument"
- windowModalityType="applicationModal"
- windowHeight="200" windowWidth="200"/>
3,在Unbounded Task Flow中,选中Task Flow Call Activity,右键‘Go to Properties‘,在Behaviour下,修改Run As Dialog为true。
- <task-flow-call id="taskFlowCall1">
- <task-flow-reference>
- <document>/WEB-INF/task-flow-definition.xml</document>
- <id>task-flow-definition</id>
- </task-flow-reference>
- <run-as-dialog>
- <display-type id="__6">
- <inline-popup/>
- </display-type>
- </run-as-dialog>
- </task-flow-call>
4,创建Bounded Task Flow,其中只有一个JSPX页面
- <?xml version='1.0' encoding='UTF-8'?>
- <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
- xmlns:f="http://java.sun.com/jsf/core"
- xmlns:h="http://java.sun.com/jsf/html"
- xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
- <jsp:directive.page contentType="text/html;charset=UTF-8"/>
- <f:view>
- <af:document id="d1">
- <af:form id="f1">
- <af:outputFormatted value="Hello, this is dialogue 1!" id="of1"/>
- </af:form>
- </af:document>
- </f:view>
- </jsp:root>
5,运行
Home页面,点击Call Popup按钮
在屏幕居中位置弹出对话框