Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Your problem is the way value binding is done in JSF. The prefered way is to retrieve the EL Expression an attribute was populated with by invoking <code>getValueExpression("attributeName")</code>. Then this EL Expression can be used to get or set the value in the backing bean. As your not passing <code>#{!isButtonEnabled}</code> but <code>#{cc.attrs.disabled}</code> to <code>ice:commandButton</code> the binding fails. </p> <p>I solved this for the <code>p:selectOneMenu</code> component of Primefaces by writing a wrapping <code>UIComponent</code> which defines a property <code>wrappedValue</code> and passed that property to the <code>p:selectOneMenu</code>. In the getter and setter of that property I then used <code>getValueExpression</code> to retieve the real EL Expression for the attribute.</p> <pre><code>&lt;composite:interface componentType="de.gw2tome.component.valuewrapper"&gt; &lt;composite:attribute name="value" type="de.gw2tome.models.Rarity" required="true" /&gt; &lt;/composite:interface&gt; &lt;composite:implementation&gt; &lt;p:selectOneMenu value="#{cc.wrappedValue}"/&gt; ... &lt;/composite:implementation&gt; </code></pre> <hr> <pre><code>@FacesComponent("de.gw2tome.component.valuewrapper") public class ValueWrapper extends UINamingContainer { public void setWrappedValue(Object wrappedValue) { ValueExpression expr = getValueExpression("value"); ELContext ctx = getFacesContext().getELContext(); expr.setValue(ctx, wrappedValue); } public Object getWrappedValue() { ValueExpression expr = getValueExpression("value"); ELContext ctx = getFacesContext().getELContext(); return expr.getValue(ctx); } } </code></pre> <p>The component can now be used the following way:</p> <pre><code>&lt;g:rarityChooser value="#{itemSearchBean.minRarity}" /&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload