0

I'm trying to dynamically add a hidden input field to my composite component. The problem is that I somehow can not access the property of my backing facescomponent with the value expression. Example:

public void encodeBegin(FacesContext context) throws IOException {
  HtmlInputHidden someInput = new HtmlInputHidden();
  someInput.setValueExpression("value", createValueExpression("#{cc ne null}", String.class));  //this will be rendered to <input type="hidden" value="false"/>
  ...
}

When I use a CDI-Managed-Bean in the value-expression this works. When I add an inputfield with access to #{cc} by using xhtml this also works (e.g. input type="hidden" value="#{cc ne null}"/> will render to input type="hidden" value="true"/>). Is this a bug or am I missing something? I'm using wildfly 8 with mojarra-2.2.6.

Thanks in advance

user1727072
  • 309
  • 4
  • 14
  • what's `createValueExpression()`? Own method, derrived method..? – dognose Jul 07 '14 at 16:36
  • something like this: FacesContext context = FacesContext.getCurrentInstance(); context.getApplication().getExpressionFactory() .createValueExpression(context.getELContext(), exp, WHATEVER.class).getValue(context.getELContext()); – user1727072 Jul 08 '14 at 06:01

0 Answers0