相关疑难解决方法(0)

使用h:commandButton通过POST打开新窗口

我需要通过POST点击a在新窗口中打开一个JSF页面<h:commandButton>.我知道我可以使用JavaScript实现这一点.但我想使用JSF而不是JavaScript来实现这个目标.

我怎样才能做到这一点?我正在使用JSF 2.0.

jsf http-post new-window commandbutton

11
推荐指数
2
解决办法
4万
查看次数

jsf target ="_ blank"无法使用primefaces命令按钮

尝试打开一个新选项卡以接受来自bean的生成的pdf文件.

使用h:commandbutton,没有使用p.commandbutton打开选项卡.

试图在p:commandbutton上放置onclick和oncomplete ="window.open('_ blank'),它会打开一个新选项卡,但它不会获得pdf并获得"找不到错误404".

使用primefaces-3.1

谢谢

  <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN'
     'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>

     <html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">


    <h:head>
        <h:outputStylesheet library="base" name='jquery-ui-1.8.16.custom.css' />
    </h:head>
    <h:form target="_blank">
      <p:commandButton value="Run" action="#{bean.createReport}"  />
    </h:form>

    </html>
Run Code Online (Sandbox Code Playgroud)

primefaces jsf-2

4
推荐指数
1
解决办法
1万
查看次数

标签 统计

commandbutton ×1

http-post ×1

jsf ×1

jsf-2 ×1

new-window ×1

primefaces ×1