Re: removing a behavior

2009-09-13 Thread nino martinez wael
What about just not adding it instead? So in the first cycle you add it and in the next rendering you do not? 2009/9/13 Pierre Goupil goupilpie...@gmail.com: Good morning, I use CSSPackageResource .getHeaderContribution(style.css) in order to load CSS files into my page. But is there any way

Re: removing a behavior

2009-09-13 Thread Pierre Goupil
Thanks for your reply! Let me explain. I have three CSS files (1, 2, 3) and only one page (Page). On this Page, there's a Component which contains three links which purpose are to swith the graphical theme of the page, based on the CSS files. When the user clicks on one of these links, the

Re: removing a behavior

2009-09-13 Thread Sven Meier
component.add(new HeaderContributor(new IHeaderContributor() { private static final long serialVersionUID = 1L; public void renderHead(IHeaderResponse response) { response.renderCSSReference(getCurrentResource()); }

Re: removing a behavior

2009-09-13 Thread Pierre Goupil
I did it, but there problem is still the same: all CSS files keep being in the header as soon as I add one of them. What I'd like to do is to have only one CSS at a given moment in the page. Any ideas? Regards, Zala On Sun, Sep 13, 2009 at 4:59 PM, Sven Meier s...@meiers.net wrote:

Re: removing a behavior

2009-09-13 Thread Sven Meier
Hi, you have to add the header contributor only once. See here for a live example of a theme chooser: http://wicket-tree.appspot.com Sven Pierre Goupil wrote: I did it, but there problem is still the same: all CSS files keep being in the header as soon as I add one of them. What I'd

Re: removing a behavior

2009-09-13 Thread Pierre Goupil
Thanx man, it works now! My main error was to use a HeaderContributor without a scope class. So I did just like you: I now use a theme class which sets itself as a scope. BUT it wasn't enough, because the previous HeaderContributors kept sticking into my page. But keeping a reference to them now

removing a behavior

2009-09-12 Thread Pierre Goupil
Good morning, I use CSSPackageResource .getHeaderContribution(style.css) in order to load CSS files into my page. But is there any way to remove the HeaderContributor ? If I just add another one in a subsequent request, the old CSS is still there, which I don't want. Regards, Zala -- Sans