我想在 JSF 页面中创建命令按钮。当我按下它时,我想打开一个新页面并使用 http 发送一个值。我对此进行了测试,h:commnadButton
但它不起作用。
<h:commandButton id="lnkHidden" value=" Edit User " action="EditAccountProfile.jsf">
<f:param name="id" value="#{item.userid}" />
</h:commandButton>
h:commandButton
用于提交表单,通常在服务器中执行操作。
用于h:button
简单导航:
<h:button id="lnkHidden" value=" Edit User " outcome="EditAccountProfile.jsf">
<f:param name="id" value="#{item.userid}" />
</h:button>
这将生成一个普通的 HTML <input type="button" onclick="window.location.href=/correct/path/to/EditAccountProfile.jsf" />
,不需要 HTTP POST。
也可以看看: