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