我想使用以下命令:
JSF <h:commandButton>生成一个<input...>,但我希望它不生成<input>,而生成HTML4标准<button>。
发布于 2012-10-08 19:21:31
你应该研究一下Primefaces的p:commandButton。这将呈现为客户端上的<button>标记。
http://www.primefaces.org/showcase/ui/commandButton.jsf
发布于 2012-10-08 09:52:52
与标准JSF组件集最接近的是由生成的<input type="button">。
<h:button value="Button" />它会生成
<input id="j_id_1" name="j_id_1" type="button" value="Button" onclick="window.location.href = '/context/currentpage.xhtml'" />如果您确实出于某种不清楚的原因坚持使用<button>,那么您有以下选择:
<button>.发布于 2016-10-31 05:30:16
如果您使用的是JSF2.2,那么可以只使用带有JSF的<button>标记。这里的秘密是来自jsf名称空间的属性process、发布表单数据的属性和action属性。
<button type="submit" class="btn btn-primary"
jsf:action="#{profileController.updateProfile}"
jsf:process="@form">
<i class="fa fa-floppy-o" aria-hidden="true"></i>
#{bundle['button.store']}
</button>在JSF2.2中,您可以使用任何与JSF标记混合的HTML标记。
https://stackoverflow.com/questions/12773907
复制相似问题