コマンドを使用したい:
JSF<h:commandButton>
は を生成しますが、 I would like that this generate a HTML 4 standard を生成する<input...>
代わりに、<input>
<button>
標準の JSF コンポーネント セットで取得できる最も近いもの<input type="button">
は、 によって生成されるもの<h: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>
はっきりしない理由でどうしても使用したい場合は、次のオプションがあります。
<p:button>
は を生成し<button>
ます。Primefaces を調べる必要がありますp:commandButton
。<button>
これは、クライアントのタグにレンダリングされます。
JSF 2.2 を使用している場合は<button>
、jsf 名前空間が混在するタグを使用できます。ここでの秘密は、フォーム データをポストする名前空間の属性と属性process
です。jsf
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>
JSF 2.2 では、JSF タグと混合して任意の HTML タグを使用できます。