You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by rjilani <ji...@lifebiosystems.com> on 2009/02/18 22:31:54 UTC

sepearte stylesheet refrences for page and panel

Hi: Gurus, I am attaching two separate style sheets one for a page and one
for the panel.

I am attaching the style sheets in my Java code  like this

 add(new StyleSheetReference("stylesheet", PBNASLogin.class, "login.css"));
//in page constructor

 add(new StyleSheetReference("stylesheetPanel", RegisteredUserPanel.class,
"register.css")); //in panel constructor

here is the html mark up for page and panel respectively

<link wicket:id="stylesheet"/>
<link wicket:id="stylesheetPanel"/>

but when I run the code I got the following wicket error 

The component(s) below failed to render. A common problem is that you have
added a component in code but forgot to reference it in the markup (thus the
component will never be rendered)

My question is that is it possible to add 2 separate style sheets in a
parent child markup, if yes, what is the root cause of the above error.

Thanks,
RJ.
-- 
View this message in context: http://www.nabble.com/sepearte-stylesheet-refrences-for-page-and-panel-tp22088667p22088667.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: sepearte stylesheet refrences for page and panel

Posted by rjilani <ji...@lifebiosystems.com>.
Hi: Jeremy sorry for the late reply, HeaderContributor is now working, the
reason it was not working before because I didn't pay attention that I had
to use add(HeaderContributor.forCss(RegisteredUserPanel.class,
"register.css") ) in my code instead of just
HeaderContributor.forCss(RegisteredUserPanel.class,
"register.css") 


Jeremy Thomerson-5 wrote:
> 
> HeaderContributor is definitely the standard way of doing this
> (StyleSheetReference is only used once in all of Wicket code).  I would
> suggest figuring out how to get the HeaderContributor working.  Open a new
> thread on what's not working, and paste your code (where you add the HC in
> java and your HTML for your base page template that all your other pages
> extend from, if you have one, or any page that you added the HC to).
> 
> If you don't figure out why HeaderContributor isn't working, it is likely
> that other Wicket extensions and components will not work because they
> will
> not be able to contribute their JS or CSS to the head.
> 
> -- 
> Jeremy Thomerson
> http://www.wickettraining.com
> 
> On Wed, Feb 18, 2009 at 4:05 PM, rjilani <ji...@lifebiosystems.com>
> wrote:
> 
>>
>> Thanks Jeremy for your suggestions. You were right the wicket link for
>> style
>> sheet was not in <wicket:panel> tag and putting the link under panel tag
>> resolved the issue.
>>
>> One other observation though and it worked too, I put both the style
>> sheet
>> linked at the page level and added both the refrences in the constructor
>> of
>> the page and vola it worked. E.g
>>
>> <link wicket:id="stylesheet"/>
>> <link wicket:id="stylesheetPanel"/>
>>
>> add(new StyleSheetReference("stylesheet", PBNASLogin.class,
>> "login.css"));
>> in page constructor
>>
>> add(new StyleSheetReference("stylesheetPanel", RegisteredUserPanel.class,
>> "register.css")); //in page constructor too
>>
>> BTW even though HeaderContributor.forCss looks the most elegant solution,
>> it
>> never worked for me.
>>
>> Regards,
>> RJ.
>>
>>
>>
>> Jeremy Thomerson-5 wrote:
>> >
>> > Your error didn't include WHICH components failed to render.  Here are
>> a
>> > couple suggestions:
>> >
>> > 1 - in your panel, is the <link> tag inside the <wicket:panel> tag -
>> this
>> > would be my first guess as to your problem.
>> > 2 - why not just use
>> HeaderContributor.forCss(RegisteredUserPanel.class,
>> > "register.css") in your panel (and the same in your page) - these will
>> add
>> > the link for you, and in the head, where it should be.  You don't have
>> to
>> > put a component in the page then.
>> >
>> > --
>> > Jeremy Thomerson
>> > http://www.wickettraining.com
>> >
>> >
>> > On Wed, Feb 18, 2009 at 3:31 PM, rjilani <ji...@lifebiosystems.com>
>> > wrote:
>> >
>> >>
>> >> Hi: Gurus, I am attaching two separate style sheets one for a page and
>> >> one
>> >> for the panel.
>> >>
>> >> I am attaching the style sheets in my Java code  like this
>> >>
>> >>  add(new StyleSheetReference("stylesheet", PBNASLogin.class,
>> >> "login.css"));
>> >> //in page constructor
>> >>
>> >>  add(new StyleSheetReference("stylesheetPanel",
>> >> RegisteredUserPanel.class,
>> >> "register.css")); //in panel constructor
>> >>
>> >> here is the html mark up for page and panel respectively
>> >>
>> >> <link wicket:id="stylesheet"/>
>> >> <link wicket:id="stylesheetPanel"/>
>> >>
>> >> but when I run the code I got the following wicket error
>> >>
>> >> The component(s) below failed to render. A common problem is that you
>> >> have
>> >> added a component in code but forgot to reference it in the markup
>> (thus
>> >> the
>> >> component will never be rendered)
>> >>
>> >> My question is that is it possible to add 2 separate style sheets in a
>> >> parent child markup, if yes, what is the root cause of the above
>> error.
>> >>
>> >> Thanks,
>> >> RJ.
>> >> --
>> >> View this message in context:
>> >>
>> http://www.nabble.com/sepearte-stylesheet-refrences-for-page-and-panel-tp22088667p22088667.html
>> >> Sent from the Wicket - User mailing list archive at Nabble.com.
>> >>
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> >> For additional commands, e-mail: users-help@wicket.apache.org
>> >>
>> >>
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/sepearte-stylesheet-refrences-for-page-and-panel-tp22088667p22089319.html
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/sepearte-stylesheet-refrences-for-page-and-panel-tp22088667p22103261.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: sepearte stylesheet refrences for page and panel

