Use this page to record hints and tips about developing components using the CDK
Instantiating a component created using the CDK
So, you've created a few components using the CDK, and then you need to instantiate one of those components inside another one (or perhaps it's renderer) - as all your components are defined abstract you can't just do new UIFoo(). You'll need to use JSF Component factory; you can wrap it all up like this:
public static UIFoo newInstance() { return (UIFoo) FacesContext.getCurrentInstance().getApplication().createComponent(COMPONENT_TYPE);
}
and then create the component
UIFoo foo = UIFoo.newInstance();
Comments