jsf 2 - Omnifaces Components#includeCompositeComponent set attribute value -


When dynamically creating a composite component with Omniface, the value of properties (such as attribute myValue ) so that it is available for pre-render events on composite?

  & lt; Composite: interface & gt; & Lt; Composite: attribute name = "myValue" required = "true" /> & Lt; / Mixed: Interface & gt; & Lt; Overall: Implementation & gt; & Lt ;! - Does it work! - & gt; & Lt; H: output text value = "# {cc.attrs.myValue}" /> & Lt ;! - It does not execute - & gt; & Lt; F: event id = "eventId" type = "javax.faces.event.PreRenderComponentEvent" listener = "# {b. Asmat.myValue}}" /> & Lt ;! - luggage - & gt; & Lt; / Mixed: Implementation & gt;   

However, I can reach myValue on XHTML (via # cc.attrs.myValue} ) But this is not available for pre-render (I used to specify the value of myValue .)

Edit: Also in the attribute (by managed-asset) will also do this.

check:

public static UIComponent includeCompositeComponent (UIComponent Parent, string string name, string resource name, string id)

...

Returns: Built-in composite component, if necessary It can be used to set custom attributes or value expressions on it.

Therefore, just return the UIComponent example and use the static value or to set the EL expression.

  UIComponent composite = Components.includeCompositeComponent (parent, library, name, id); Composite.getAttributes (). Put ("myValue", myStaticValue); // or: composite.setvalue expression ("myValue", Components.createValueExpression ("# {bean.myValue}", String.class)); // ...    

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -