h:commandButtonBean 内にプロパティを設定する必要がある があります。変数の値によっては、別のプロパティを設定する必要がある場合があります。これが私が試したコードです
<h:commandButton value="Procedi">
<f:ajax event="click" />
<f:setPropertyActionListener
target="#{comparisonSide eq 'Left' ? compareManaged.optionalLeft : compareManaged.optionalRight}"
value="#{comparisonSide eq 'Left' ? optionalManaged.selectedOptionalsLeft : optionalManaged.selectedOptionalsRight }" />
</h:commandButton>
targetの属性で使用しようとした構文のため、これは機能しないようですsetPropertyActionListener(つまり、そこで三項演算子を使用することはできません)。
c:ifコードに'sを散らかさずに、この種の条件付きターゲティングを実現する方法はありますか?
PSこれが役立つ場合、私はmyfacesとrichfacesを使用しています。