You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Ian Marshall <Ia...@GMail.com> on 2011/09/14 15:14:10 UTC

Successor to StyleSheetReference in 1.5

Hello there,

Most of my web pages descend from my class PageBase, which itself descends
from WebPage.

In 1.4, these pages accessed my CSS file (in the same folder as my file
ResourcesLocator.java) by using the code given below.

I have looked, but cannot see how to do this in 1.5 (where
StyleSheetReference disappears).

I would appreciate any help.

Regards,

Ian


HTML
----
  ...
  <html xmlns:wicket>
    <wicket:head>
      <link wicket:id="stylesheet" rel="stylesheet" type="text/css"
href="style.css"/>
      ...
    </wicket:head>
    ...
  </html>


Java (in a PageBase constructor)
--------------------------------
  add(new StyleSheetReference("stylesheet", ResourcesLocator.class,
"style.css"));

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Successor-to-StyleSheetReference-in-1-5-tp3812796p3812796.html
Sent from the Users forum 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: Successor to StyleSheetReference in 1.5

Posted by Ian Marshall <Ia...@GMail.com>.
Thanks Martin.

I shall try

  CssResourceReference rrefCSS = new CssResourceReference(
   ResourcesLocator.class, "style.css");
  ResourceLink<CssResourceReference> rlnkCSS =
   new ResourceLink<CssResourceReference>("stylesheet", rrefCSS);
  add(rlnkCSS);

in order to keep my HTML mark-up unchanged. If this does not work, I shall
look into overriding my page's renderHead(...) method (and removing the
relevant part of my HTML mark-up?) as shown in the /Migration guide/.

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Successor-to-StyleSheetReference-in-1-5-tp3812796p3812963.html
Sent from the Users forum 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: Successor to StyleSheetReference in 1.5

Posted by Martin Grigorov <mg...@apache.org>.
https://cwiki.apache.org/confluence/display/WICKET/Migration+to+Wicket+1.5#MigrationtoWicket1.5-RemovedHeaderContributorandfriends.

On Wed, Sep 14, 2011 at 4:19 PM, Martin Grigorov <mg...@apache.org> wrote:
> https://cwiki.apache.org/confluence/display/WICKET/Migration+to+Wicket+1.5#MigrationtoWicket1.5-HeaderContribution
>
> On Wed, Sep 14, 2011 at 4:14 PM, Ian Marshall <Ia...@gmail.com> wrote:
>> Hello there,
>>
>> Most of my web pages descend from my class PageBase, which itself descends
>> from WebPage.
>>
>> In 1.4, these pages accessed my CSS file (in the same folder as my file
>> ResourcesLocator.java) by using the code given below.
>>
>> I have looked, but cannot see how to do this in 1.5 (where
>> StyleSheetReference disappears).
>>
>> I would appreciate any help.
>>
>> Regards,
>>
>> Ian
>>
>>
>> HTML
>> ----
>>  ...
>>  <html xmlns:wicket>
>>    <wicket:head>
>>      <link wicket:id="stylesheet" rel="stylesheet" type="text/css"
>> href="style.css"/>
>>      ...
>>    </wicket:head>
>>    ...
>>  </html>
>>
>>
>> Java (in a PageBase constructor)
>> --------------------------------
>>  add(new StyleSheetReference("stylesheet", ResourcesLocator.class,
>> "style.css"));
>>
>> --
>> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Successor-to-StyleSheetReference-in-1-5-tp3812796p3812796.html
>> Sent from the Users forum 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
>>
>>
>
>
>
> --
> Martin Grigorov
> jWeekend
> Training, Consulting, Development
> http://jWeekend.com
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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


Re: Successor to StyleSheetReference in 1.5

Posted by Martin Grigorov <mg...@apache.org>.
https://cwiki.apache.org/confluence/display/WICKET/Migration+to+Wicket+1.5#MigrationtoWicket1.5-HeaderContribution

On Wed, Sep 14, 2011 at 4:14 PM, Ian Marshall <Ia...@gmail.com> wrote:
> Hello there,
>
> Most of my web pages descend from my class PageBase, which itself descends
> from WebPage.
>
> In 1.4, these pages accessed my CSS file (in the same folder as my file
> ResourcesLocator.java) by using the code given below.
>
> I have looked, but cannot see how to do this in 1.5 (where
> StyleSheetReference disappears).
>
> I would appreciate any help.
>
> Regards,
>
> Ian
>
>
> HTML
> ----
>  ...
>  <html xmlns:wicket>
>    <wicket:head>
>      <link wicket:id="stylesheet" rel="stylesheet" type="text/css"
> href="style.css"/>
>      ...
>    </wicket:head>
>    ...
>  </html>
>
>
> Java (in a PageBase constructor)
> --------------------------------
>  add(new StyleSheetReference("stylesheet", ResourcesLocator.class,
> "style.css"));
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Successor-to-StyleSheetReference-in-1-5-tp3812796p3812796.html
> Sent from the Users forum 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
>
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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