Here is a shell delegate example:

The template it will look something like:

<html jwcid="[EMAIL PROTECTED]" title="ognl:pageTitle" 
delegate="ognl:shellRenderDelegator">
............
</html>

And in your page class (it's recommended to put it in a superclass), you 
have this method:

public IRender getShellRenderDelegator(){
return new IRender(){

public void render(IMarkupWriter writer, IRequestCycle cycle) {

//here you get the stylesheets collection dinamicaly. you can get it perhaps 
from your page, perhaps from the visit, from a database ....
Collection stylesheets = getStyleSheets();

if(stylesheets != null && !stylesheets.isEmpty()){

for (Iterator it = stylesheets.iterator(); it.hasNext();) {
String sheet = (String) it.next();
writer.begin("link");
writer.attribute("rel", "stylesheet");
writer.attribute("type", "text/css");
writer.attribute("href", sheet);
writer.end();
}
}
}

};
}

Try it ant tell me if that works. (note: don't know if the code above 
compiles or not, it just an extract of what my method do).









On 6/26/05, Vinicius Carvalho <[EMAIL PROTECTED]> wrote:
> 
> I'm creating the listener ;)
> Do you have an example of the delegator? Since I must create a class
> that inherit from IRender, how do I replace the original css from the
> body with a custom one?
> 
> Thanks
>

Reply via email to