p:outputLabel
複合コンポーネントで使用する場合の使用に問題があります。フィールド付きの複合コンポーネントがありp:inputText
ます(コンポーネントから無関係なパーツを削除しました):
<cc:interface>
<cc:editableValueHolder name="myInput" targets="myInput"/>
<cc:attribute name="required" required="true" type="java.lang.Boolean" default="false"/>
</cc:interface>
<cc:implementation>
<p:inputText id="myInput" required="#{cc.attrs.required}"/>
</cc:implementation>
今、私はこのコンポーネントを次のように使用しませんp:outputLabel
:
<p:outputLabel for="myComponent:myInput" value="#{resources['myLabel']}:"/>
<my:myComponent id="myComponent" required="#{myBean.required}"/>
すべてが正常に機能し、検証が必要です。メッセージも表示されますが、ラベルをコンポーネント*
に直接接続する場合のように、ラベルにはサインがありません。p:inputText
一方、私required="true"
がp:inputText
すべてのハードコードを正常に機能させる場合。
デバッグしorg.primefaces.component.outputlabel.OutputLabelRenderer
たところ、コンポーネントがとして認識されていることがわかりましたが、 falseUIInput
が返されます。input.isRequired()
さらにデバッグすると、required
属性がコンポーネントでまだ定義されていないことが判明したためfalse
、デフォルト値iとして返されますUIInput
。
(Boolean) getStateHelper().eval(PropertyKeys.required, false);
また、p:outputLabel
複合コンポーネント内を移動するだけで、すべてが正常に機能します。ELは後で複合コンポーネント内で評価されるように?
Primefaces3.5とMojarra2.1.14を使用しています