How to Redirect Page with Dynamic Action Name
jhu Nov 24, 2010 11:04 AMI am new to Seam. I have the following section in toolButton.xhtml:
<a4j:commandLink
value="#{text}"
immediate="true"
rendered="#{enabled}"
action="#{manager[action]}"
onmouseover="this.style.cursor = 'hand';"
onmouseout="this.style.cursor = 'default';"
onclick="setCursorWait(); this.style.cursor = 'wait'; #{onclick}"
oncomplete="setCursorDefault(); this.style.cursor = 'default'; #{oncomplete}"
reRender="#{reRender}"
</a4j:commandLink>
In authorizationList.xhtml I have the following section:
<ui:include src="/widgets/toolButton.xhtml">
<ui:param name="text" value="Edit"/>
<ui:param name="image" value="resource://images/icons/common/Edit16.gif"/>
<ui:param name="manager" value="#{authorizationListManager}"/>
<ui:param name="action" value="editAuthorization"/>
<ui:param name="onclick" value="if (#{authorizationListManager.rowSelected}) { showProgress('Authorization Record', 'Retrieving information...')}"/>
<ui:param name="oncomplete" value="if (#{!authorizationListManager.rowSelected}) {showWarning('Edit Authorization', 'An Authorization Form must be selected.')}"/>
<ui:param name="reRender" value="authorizationFormDialog"/>
<ui:param name="background" value="#f7f7fa"/>
<ui:param name="enabled" value="#{person.superUser}"/>
</ui:include>
In pages.xml, I set redirect:
<page view-id="/pages/delegation/authorizationList.xhtml">
<navigation from-action="#{authorizationListManager.editAuthorization}">
<rule if-outcome="delegation">
<redirect view-id="/pages/delegation/delegation.xhtml"/>
</rule>
<rule if-outcome="exception">
<redirect view-id="/pages/delegation/exception.xhtml"/>
</rule>
</navigation>
</page>
It doesn't work.
The following doesn't work either:
<page view-id="/pages/delegation/authorizationList.xhtml">
<navigation from-action="#{authorizationListManager[editAuthorization]}">
<rule if-outcome="delegation">
<redirect view-id="/pages/delegation/delegation.xhtml"/>
</rule>
<rule if-outcome="exception">
<redirect view-id="/pages/delegation/exception.xhtml"/>
</rule>
</navigation>
</page>
How to make the redirect work in this case?
I appreciate your help.
<a4j:commandLink
value="#{text}"
immediate="true"
rendered="#{enabled}"
action="#{manager[action]}"
onmouseover="this.style.cursor = 'hand';"
onmouseout="this.style.cursor = 'default';"
onclick="setCursorWait(); this.style.cursor = 'wait'; #{onclick}"
oncomplete="setCursorDefault(); this.style.cursor = 'default'; #{oncomplete}"
reRender="#{reRender}"
</a4j:commandLink>
In authorizationList.xhtml I have the following section:
<ui:include src="/widgets/toolButton.xhtml">
<ui:param name="text" value="Edit"/>
<ui:param name="image" value="resource://images/icons/common/Edit16.gif"/>
<ui:param name="manager" value="#{authorizationListManager}"/>
<ui:param name="action" value="editAuthorization"/>
<ui:param name="onclick" value="if (#{authorizationListManager.rowSelected}) { showProgress('Authorization Record', 'Retrieving information...')}"/>
<ui:param name="oncomplete" value="if (#{!authorizationListManager.rowSelected}) {showWarning('Edit Authorization', 'An Authorization Form must be selected.')}"/>
<ui:param name="reRender" value="authorizationFormDialog"/>
<ui:param name="background" value="#f7f7fa"/>
<ui:param name="enabled" value="#{person.superUser}"/>
</ui:include>
In pages.xml, I set redirect:
<page view-id="/pages/delegation/authorizationList.xhtml">
<navigation from-action="#{authorizationListManager.editAuthorization}">
<rule if-outcome="delegation">
<redirect view-id="/pages/delegation/delegation.xhtml"/>
</rule>
<rule if-outcome="exception">
<redirect view-id="/pages/delegation/exception.xhtml"/>
</rule>
</navigation>
</page>
It doesn't work.
The following doesn't work either:
<page view-id="/pages/delegation/authorizationList.xhtml">
<navigation from-action="#{authorizationListManager[editAuthorization]}">
<rule if-outcome="delegation">
<redirect view-id="/pages/delegation/delegation.xhtml"/>
</rule>
<rule if-outcome="exception">
<redirect view-id="/pages/delegation/exception.xhtml"/>
</rule>
</navigation>
</page>
How to make the redirect work in this case?
I appreciate your help.