Jsf 通过Ctrl+;单击或单击类似链接
我有一个primefaces(5.1)数据表,在最右边的列中有一些按钮:Jsf 通过Ctrl+;单击或单击类似链接,jsf,button,primefaces,new-window,Jsf,Button,Primefaces,New Window,我有一个primefaces(5.1)数据表,在最右边的列中有一些按钮: <p:column headerText="Actions" style="width: 60px"> <p:button id="uploadButton" title="upload files" icon="fa fa-edit" outcome="uploadFilesToVersion">
<p:column headerText="Actions" style="width: 60px">
<p:button id="uploadButton" title="upload files"
icon="fa fa-edit" outcome="uploadFilesToVersion">
<f:param name="versionId" value="#{version.id}" />
</p:button>
<!-- other buttons come here-->
</p:column>
注意,“version”是sourrounding p:dataTable的本地(循环)变量,uploadFilesToVersion.xhtml是用户将文件上载到id=version.id的“version”的视图
注意,button没有调用任何bean方法,因为它的样式,我只使用了p:button元素。现在,我想让用户能够在新的浏览器选项卡/窗口中打开按钮的结果(即URL)。这将是有益的,因为我希望同时保留dataTable的筛选器状态(当用户在浏览器中单击“后退”时,它将丢失)
如何才能做到这一点
编辑:当然可以使用一些CSS来模仿按钮的外观,但我想避免:
<p:column headerText="Actions" style="width: 60px">
<p:link id="uploadButton" title="upload files"
outcome="uploadFilesToVersion"
styleClass="ui-button ui-widget ui-state-default ui-corner-all ui-button-icon-only">
<span class="ui-button-icon-left ui-icon ui-c fa fa-edit"></span>
<span class="ui-button-text ui-c">ui-button</span>
<f:param name="versionId" value="#{version.id}" />
</p:link>
<!-- other buttons come here-->
</p:column>
用户界面按钮
这是不可能的,因为
使用JavaScript导航,而不是使用来简化样板文件
<my:linkButton ... icon="fa fa-edit" />
“通缉”是过去时。那么你改变主意了?是的,根据巴卢斯克的回答,我“改变了主意”,所以说编辑是一种额外的回答?然后按原样发布,或者由BalusC“编辑”答案,并将其添加到那里,以便参数的传递也在那里(也请发布PF版本信息)
<my:linkButton ... icon="fa fa-edit" />