Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jsf-2/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jsf 2 jsf目标="_“空白”;不使用primefaces命令按钮_Jsf 2_Primefaces - Fatal编程技术网

Jsf 2 jsf目标="_“空白”;不使用primefaces命令按钮

Jsf 2 jsf目标="_“空白”;不使用primefaces命令按钮,jsf-2,primefaces,Jsf 2,Primefaces,尝试打开一个新选项卡以接受bean生成的pdf文件 与h:commandbutton一起使用,没有使用p.commandbutton打开的选项卡 尝试将onclick和oncomplete=“window.open”(“u blank”)放在p:commandbutton上,它会打开一个新选项卡,但不会获取pdf并获取“Error 404 Not Found” 使用primefaces-3.1 谢谢 <?xml version="1.0" encoding="UTF-8"?>

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

与h:commandbutton一起使用,没有使用p.commandbutton打开的选项卡

尝试将onclick和oncomplete=“window.open”(“u blank”)放在p:commandbutton上,它会打开一个新选项卡,但不会获取pdf并获取“Error 404 Not Found”

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

尝试设置

ajax="false"
在您的
p:commandButton
上,这样它的行为应该类似于
h:commandButton