Re: Style Sheet in page head

2016-07-17 Thread Martin Grigorov
Fixed with https://issues.apache.org/jira/browse/WICKET-6204
Thank you for the report, investigation and the pull request!

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Thu, Jul 7, 2016 at 4:12 PM, Peter Henderson  wrote:

> On Thu, Jul 7, 2016 at 2:02 PM, Francois Meillet <
> francois.meil...@gmail.com
> > wrote:
>
> > If you look at what is sent by Wicket   (open the Wicket Ajax Debug panel
> > or use a debugging proxy like Charles Proxy),
> > you will see
> >
> >
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> >
> >
> > The id and type with null value are just extrapolated and added by tools
> > (firebugs and so on), but are not in the html page.
> >
>
> Beautiful.
>
> The wicket server side code creates the correct response. The problem lies
> in
> wicket-ajax-jquery.js line 2121
>
> // copy required attributes
> css.id = node.getAttribute("id");
> css.rel = node.getAttribute("rel");
> css.href = node.getAttribute("href");
> css.type = node.getAttribute("type");
>
> // add element to head
> Wicket.Head.addElement(css);
>
> This code assumes the header item has attributes "id" and "type" and
> blindly adds them to the new DOM.
>
> Thanks François
>
>
>
>
>
>
>
> > François
> >
> >
> >
> > > Le 7 juil. 2016 à 13:12, Peter Henderson 
> > a écrit :
> > >
> > > Thanks François
> > >
> > >
> > >
> > > On Thu, Jul 7, 2016 at 11:51 AM, Francois Meillet <
> > > francois.meil...@gmail.com > wrote:
> > >
> > >> You don't define id and type so there are null.
> > >>
> > >> just add id="yourid" type="text/css"
> > >>
> > >> 
> > >>   type="text/css"/>
> > >> 
> > >>
> > >>
> > > Although MDN shows examples without an id or type [1].
> > > The examples shown by the  html5 standards [2] page also don't have
> type
> > > and id for style sheets.
> > >
> > >
> > >
> > > [1]
> > https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#Examples
> <
> > https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#Examples>
> > > [2]https://www.w3.org/TR/html5/document-metadata.html#the-link-element
> <
> > https://www.w3.org/TR/html5/document-metadata.html#the-link-element>
> > >
> > >
> > >
> > >
> > >> François
> > >>
> > >>
> > >>
> > >>> Le 7 juil. 2016 à 12:24, Peter Henderson <
> peter.hender...@starjar.com>
> > >> a écrit :
> > >>>
> > >>> Hello,
> > >>>
> > >>>
> > >>> I might have found a small bug.
> > >>>
> > >>> I have a control which has a style sheet link in its head section.
> > >>> This control is used within a ListView but is initially hidden.
> > >>> An ajax action causes the control to become visible.
> > >>>
> > >>> The style sheet link added to the page head looks malformed.
> > >>>
> > >>> 
> > >>> 
> > >>> 
> > >>>
> > >>> Full page reload corrects the header link.
> > >>>
> > >>> 
> > >>> 
> > >>> 
> > >>>
> > >>> Am I doing something wrong or is this a bug?
> > >>>
> > >>>
> > >>> I've created a quick start which is available
> > >>> https://github.com/bollinger/wicket-style-bug
> > >>>
> > >>>
> > >>> Thanks
> > >>>
> > >>> --
> > >>> Peter Henderson
> > >>>
> > >>> Director
> > >>> Starjar Ltd.
> > >>> www.starjar.com
> > >>> 0330 088 1662
> > >>
> > >>
> > >> -
> > >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org  > users-unsubscr...@wicket.apache.org>
> > >> For additional commands, e-mail: users-h...@wicket.apache.org
>  > users-h...@wicket.apache.org>
> > >>
> > >>
> > >
> > >
> > > --
> > > Peter Henderson
> > >
> > > Director
> > > Starjar Ltd.
> > > www.starjar.com 
> > > 0330 088 1662
> >
> >
>
>
> --
> Peter Henderson
>
> Director
> Starjar Ltd.
> www.starjar.com
> 0330 088 1662
>


Re: Style Sheet in page head

2016-07-07 Thread Peter Henderson
On Thu, Jul 7, 2016 at 2:02 PM, Francois Meillet  wrote:

