2011-08-22 28 views
1

我的问题是我无法使用spring webflow显示弹出窗口。我有一个屏幕A,其中基于特定标志I想单击一个命令按钮(primefaces或Spring faces)来显示弹出窗口B.popup =“true”不适用于Spring Webflow 2.3.0 for JSF 2.0环境

我尝试下面的事情

我的网络流量看起来像

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

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

看来popup="true"不工作。

请帮忙。

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

回答

1

在SWF 2.3.0中似乎popup="true"尚未支持(还?)。根据该SWF文件http://static.springsource.org/spring-webflow/docs/2.3.x/reference/html/ch13.html

还要注意的是,春节Faces组件库,它提供了Ajax和客户端验证功能只用于JSF 1.2环境,将不能升级到JSF 2.0。鼓励应用程序使用第三方JSF 2组件库,例如PrimeFaces和RichFaces。例如Spring Web Flow发行版中的swf-booking-faces示例是使用JSF 2和PrimeFaces组件构建的。

由于SWF弹出式窗口是基于Ajax的,我猜这不适用于JSF2。

另一种方法是使用rich:popupPanel modal="true"或类似的PrimeFaces,但截至目前我看不到如何从JSF1.2顺利/快速转换popup="true"到JSF2中的某些东西。

编辑:

为了使工作弹簧面临的Ajax特性(包括popup="true")在JSF2,做了如下修改流处理器适配器配置:

<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> 

,我有SWF后做弹出窗口和其他组件(sf命令按钮,链接等)工作。 这不是对JSF2进行配置的“官方”解决方案或建议,因此使用它需要您自担风险。

相关问题