inserting facelets with my own UIOutput component?
I am using Jboss 4.0.5, Seam 1.2.1 and JSF 1.1.
I am developing my own JSF UI component that should take a collection as a parameter and iterate over the collection and, based on a String, insert a div element and then the content of a facelets inside the element. I was thinking of using the facelet.apply() method. This is my encodeBegin:
publicvoid encodeBegin(FacesContext facesContext, UIComponent component)throws IOException{
super.encodeBegin(facesContext, component);
UIUserCellsContainer cellContainer = (UIUserCellsContainer)component;
Collection container = cellContainer.getRegionContainer();
ResponseWriter writer = facesContext.getResponseWriter();
writer.startElement("div", component);
String uri = (getClass().getResource("/cells/" + testuri);
FaceletFactory factory = FaceletFactory.getInstance();
Facelet facelet = factory.getFacelet(uri);
facelet.apply(facesContext, facesContext.getViewRoot());
}
I exclude the iteration of the collection for this post but the idea remains the same.
The cellContainer object is gets its value and the uri for the resource is correct but the faceletfactory is null. The encodeBegin is placed in a renderer class. Is this the way to solve my usecase? Or am I on the wrong track?