Posted by Jeremy Thomerson <je...@wickettraining.com>.
HeaderContributor is definitely the standard way of doing this
(StyleSheetReference is only used once in all of Wicket code).  I would
suggest figuring out how to get the HeaderContributor working.  Open a new
thread on what's not working, and paste your code (where you add the HC in
java and your HTML for your base page template that all your other pages
extend from, if you have one, or any page that you added the HC to).

If you don't figure out why HeaderContributor isn't working, it is likely
that other Wicket extensions and components will not work because they will
not be able to contribute their JS or CSS to the head.

-- 
Jeremy Thomerson
http://www.wickettraining.com

On Wed, Feb 18, 2009 at 4:05 PM, rjilani <ji...@lifebiosystems.com> wrote:

>
> Thanks Jeremy for your suggestions. You were right the wicket link for
> style
> sheet was not in <wicket:panel> tag and putting the link under panel tag
> resolved the issue.
>
> One other observation though and it worked too, I put both the style sheet
> linked at the page level and added both the refrences in the constructor of
> the page and vola it worked. E.g
>
> <link wicket:id="stylesheet"/>
> <link wicket:id="stylesheetPanel"/>
>
> add(new StyleSheetReference("stylesheet", PBNASLogin.class, "login.css"));
> in page constructor
>
> add(new StyleSheetReference("stylesheetPanel", RegisteredUserPanel.class,
> "register.css")); //in page constructor too
>
> BTW even though HeaderContributor.forCss looks the most elegant solution,
> it
> never worked for me.
>
> Regards,
> RJ.
>
>
>
> Jeremy Thomerson-5 wrote:
> >
> > Your error didn't include WHICH components failed to render.  Here are a
> > couple suggestions:
> >
> > 1 - in your panel, is the <link> tag inside the <wicket:panel> tag - this
> > would be my first guess as to your problem.
> > 2 - why not just use HeaderContributor.forCss(RegisteredUserPanel.class,
> > "register.css") in your panel (and the same in your page) - these will
> add
> > the link for you, and in the head, where it should be.  You don't have to
> > put a component in the page then.
> >
> > --
> > Jeremy Thomerson
> > http://www.wickettraining.com
> >
> >
> > On Wed, Feb 18, 2009 at 3:31 PM, rjilani <ji...@lifebiosystems.com>
> > wrote:
> >
> >>
> >> Hi: Gurus, I am attaching two separate style sheets one for a page and
> >> one
> >> for the panel.
> >>
> >> I am attaching the style sheets in my Java code  like this
> >>
> >>  add(new StyleSheetReference("stylesheet", PBNASLogin.class,
> >> "login.css"));
> >> //in page constructor
> >>
> >>  add(new StyleSheetReference("stylesheetPanel",
> >> RegisteredUserPanel.class,
> >> "register.css")); //in panel constructor
> >>
> >> here is the html mark up for page and panel respectively
> >>
> >> <link wicket:id="stylesheet"/>
> >> <link wicket:id="stylesheetPanel"/>
> >>
> >> but when I run the code I got the following wicket error
> >>
> >> The component(s) below failed to render. A common problem is that you
> >> have
> >> added a component in code but forgot to reference it in the markup (thus
> >> the
> >> component will never be rendered)
> >>
> >> My question is that is it possible to add 2 separate style sheets in a
> >> parent child markup, if yes, what is the root cause of the above error.
> >>
> >> Thanks,
> >> RJ.
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/sepearte-stylesheet-refrences-for-page-and-panel-tp22088667p22088667.html
> >> Sent from the Wicket - User mailing list archive at Nabble.com.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >> For additional commands, e-mail: users-help@wicket.apache.org
> >>
> >>
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/sepearte-stylesheet-refrences-for-page-and-panel-tp22088667p22089319.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: sepearte stylesheet refrences for page and panel