> If you look at what is sent by Wicket   (open the Wicket Ajax Debug panel
> or use a debugging proxy like Charles Proxy),
> you will see
>
>
> 
> 
> 
> 
> 
> 
> 
> 
>
>
> The id and type with null value are just extrapolated and added by tools
> (firebugs and so on), but are not in the html page.
>

Beautiful.

The wicket server side code creates the correct response. The problem lies
in
wicket-ajax-jquery.js line 2121

// copy required attributes
css.id = node.getAttribute("id");
css.rel = node.getAttribute("rel");
css.href = node.getAttribute("href");
css.type = node.getAttribute("type");

// add element to head
Wicket.Head.addElement(css);

This code assumes the header item has attributes "id" and "type" and
blindly adds them to the new DOM.

Thanks François







> François
>
>
>
> > Le 7 juil. 2016 à 13:12, Peter Henderson 
> a écrit :
> >
> > Thanks François
> >
> >
> >
> > On Thu, Jul 7, 2016 at 11:51 AM, Francois Meillet <
> > francois.meil...@gmail.com > wrote:
> >
> >> You don't define id and type so there are null.
> >>
> >> just add id="yourid" type="text/css"
> >>
> >> 
> >>  
> >> 
> >>
> >>
> > Although MDN shows examples without an id or type [1].
> > The examples shown by the  html5 standards [2] page also don't have type
> > and id for style sheets.
> >
> >
> >
> > [1]
> https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#Examples <
> https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#Examples>
> > [2]https://www.w3.org/TR/html5/document-metadata.html#the-link-element <
> https://www.w3.org/TR/html5/document-metadata.html#the-link-element>
> >
> >
> >
> >
> >> François
> >>
> >>
> >>
> >>> Le 7 juil. 2016 à 12:24, Peter Henderson 
> >> a écrit :
> >>>
> >>> Hello,
> >>>
> >>>
> >>> I might have found a small bug.
> >>>
> >>> I have a control which has a style sheet link in its head section.
> >>> This control is used within a ListView but is initially hidden.
> >>> An ajax action causes the control to become visible.
> >>>
> >>> The style sheet link added to the page head looks malformed.
> >>>
> >>> 
> >>> 
> >>> 
> >>>
> >>> Full page reload corrects the header link.
> >>>
> >>> 
> >>> 
> >>> 
> >>>
> >>> Am I doing something wrong or is this a bug?
> >>>
> >>>
> >>> I've created a quick start which is available
> >>> https://github.com/bollinger/wicket-style-bug
> >>>
> >>>
> >>> Thanks
> >>>
> >>> --
> >>> Peter Henderson
> >>>
> >>> Director
> >>> Starjar Ltd.
> >>> www.starjar.com
> >>> 0330 088 1662
> >>
> >>
> >> -
> >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org  users-unsubscr...@wicket.apache.org>
> >> For additional commands, e-mail: users-h...@wicket.apache.org  users-h...@wicket.apache.org>
> >>
> >>
> >
> >
> > --
> > Peter Henderson
> >
> > Director
> > Starjar Ltd.
> > www.starjar.com 
> > 0330 088 1662
>
>


-- 
Peter Henderson

Director
Starjar Ltd.
www.starjar.com
0330 088 1662


Re: Style Sheet in page head

2016-07-07 Thread Francois Meillet
If you look at what is sent by Wicket   (open the Wicket Ajax Debug panel or 
use a debugging proxy like Charles Proxy),
you will see 












The id and type with null value are just extrapolated and added by tools 
(firebugs and so on), but are not in the html page.

François



