[seam-issues] [JBoss JIRA] (JBSEAM-4944) Seam annotated JSF converter breaks JPDL pageflow navigation
Andrea Martino (JIRA)
jira-events at lists.jboss.org
Thu May 3 06:49:17 EDT 2012
[ https://issues.jboss.org/browse/JBSEAM-4944?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Andrea Martino updated JBSEAM-4944:
-----------------------------------
Summary: Seam annotated JSF converter breaks JPDL pageflow navigation (was: Seam annotated converter breaks JPDL pageflow navigation)
Description:
When a JSF page contains a form referencing a Seam annotated JSF converter, the pageflow navigation does not work as expected.
For example, the following form
{code}
<h:form>
<h:inputText id="name" converter="trimConverter" value="#{customerSearch.name}" />
<h:commandButton value="Search" action="#{customerSearch.search}" />
</h:form>
{code}
does not work correctly inside a pageflow if the "trimConverter" is annotated as following:
{code:title=TrimConverter.java}
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;
import org.jboss.seam.annotations.faces.Converter;
import org.jboss.seam.annotations.intercept.BypassInterceptors;
@Name("trimConverter")
@BypassInterceptors
@Scope(STATELESS)
@Converter
public class TrimConverter implements javax.faces.convert.Converter, Serializable {
}
{code}
Everything works fine if the converter is annotated using @javax.faces.convert.FacesConverter as following:
{code:title=TrimConverter.java}
import javax.faces.convert.FacesConverter;
@FacesConverter("trimConverter")
public class TrimConverter implements javax.faces.convert.Converter, Serializable {
}
{code}
was:
The pageflow navigation is broken in Seam 2.3.0.Beta1 when using JSF2.0.
I defined a pageflow as following:
{code:xml|title=pageflow.jpdl.xml}
<?xml version="1.0" encoding="UTF-8"?>
<pageflow-definition name="captureorder">
<start-state>
<transition name="customersearch" to="customersearch"/>
</start-state>
<page name="customersearch" view-id="/customersearch.xhtml">
<transition name="customeroverview" to="customeroverview" />
</page>
<page name="customeroverview" view-id="/customeroverview.xhtml" />
</pageflow-definition>
{code}
The page customersearch.xhtml calls a method in the controller that returns "customeroverview" as following:
{code:xml:title=customersearch.xhtml}
<h:form>
<h:inputText id="name" value="#{customerSearch.name}" />
<h:commandButton value="Search" action="#{customerSearch.search}" />
</h:form>
{code}
The browser is never redirected to the "customeroverview" page.
Somehow the class *org.jboss.seam.jsf.SeamNavigationHandler* in method *handleNavigation* calls baseNavigationHandler (the last method) instead of Pageflow.instance().navigate (which would be correct in this case)
{code:title=org.jboss.seam.jsf.SeamNavigationHandler}
@Override
public void handleNavigation(FacesContext context, String fromAction, String outcome)
{
if ( !context.getResponseComplete() ) //workaround for a bug in MyFaces
{
if ( isOutcomeViewId(outcome) )
{
FacesManager.instance().interpolateAndRedirect(outcome);
}
else if ( Init.instance().isJbpmInstalled() && Pageflow.instance().isInProcess() && Pageflow.instance().hasTransition(outcome) )
{
Pageflow.instance().navigate(context, outcome);
}
else if ( !Pages.instance().navigate(context, fromAction, outcome) )
{
baseNavigationHandler.handleNavigation(context, fromAction, outcome);
}
}
}
{code}
The reason for this behavior, is that *Pageflow.instance().isInProcess()* returns false, even if the page with the form was reached inside a pageflow.
> Seam annotated JSF converter breaks JPDL pageflow navigation
> ------------------------------------------------------------
>
> Key: JBSEAM-4944
> URL: https://issues.jboss.org/browse/JBSEAM-4944
> Project: Seam 2
> Issue Type: Bug
> Components: JSF Integration
> Affects Versions: 2.3.0.BETA1
> Environment: JBOSS 7.1 + JSF2 + RichFaces 4.2.0.Final
> Reporter: Andrea Martino
> Labels: navigation, pageflow
>
> When a JSF page contains a form referencing a Seam annotated JSF converter, the pageflow navigation does not work as expected.
> For example, the following form
> {code}
> <h:form>
> <h:inputText id="name" converter="trimConverter" value="#{customerSearch.name}" />
> <h:commandButton value="Search" action="#{customerSearch.search}" />
> </h:form>
> {code}
> does not work correctly inside a pageflow if the "trimConverter" is annotated as following:
> {code:title=TrimConverter.java}
> import org.jboss.seam.annotations.Name;
> import org.jboss.seam.annotations.Scope;
> import org.jboss.seam.annotations.faces.Converter;
> import org.jboss.seam.annotations.intercept.BypassInterceptors;
> @Name("trimConverter")
> @BypassInterceptors
> @Scope(STATELESS)
> @Converter
> public class TrimConverter implements javax.faces.convert.Converter, Serializable {
> }
> {code}
> Everything works fine if the converter is annotated using @javax.faces.convert.FacesConverter as following:
> {code:title=TrimConverter.java}
> import javax.faces.convert.FacesConverter;
> @FacesConverter("trimConverter")
> public class TrimConverter implements javax.faces.convert.Converter, Serializable {
> }
> {code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the seam-issues
mailing list