Posted by rjilani <ji...@lifebiosystems.com>.
Thanks Jeremy for your suggestions. You were right the wicket link for style
sheet was not in <wicket:panel> tag and putting the link under panel tag
resolved the issue.

One other observation though and it worked too, I put both the style sheet
linked at the page level and added both the refrences in the constructor of
the page and vola it worked. E.g 

<link wicket:id="stylesheet"/>
<link wicket:id="stylesheetPanel"/>

add(new StyleSheetReference("stylesheet", PBNASLogin.class, "login.css"));
in page constructor

add(new StyleSheetReference("stylesheetPanel", RegisteredUserPanel.class,
"register.css")); //in page constructor too

BTW even though HeaderContributor.forCss looks the most elegant solution, it
never worked for me.

Regards,
RJ.



Jeremy Thomerson-5 wrote:
> 
> Your error didn't include WHICH components failed to render.  Here are a
> couple suggestions:
> 
> 1 - in your panel, is the <link> tag inside the <wicket:panel> tag - this
> would be my first guess as to your problem.
> 2 - why not just use HeaderContributor.forCss(RegisteredUserPanel.class,
> "register.css") in your panel (and the same in your page) - these will add
> the link for you, and in the head, where it should be.  You don't have to
> put a component in the page then.
> 
> -- 
> Jeremy Thomerson
> http://www.wickettraining.com
> 
> 
> On Wed, Feb 18, 2009 at 3:31 PM, rjilani <ji...@lifebiosystems.com>
> wrote:
> 
>>
>> Hi: Gurus, I am attaching two separate style sheets one for a page and
>> one
>> for the panel.
>>
>> I am attaching the style sheets in my Java code  like this
>>
>>  add(new StyleSheetReference("stylesheet", PBNASLogin.class,
>> "login.css"));
>> //in page constructor
>>
>>  add(new StyleSheetReference("stylesheetPanel",
>> RegisteredUserPanel.class,
>> "register.css")); //in panel constructor
>>
>> here is the html mark up for page and panel respectively
>>
>> <link wicket:id="stylesheet"/>
>> <link wicket:id="stylesheetPanel"/>
>>
>> but when I run the code I got the following wicket error
>>
>> The component(s) below failed to render. A common problem is that you
>> have
>> added a component in code but forgot to reference it in the markup (thus
>> the
>> component will never be rendered)
>>
>> My question is that is it possible to add 2 separate style sheets in a
>> parent child markup, if yes, what is the root cause of the above error.
>>
>> Thanks,
>> RJ.
>> --
>> View this message in context:
>> http://www.nabble.com/sepearte-stylesheet-refrences-for-page-and-panel-tp22088667p22088667.html
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/sepearte-stylesheet-refrences-for-page-and-panel-tp22088667p22089319.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: sepearte stylesheet refrences for page and panel

Posted by Jeremy Thomerson <je...@wickettraining.com>.
Your error didn't include WHICH components failed to render.  Here are a
couple suggestions:

1 - in your panel, is the <link> tag inside the <wicket:panel> tag - this
would be my first guess as to your problem.
2 - why not just use HeaderContributor.forCss(RegisteredUserPanel.class,
"register.css") in your panel (and the same in your page) - these will add
the link for you, and in the head, where it should be.  You don't have to
put a component in the page then.

-- 
Jeremy Thomerson
http://www.wickettraining.com


On Wed, Feb 18, 2009 at 3:31 PM, rjilani <ji...@lifebiosystems.com> wrote:

>
> Hi: Gurus, I am attaching two separate style sheets one for a page and one
> for the panel.
>
> I am attaching the style sheets in my Java code  like this
>
>  add(new StyleSheetReference("stylesheet", PBNASLogin.class, "login.css"));
> //in page constructor
>
>  add(new StyleSheetReference("stylesheetPanel", RegisteredUserPanel.class,
> "register.css")); //in panel constructor
>
> here is the html mark up for page and panel respectively
>
> <link wicket:id="stylesheet"/>
> <link wicket:id="stylesheetPanel"/>
>
> but when I run the code I got the following wicket error
>
> The component(s) below failed to render. A common problem is that you have
> added a component in code but forgot to reference it in the markup (thus
> the
> component will never be rendered)
>
> My question is that is it possible to add 2 separate style sheets in a
> parent child markup, if yes, what is the root cause of the above error.
>
> Thanks,
> RJ.
> --
> View this message in context:
> http://www.nabble.com/sepearte-stylesheet-refrences-for-page-and-panel-tp22088667p22088667.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>