【问题标题】:popup="true" not working with in Spring webflow 2.3.0 for JSF 2.0 environmentpopup="true" 不适用于 JSF 2.0 环境的 Spring webflow 2.3.0
【发布时间】:2011-11-01 04:31:20
【问题描述】:

我的问题是我无法使用 spring webflow 显示弹出窗口。我有一个屏幕 A ,基于特定标志,我想在单击命令按钮(primefaces 或 Spring)时显示一个弹出窗口 B脸)。

我尝试了以下事情

我的网络流程看起来像

<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;弹簧安全 3;弹簧3.1.0M1;缓存; Apache Tomcat 6.0; STS 2.5.1

【问题讨论】:

    标签: java jsf-2 spring-webflow


    【解决方案1】:

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

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

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

    另一种方法是使用 rich:popupPanel modal="true" 或 PrimeFaces 中的类似内容,但到目前为止,我不知道如何将 popup="true" 从 JSF1.2 平滑/快速转换为 JSF2 中的内容。

    编辑:

    要在 JSF2 中启用工作 spring-faces 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>
    

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-06-17
      • 1970-01-01
      • 1970-01-01
      • 2014-02-16
      • 1970-01-01
      • 2020-09-06
      • 2012-09-13
      相关资源
      最近更新 更多