Thanks for this, I will take a look at this. Remo
-----Original Message----- From: Andrew Robinson [mailto:[EMAIL PROTECTED] Sent: Donnerstag, 15. Juni 2006 19:00 To: MyFaces Discussion Subject: Re: Creating a custom Component for a whole page that renders any other component Use facelets : it is made for these things. Look into facelet user tags (source tags). I just published a blog article on this and the ability to pass methods to composite controls: http://andrewfacelets.blogspot.com/ -Andrew On 6/15/06, Remo Liechti <[EMAIL PROTECTED]> wrote: > Hi all > I have to create a custom component. But I don't have any idea how to do > this, can anybody help me out? > > The problem is we have to set some stuff on every JSF page, like header > etc. > Now I'd like to create component like this: > > > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> > > <%@ taglib uri='http://java.sun.com/jsp/jstl/core' prefix='c'%> > <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%> > <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%> > <%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%> > <%@ taglib uri="component.tags" prefix="custom"%> > > <custom:page name="my jsf page" css="my css file" > > > </custom:page> > > It should be able to render all other jsf components in it: > <custom:page name="my jsf page" css="my css file" > > <h:panelGrid columns="1"> > <h:column> > <h:selectOneMenu id="selectedKpiGroup" .... > <f:selectItems .../> > </h:selectOneMenu> > </h:column> > </h:panelGrid> > </custom:page> > > > > The custom page component should render this like things: > <html> > <f:view> > <f:verbatim> > <head> > <link > href="<%=request.getContextPath()%>/myCSSFile" rel="stylesheet" > type="text/css"> > </head> > > <body> > </f:verbatim> > <h:form> > <c:if test="${not empty flowExecutionKey}"> > <f:verbatim> > <input type="hidden" > name="_flowExecutionKey" value="${flowExecutionKey}" /> > </f:verbatim> > </c:if> > > <t:div styleClass="title"> > <h:outputText value="myTitle" /> > </t:div> > > > > > Does anybody know how to do this? > > Thanks a lot for your help! > > Regards, > Remo >