> Le 7 juil. 2016 à 13:12, Peter Henderson  a 
> écrit :
> 
> Thanks François
> 
> 
> 
> On Thu, Jul 7, 2016 at 11:51 AM, Francois Meillet <
> francois.meil...@gmail.com > wrote:
> 
>> You don't define id and type so there are null.
>> 
>> just add id="yourid" type="text/css"
>> 
>> 
>>  
>> 
>> 
>> 
> Although MDN shows examples without an id or type [1].
> The examples shown by the  html5 standards [2] page also don't have type
> and id for style sheets.
> 
> 
> 
> [1]https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#Examples 
> 
> [2]https://www.w3.org/TR/html5/document-metadata.html#the-link-element 
> 
> 
> 
> 
> 
>> François
>> 
>> 
>> 
>>> Le 7 juil. 2016 à 12:24, Peter Henderson 
>> a écrit :
>>> 
>>> Hello,
>>> 
>>> 
>>> I might have found a small bug.
>>> 
>>> I have a control which has a style sheet link in its head section.
>>> This control is used within a ListView but is initially hidden.
>>> An ajax action causes the control to become visible.
>>> 
>>> The style sheet link added to the page head looks malformed.
>>> 
>>> 
>>> 
>>> 
>>> 
>>> Full page reload corrects the header link.
>>> 
>>> 
>>> 
>>> 
>>> 
>>> Am I doing something wrong or is this a bug?
>>> 
>>> 
>>> I've created a quick start which is available
>>> https://github.com/bollinger/wicket-style-bug
>>> 
>>> 
>>> Thanks
>>> 
>>> --
>>> Peter Henderson
>>> 
>>> Director
>>> Starjar Ltd.
>>> www.starjar.com
>>> 0330 088 1662
>> 
>> 
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org 
>> 
>> For additional commands, e-mail: users-h...@wicket.apache.org 
>> 
>> 
>> 
> 
> 
> -- 
> Peter Henderson
> 
> Director
> Starjar Ltd.
> www.starjar.com 
> 0330 088 1662



Re: Style Sheet in page head

2016-07-07 Thread Peter Henderson
Thanks François



On Thu, Jul 7, 2016 at 11:51 AM, Francois Meillet <
francois.meil...@gmail.com> wrote:

> You don't define id and type so there are null.
>
> just add id="yourid" type="text/css"
>
> 
>   
> 
>
>
Although MDN shows examples without an id or type [1].
The examples shown by the  html5 standards [2] page also don't have type
and id for style sheets.



[1]https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#Examples
[2]https://www.w3.org/TR/html5/document-metadata.html#the-link-element




> François
>
>
>
> > Le 7 juil. 2016 à 12:24, Peter Henderson 
> a écrit :
> >
> > Hello,
> >
> >
> > I might have found a small bug.
> >
> > I have a control which has a style sheet link in its head section.
> > This control is used within a ListView but is initially hidden.
> > An ajax action causes the control to become visible.
> >
> > The style sheet link added to the page head looks malformed.
> >
> > 
> >  
> > 
> >
> > Full page reload corrects the header link.
> >
> > 
> >  
> > 
> >
> > Am I doing something wrong or is this a bug?
> >
> >
> > I've created a quick start which is available
> > https://github.com/bollinger/wicket-style-bug
> >
> >
> > Thanks
> >
> > --
> > Peter Henderson
> >
> > Director
> > Starjar Ltd.
> > www.starjar.com
> > 0330 088 1662
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


-- 
Peter Henderson

Director
Starjar Ltd.
www.starjar.com
0330 088 1662


Re: Style Sheet in page head

2016-07-07 Thread Francois Meillet
You don't define id and type so there are null.

just add id="yourid" type="text/css"


  


François



> Le 7 juil. 2016 à 12:24, Peter Henderson  a 
> écrit :
> 
> Hello,
> 
> 
> I might have found a small bug.
> 
> I have a control which has a style sheet link in its head section.
> This control is used within a ListView but is initially hidden.
> An ajax action causes the control to become visible.
> 
> The style sheet link added to the page head looks malformed.
> 
> 
>  
> 
> 
> Full page reload corrects the header link.
> 
> 
>  
> 
> 
> Am I doing something wrong or is this a bug?
> 
> 
> I've created a quick start which is available
> https://github.com/bollinger/wicket-style-bug
> 
> 
> Thanks
> 
> -- 
> Peter Henderson
> 
> Director
> Starjar Ltd.
> www.starjar.com
> 0330 088 1662


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



Style Sheet in page head

2016-07-07 Thread Peter Henderson
Hello,


I might have found a small bug.

I have a control which has a style sheet link in its head section.
This control is used within a ListView but is initially hidden.
An ajax action causes the control to become visible.

The style sheet link added to the page head looks malformed.


  


Full page reload corrects the header link.


  


Am I doing something wrong or is this a bug?


I've created a quick start which is available
https://github.com/bollinger/wicket-style-bug


Thanks

-- 
Peter Henderson

Director
Starjar Ltd.
www.starjar.com
0330 088 1662