這裏是解決方案:
我有兩個頁面:page1.jspx和page2.jspx。我已經定義在ADFC-config.xml中控制流情況:
<?xml version="1.0" encoding="windows-1252" ?>
<adfc-config xmlns="http://xmlns.oracle.com/adf/controller" version="1.2">
<view id="page1">
<page>/page1.jspx</page>
</view>
<view id="page2">
<page>/page2.jspx</page>
</view>
<control-flow-rule id="__1">
<from-activity-id>page1</from-activity-id>
<control-flow-case id="__2">
<from-outcome>navigate</from-outcome>
<to-activity-id>page2</to-activity-id>
</control-flow-case>
</control-flow-rule>
</adfc-config>
因此,通過action="navigate"
我會從一個頁面導航到2頁1
現在page1.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:af="http://xmlns.oracle.com/adf/faces/rich">
<jsp:directive.page contentType="text/html;charset=UTF-8"/>
<f:view>
<af:document title="Page 1" id="d1">
<af:form id="f1">
<af:panelStretchLayout id="psl1">
<f:facet name="center">
<af:commandLink action="navigate" id="cl1">
Navigate
</af:commandLink>
</f:facet>
</af:panelStretchLayout>
<af:resource type="javascript">
var registerDisableBackButton = function() {
disableBackButton();
window.onload = disableBackButton();
window.onpageshow = function (event) {
if (event.persisted) {
disableBackButton()
}
}
window.onunload = function() {
void (0);
}
}
var disableBackButton = function() {
window.history.forward();
}
var onLoadEvent = function(event) {
registerDisableBackButton();
}
</af:resource>
</af:form>
<af:clientListener method="onLoadEvent" type="load"/>
</af:document>
</f:view>
</jsp:root>
導航,如果你點擊你將再次被重定向到第2頁。
希望這將幫助後退按鈕page2.jspx後。
簡答題,否:https://forums.oracle.com/forums/thread.jspa?threadID=1104731。雖然在討論中有一些很好的建議。 – vcsjones 2012-04-18 13:46:29
我唯一能想到的就是打開一個新的標籤頁/窗口,但這可能會更麻煩,而不是值得。 – Travesty3 2012-04-18 13:53:26
@vcsjones是的,我讀過那個頁面(以及所有其他人放在Google的前4或5個結果頁面),但我無法使用動態區域模式修改我的應用程序,原因很多。 – Baduel 2012-04-18 14:00:34