UIComponent « Component « JSF Q&A





1. Why do encodeXxx methods in UIComponent accept FacesContext parameter?    stackoverflow.com

I haven't ever before created custom components in JSF so I've noticed only now that methods like encodeBegin(), encodeEnd() etc accept FacesContext parameter. FacesContext instance can usually be received with FacesContext.getCurrentInstance(). So, ...

2. Adding JSF UIComponent as composite component child renders nothing    stackoverflow.com

I have a custom UIComponent, which renders ok when called directly from the base facelet template (I guess this makes it a direct child of UIComponentBodyTag). However, when it is called ...

3. Injecting Resources Into UIComponent (aka does CDI work here?)    stackoverflow.com

I am writing a (composite) component that needs to interact with my DAO. Here is how the Java part is declared:

@FacesComponent(value="selectLocation")
public class SelectLocation extends UINamingContainer {
To get the DAO ...

4. UIComponent.getAttributes().put() not doing what I think it should    stackoverflow.com

This is in a composite component with an interface defined like this:

<cc:interface componentType="selectLocation">
    <cc:attribute name="value" 
             ...