2

My issue is that I am not able to show popup using spring webflow.I have a screen A , where based on a particular flag, I want to show a pop-up B on clicking of a command button(primefaces or Spring faces).

I tried following things

My web-flow looks like

<view-state id="accSummary">
    <transition on="searchRequest" to="startRequest" />
    <transition on="addRequest" to="PopUpViewState" />
</view-state>
<view-state id="PopUpViewState" popup="true"
    redirect="true">
</view-state>

Xhtml looks like

<p:commandButton value="#{label.addRequest}" action="addRequest" />

It seems popup="true" is not working.

Please help.

SWF 2.3.0; Primefaces 2.2.1; JSF 2; Spring Security 3; Spring 3.1.0M1; EhCache; Apache Tomcat 6.0; STS 2.5.1

Andrey
  • 6,526
  • 3
  • 39
  • 58
C4CodeE4Exe
  • 3,840
  • 8
  • 39
  • 46

1 Answers1

1

It seems that popup="true" is not (yet?) supported in SWF 2.3.0. According to the SWF documentation http://static.springsource.org/spring-webflow/docs/2.3.x/reference/html/ch13.html:

Also note that the Spring Faces component library, which provides Ajax and client-side validation capabilities is for JSF 1.2 environments only and will not be upgraded to JSF 2.0. Applications are encouraged to use 3rd party JSF 2 component libraries such as PrimeFaces and RichFaces. The swf-booking-faces sample in the Spring Web Flow distribution for example is built with JSF 2 and PrimeFaces components.

Since SWF popups are Ajax based I guess that is not working for JSF2.

An alternative could be using rich:popupPanel modal="true" or something similar from PrimeFaces, but as of now I do not see how to do a smooth/quick transition of popup="true" from JSF1.2 to something in JSF2.

EDIT:

To enable work spring-faces Ajax features (including popup="true") in JSF2, do the following changes to flow handler adapter configuration:

<bean class="org.springframework.js.ajax.SpringJavascriptAjaxHandler"
      id="springAjaxHandler">
</bean>
<bean class="org.springframework.faces.webflow.JsfAjaxHandler"
      id="jsfAjaxHandler">
    <constructor-arg ref="springAjaxHandler"/>
</bean>
<bean class="org.springframework.faces.webflow.JsfFlowHandlerAdapter">
    <property name="flowExecutor" ref="flowExecutor"/>
    <property name="ajaxHandler" ref="jsfAjaxHandler"/>
</bean>

After doing that I have SWF popups and other components (sf command buttons, links, etc.) working. This is not an 'official' solution or suggestion to do configuration for JSF2, so use it at your own risk.

Andrey
  • 6,526
  • 3
  • 39
  • 58