URL in popup JSF

不羁岁月 提交于 2019-12-11 13:47:32

问题


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

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

we are using JSF, prime faces and spring webflow


回答1:


Use JavaScript's window.open function.

E.g.

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

with

private String url;

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

// ...


来源:https://stackoverflow.com/questions/7203665/url-in-popup-jsf

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!