2
votes

I have written a wrapper component that in certain conditions overrides some attributes of its children.

In the INVOKE_APPLICATION phase (after an event), it calls UIComponent#setValueExpression on child components :

FacesContext ctx = FacesContext.getCurrentInstance();
ELContext eLContext = ctx.getELContext();
ExpressionFactory factory = ctx.getApplication().getExpressionFactory();
String newModelExpression = "#{newExpression}";
ValueExpression exp = factory.createValueExpression(eLContext, newModelExpression, Object.class);
((UIComponent) child).setValueExpression("model", exp);  

Everything is fine except with composite-component as child.

With composite-component, the value expression is reset in the RENDER_RESPONSE phase and the initial expression is evaluated.

This happens in CompositeComponentTagHandler$CompositeComponentRule$CompositeExpressionMetadata#applyMetaData.

Is there a workaround for that ?

I’m using Payara with jsf-impl Mojarra 2.2.12

1

1 Answers

0
votes

Just called UIComponent#setValueExpression further to a PreRenderViewEvent processing.