Ah, sweet.  Thanks for digging that up Jeremy.

Alec, since we were pressed for time, I piggybacked off your code to get
something working

    @Override
    protected void init() {
        super.init();
        /*
         * Adds custom skin at the end of the header
         */
        setHeaderResponseDecorator(new IHeaderResponseDecorator() {
            public IHeaderResponse decorate(IHeaderResponse response) {
                return new DecoratingHeaderResponse(response) {
                    @Override
                    public void close() {
                        String css = null;
                        if(MyWebSession.get() != null) css =
MyWebSession.get().getCssStyle();

                        if(css != null && !wasRendered(css)) {
                            renderString("<style>" + css + "</style>");
                        }
                        super.close();
                    }
                };
            }
        });
    }

I chose not to override renderString(), because I didn't want to break
anything that might use it.  Also, we don't know what css we want to add
when the application gets initialized; we have to wait till the user has
authenticated.  So, I stuck our css in the session after authentication and
had the decorator pull it from there.

When we get a chance I will swap this out for the bucket method for it's
added flexibility, but this does work for now.

Thanks again guys,
Loren


On Wed, Aug 3, 2011 at 9:58 PM, Jeremy Thomerson
<jer...@wickettraining.com>wrote:

> That thread is here: http://tinyurl.com/3fnery2
>
> In it there's a link to a tar of a project that's still hosted on my site.
>
> --
> Jeremy Thomerson
> http://wickettraining.com
> *Need a CMS for Wicket?  Use Brix! http://brixcms.org*
>
> On Wed, Aug 3, 2011 at 1:21 PM, Martin Grigorov <mgrigo...@apache.org
> >wrote:
>
> > Hi Loren,
> >
> > See whether you can find the mail mentioned in
> > https://cwiki.apache.org/confluence/display/WICKET/Resource+decoration
> > in the mail archives.
> > Jeremy attached the raw application in this mail thread and I
> > transformed it to proper wicket-example for 1.5
> >
> > On Wed, Aug 3, 2011 at 6:36 PM, Loren Cole <loren.c...@gmail.com> wrote:
> > > Hey guys, thanks for your responses. We're still using 1.4, it looks
> like
> > it
> > > will be a few months till we get to upgrade and use all the
> improvements
> > > that have been made to resource handling in 1.5.  In 1.4 it appears
> that
> > you
> > > cannot put a bucket in the header without things getting confused and
> > > failing to close.  Does anyone know why this is the case, or if there
> is
> > a
> > > way around it while still getting things in a <head> tag?
> > >
> > > Martin, since we're using an older version I'm having trouble taking
> > > advantage of your excellent advise, but I see elsewhere on the list,
> you
> > > mention that this aggregation example should work in 1.4 also.  Do you
> > > perhaps have an example of that I could look at?  The 1.4 equivalent of
> > > MergedResourcesResource in particular is eluding me.
> > >
> > > Am I right in thinking that aggregation will be required to order my
> css
> > > contributions in 1.4?  At this point in development, the performance
> > boost
> > > doesn't necessarily offset the extra trouble of tracking down what
> > > stylesheet or js library a problem is in, so I'd rather avoid it if
> > > possible.
> > >
> > >
> > > Thanks, Loren
> > >
> >
> >
> >
> > --
> > Martin Grigorov
> > jWeekend
> > Training, Consulting, Development
> > http://jWeekend.com
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> > For additional commands, e-mail: users-h...@wicket.apache.org
> >
> >
>

Reply via email to