borderColor
ELを使用して設定したくないBeanに文字列フィールドがありますnull
が、常に空の文字列に強制されています。
<p:inputText value="#{axis.borderColor}" rendered="#{axis.borderColor != null}">
<p:ajax update=":form:plot"/>
</p:inputText>
<p:commandButton value="#{msg.initialize}" action="#{axis.setBorderColor( 'cccccc' )}" rendered="#{axis.borderColor == null}" update=":form:mainTabs:axesSettings :form:plot"/>
<p:commandButton value="#{msg.reset}" rendered="#{axis.borderColor != null}" update=":form:mainTabs:axesSettings :form:plot">
<f:setPropertyActionListener target="#{axis.borderColor}" value="#{null}" />
</p:commandButton>
- null の場合
borderColor
、「初期化」ボタンを表示します。 - null でない場合
borderColor
、ユーザーが CSS カラーと「リセット」ボタンを入力できるテキスト フィールドを表示します。リセット ボタンが押されたら、borderColor を null に戻したいと思います (実際には、テキスト フィールドではなく PrimeFaces p:colorPicker を使用していますが、問題は同じです)。
私はすべてを読みましたがjavax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL
、そのコンテキストパラメーターを追加すると問題が解決すると思いましたが、効果はありませんでした。によって提供されている null 値がsetPropertyActionListener
、何らかの理由で空の文字列に変換されているようです。
GlassFish 4.0 と PrimeFaces 4.0-SNAPSHOT を使用しています