Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using Primefaces Dialog Framework in a flow [SWF-1704] #880

Open
spring-operator opened this issue Jun 21, 2017 · 4 comments
Open

Using Primefaces Dialog Framework in a flow [SWF-1704] #880

spring-operator opened this issue Jun 21, 2017 · 4 comments
Labels
in: core status: waiting-for-triage We need additional information before we can continue

Comments

@spring-operator
Copy link
Contributor

Omid P opened SWF-1704 and commented

due to FlowViewHandler, it is not possible to use Primefaces Dialog framework in spring webflow.
I've tested it in primefaces-showcase


Affects: 2.4.4

1 votes, 3 watchers

@spring-operator
Copy link
Contributor Author

Rossen Stoyanchev commented

Can you clarify what you mean by "due to FlowViewHandler"? In other words do you know the cause or have a fix in mind?

@spring-operator
Copy link
Contributor Author

Omid P commented

I guess, I know the cause but I don't know how to fix it. AFAIC, since flowViewHandler is responsible for handling navigation in Spring web flow, it prevents from executing org.primefaces.application.DialogNavigationHandler and org.primefaces.application.DialogViewHandler, in other words SWF does not understand JSF ConfigurableNavigationHandler and ignore faces-config navigation-handler.

technically speaking,

FlowViewHandler.java

public String getActionURL(FacesContext context, String viewId) {
		if (JsfUtils.isFlowRequest()) {
			return RequestContextHolder.getRequestContext().getFlowExecutionUrl();
		} else {
			return super.getActionURL(context, viewId);
		}
	}

should be

public String getActionURL(FacesContext context, String viewId) {
		if (JsfUtils.isFlowRequest()) {
                        if (is primefaces dialog request)
                                 org.primefaces.application.DialogViewHandler.getActionURL();
                        else
               			return RequestContextHolder.getRequestContext().getFlowExecutionUrl();
		} else {
			return super.getActionURL(context, viewId);
		}
	}

@spring-operator
Copy link
Contributor Author

Rossen Stoyanchev commented

in other words SWF does not understand JSF ConfigurableNavigationHandler

Is there a way to use JSF ConfigurableNavigationHandler rather than hard-coding a library specific API, which we'd have to invoke through reflection. Also the flowExecuectionUrl is quite specific to Web Flow (the flow URL with an execution id). I don't know what the DialogViewHandler's actionUrl looks like relative to that.

Do you have a sample app somewhere to experiment with?

@spring-operator
Copy link
Contributor Author

Omid P commented

I created a sample app https://github.com/omidp/swf-prime-bug where you can expriment on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core status: waiting-for-triage We need additional information before we can continue
Projects
None yet
Development

No branches or pull requests

1 participant