简体   繁体   English

对于JSF 2.0环境,在Spring Webflow 2.3.0中无法使用popup =“ true”

[英]popup=“true” not working with in Spring webflow 2.3.0 for JSF 2.0 environment

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). 我的问题是我无法使用spring webflow显示弹出窗口,我有一个屏幕A,其中基于特定标志,我想在单击命令按钮(primefaces或Spring faces)时显示弹出窗口B.

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 Xhtml看起来像

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

It seems popup="true" is not working. 似乎popup="true"无法正常工作。

Please help. 请帮忙。

SWF 2.3.0; SWF 2.3.0; Primefaces 2.2.1; Primefaces 2.2.1; JSF 2; JSF 2; Spring Security 3; 春季安全3; Spring 3.1.0M1; 春天3.1.0M1; EhCache; EhCache; Apache Tomcat 6.0; Apache Tomcat 6.0; STS 2.5.1 STS 2.5.1

It seems that popup="true" is not (yet?) supported in SWF 2.3.0. 在SWF 2.3.0中似乎还不支持popup="true" According to the SWF documentation http://static.springsource.org/spring-webflow/docs/2.3.x/reference/html/ch13.html : 根据SWF文档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. 还请注意,提供Ajax和客户端验证功能的Spring Faces组件库仅适用于JSF 1.2环境,不会升级到JSF 2.0。 Applications are encouraged to use 3rd party JSF 2 component libraries such as PrimeFaces and RichFaces. 鼓励应用程序使用第三方JSF 2组件库,例如PrimeFaces和RichFaces。 The swf-booking-faces sample in the Spring Web Flow distribution for example is built with JSF 2 and PrimeFaces components. 例如,Spring Web Flow发行版中的swf-booking-faces示例是使用JSF 2和PrimeFaces组件构建的。

Since SWF popups are Ajax based I guess that is not working for JSF2. 由于SWF弹出窗口是基于Ajax的,因此我猜这不适用于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. 另一种选择是使用rich:popupPanel modal="true"或类似PrimeFaces的方法,但是到目前为止,我还没有看到如何将popup="true"从JSF1.2平滑/快速过渡到JSF2中的方法。

EDIT: 编辑:

To enable work spring-faces Ajax features (including popup="true" ) in JSF2, do the following changes to flow handler adapter configuration: 要在JSF2中启用弹性工作Ajax功能(包括popup="true" ),请对流处理程序适配器配置进行以下更改:

<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. 完成此操作后,我可以使用SWF弹出窗口和其他组件(sf命令按钮,链接等)工作。 This is not an 'official' solution or suggestion to do configuration for JSF2, so use it at your own risk. 这不是为JSF2进行配置的“官方”解决方案或建议,因此使用此方法后果自负。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM