本文介绍了弹出JSF中的URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有以下情况首先,我需要向后端发送请求,这将返回一个URL ..我需要在弹出窗口..我为此感到困惑
i have following scenariofirst i need to send request to back end,that will return a URL..i need to open the URL in thepopup.. 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
推荐答案
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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!