弹出JSF中的URL [英] URL in popup JSF

查看:62
本文介绍了弹出JSF中的URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下情况 首先,我需要向后端发送请求,这将返回一个URL ..我需要在 弹出窗口..我为此感到困惑

i have following scenario first i need to send request to back end,that will return a URL..i need to open the URL in the popup.. i am confused for this

我曾经尝试使用素面和网络流来打开弹出窗口,但是我不清楚每次如何使用新的url打开弹出窗口

i have tried opening popup both using the prime-faces and web flow but i don't have clearly how to open popup using new url each time

我们正在使用JSF,素面和Spring Webflow

we are using JSF, prime faces and spring webflow

推荐答案

使用JavaScript的 功能.

Use JavaScript's window.open function.

例如

<h:form>
    <h:commandButton value="Submit" action="#{bean.submit}">
        <f:ajax render="popup" />
    </h:commandButton>

    <h:panelGroup id="popup">
        <ui:fragment rendered="#{not empty bean.url}">
            <script>window.open('#{bean.url}');</script>
        </ui:fragment>
    </h:panelGroup>
</h:form>

使用

private String url;

public void submit() {
    this.url = sendRequestToServiceAndRetrieveURL();
}

// ...

这篇关于弹出JSF中的URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