Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Use <a href="http://download.oracle.com/javaee/6/api/javax/el/ValueExpression.html#setValue%28javax.el.ELContext,%20java.lang.Object%29" rel="nofollow noreferrer"><code>ValueExpression#setValue()</code></a>.</p> <pre><code>FacesContext facesContext = FacesContext.getCurrentInstance(); ELContext elContext = facesContext.getELContext(); ValueExpression valueExpression = facesContext.getApplication().getExpressionFactory() .createValueExpression(elContext, "#{cc.attrs.model.location}", Location.class); valueExpression.setValue(elContext, newLocation); </code></pre> <p>The <a href="http://download.oracle.com/javaee/6/api/javax/faces/application/Application.html#evaluateExpressionGet%28javax.faces.context.FacesContext,%20java.lang.String,%20java.lang.Class%29" rel="nofollow noreferrer"><code>Application#evaluateExpressionGet()</code></a> by the way calls <a href="http://download.oracle.com/javaee/6/api/javax/el/ValueExpression.html#getValue%28javax.el.ELContext%29" rel="nofollow noreferrer"><code>ValueExpression#getValue()</code></a> under the covers, exactly as described by its <a href="http://download.oracle.com/javaee/6/api/javax/faces/application/Application.html#evaluateExpressionGet%28javax.faces.context.FacesContext,%20java.lang.String,%20java.lang.Class%29" rel="nofollow noreferrer">javadoc</a> (if you have ever read it...)</p> <hr> <p><strong>Unrelated</strong> to the concrete problem, are you aware about the possibility to create backing <code>UIComponent</code> class for the composite component? I bet that this is much easier than fiddling with <code>ValueExpression</code>s this way. You could then just use the inherited <code>getAttributes()</code> method to get the <code>model</code>.</p> <pre><code>Model model = (Model) getAttributes().get("model); // ... </code></pre> <p>You can find an example in our <a href="https://stackoverflow.com/tags/composite-component/info">composite component wiki page</a>.</p>
    singulars
    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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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