我试图执行一个JSF2 bean方法,并在完成单击PrimeFaces的方法后显示一个对话框<p:commandButton>.
<p:commandButton id="viewButton" value="View"
actionlistener="#{userBean.setResultsForSelectedRow}" ajax="false"
update=":selectedRowValues"
oncomplete="PF('selectedRowValuesDlg').show()">
</p:commandButton>
Run Code Online (Sandbox Code Playgroud)
<p:dialog id="selectedRowValues" widgetVar="selectedRowValuesDlg" dynamic="true">
<h:outputText value="#{userBean.selectedGroupName}" />
</p:dialog>
Run Code Online (Sandbox Code Playgroud)
当我单击命令按钮时,bean动作侦听器方法setResultsForSelectedRow正确执行,但在方法完成时它不显示对话框.如果我删除actionlistener,它会显示对话框.我不知道出了什么问题.
事件的执行顺序是什么?是否有可能执行actionlistener和oncomplete同步?
我有一个变量类型float.I想要打印到3精度的十进制,包括尾随零.
示例:
2.5 >> 2.500
1.2 >> 1.200
1.3782 >> 1.378
2 >> 2.000
我正在尝试使用它
DecimalFormat _numberFormat= new DecimalFormat("#0.000");
Float.parseFloat(_numberFormat.format(2.5))
Run Code Online (Sandbox Code Playgroud)
但它没有转换2.5 >> 2.500.
难道我做错了什么..
请帮忙..
我正在使用primefaces-4.0构建一个Web应用程序.我想在点击命令按钮的同时调用两个bean方法.我通过使用remoteCommand尝试了它.
<p:commandButton value="Submit" ajax="false"
actionListener="#{userBean.execute}"
onclick="callCorrelation()">
</p:commandButton>
<p:remoteCommand name="correlation" update="correlationDialog"
actionListener="#{userBean.correlation}" />
Run Code Online (Sandbox Code Playgroud)
Java脚本功能:
<head>
<script type="text/javascript">
$(document).callCorrelation(function() {
correlation ();
});
</script>
</head>
Run Code Online (Sandbox Code Playgroud)
但它没有用.
有没有其他方法可以同时调用两个bean方法?