开发者

URL in popup JSF

开发者 https://www.devze.com 2023-03-31 12:53 出处:网络
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

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 o开发者_如何学Gopening 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


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();
}

// ...
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号