You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by ha...@dds.nl on 2013/08/20 16:23:22 UTC

problem header contribution with ajax

Dear wicket-users,

I notice that a header contribution by a panel is not rendered in the  
following case. An inline CSS in the head section is first rendered by  
switching tabs

<header-contribution encoding="wicket1" ><![CDATA[<head  
xmlns:wicket="http://wicket.apache.org"><script type="text/javascript"  
src="./wicket/resource/org.apache.wicket.resource.JQueryResourceReference/jquery/jquery-1.10.1-ver-1377004856000.js">...
<style type="text/css" id="custom-widget-stylesheet"><!--
.multi.box .header h2 {
     margin: 0;
     padding: 0;
     font-size: 15px;
}--></style>
</head>]]></header-contribution>

when i rerender the panel with a slighty different header  
contribution, then panel is rerendered but the header contribution is  
not picked up.

<?xml version="1.0" encoding="UTF-8"?><ajax-response><component  
id="style.widget.titel" ><![CDATA[<input wicket:id="counter"  
type="text" value="16" data-max="500" data-min="350"  
data-default="460" name="stijlPanel:titelCounter:counter"  
id="style.widget.titel">]]></component><header-contribution><![CDATA[<head  
xmlns:wicket="http://wicket.apache.org"><style type="text/css"  
id="custom-widget-stylesheet"><!--
.multi.box .header h2 {
     margin: 0;
     padding: 0;
     font-size: 16px;
}--></style>
</head>]]></header-contribution></ajax-response>

Has anyone ideas how to debug this? Is it not possible to replace a  
header contribution with the same ID?

thanks in advance,

Haiko




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


Re: problem header contribution with ajax

Posted by Martin Grigorov <mg...@apache.org>.
It could be in the <head>.
Try it.


On Wed, Aug 21, 2013 at 11:24 AM, <ha...@dds.nl> wrote:

> Martin,
>
>
>  <style wicket:id="myStyle"></style>
>> ...
>> add(mystyle = new Label("myStyle", content))
>> ...
>> target.add(mystyle)
>>
>>
> The label should be then placed in the body section, right?
> Is this possible?
>
>
> Haiko
>
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: users-unsubscribe@wicket.**apache.org<us...@wicket.apache.org>
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: problem header contribution with ajax

Posted by ha...@dds.nl.
Martin,

> <style wicket:id="myStyle"></style>
> ...
> add(mystyle = new Label("myStyle", content))
> ...
> target.add(mystyle)
>

The label should be then placed in the body section, right?
Is this possible?

Haiko


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


Re: problem header contribution with ajax

Posted by Martin Grigorov <mg...@apache.org>.
Hi,

<style wicket:id="myStyle"></style>
...
add(mystyle = new Label("myStyle", content))
...
target.add(mystyle)


On Tue, Aug 20, 2013 at 7:13 PM, <ha...@dds.nl> wrote:

>
> Martin Grigorov <mg...@apache.org> schreef:
>
> Hi Martin,
>
> Thanks for your quick answer.
>
>
>
>> You cannot replace header contributions with the same HTML id attribute.
>> Wicket checks whether the contribution is already in the page and ignores
>> it.
>>
>
> Ok, that explains a lot.
>
>
>
>> You can use normal Label component to be able to replace it in Ajax
>> responses.
>>
>
> I am not fully understanding this, could you give more detail about the
> suggested solution?
>
> thanks,
>
>
> Haiko
>
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: users-unsubscribe@wicket.**apache.org<us...@wicket.apache.org>
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: problem header contribution with ajax

Posted by ha...@dds.nl.
Martin Grigorov <mg...@apache.org> schreef:

Hi Martin,

Thanks for your quick answer.

>
> You cannot replace header contributions with the same HTML id attribute.
> Wicket checks whether the contribution is already in the page and ignores
> it.

Ok, that explains a lot.

>
> You can use normal Label component to be able to replace it in Ajax
> responses.

I am not fully understanding this, could you give more detail about  
the suggested solution?

thanks,

Haiko


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


Re: problem header contribution with ajax

Posted by Martin Grigorov <mg...@apache.org>.
Hi,

You cannot replace header contributions with the same HTML id attribute.
Wicket checks whether the contribution is already in the page and ignores
it.

You can use normal Label component to be able to replace it in Ajax
responses.


On Tue, Aug 20, 2013 at 5:23 PM, <ha...@dds.nl> wrote:

>
> Dear wicket-users,
>
> I notice that a header contribution by a panel is not rendered in the
> following case. An inline CSS in the head section is first rendered by
> switching tabs
>
> <header-contribution encoding="wicket1" ><![CDATA[<head xmlns:wicket="
> http://wicket.**apache.org <http://wicket.apache.org>"><script
> type="text/javascript" src="./wicket/resource/org.**
> apache.wicket.resource.**JQueryResourceReference/**
> jquery/jquery-1.10.1-ver-**1377004856000.js">...
> <style type="text/css" id="custom-widget-stylesheet">**<!--
> .multi.box .header h2 {
>     margin: 0;
>     padding: 0;
>     font-size: 15px;
> }--></style>
> </head>]]></header-**contribution>
>
> when i rerender the panel with a slighty different header contribution,
> then panel is rerendered but the header contribution is not picked up.
>
> <?xml version="1.0" encoding="UTF-8"?><ajax-**response><component
> id="style.widget.titel" ><![CDATA[<input wicket:id="counter" type="text"
> value="16" data-max="500" data-min="350" data-default="460"
> name="stijlPanel:titelCounter:**counter" id="style.widget.titel">]]></**
> component><header-**contribution><![CDATA[<head xmlns:wicket="
> http://wicket.**apache.org <http://wicket.apache.org>"><style
> type="text/css" id="custom-widget-stylesheet">**<!--
> .multi.box .header h2 {
>     margin: 0;
>     padding: 0;
>     font-size: 16px;
> }--></style>
> </head>]]></header-**contribution></ajax-response>
>
> Has anyone ideas how to debug this? Is it not possible to replace a header
> contribution with the same ID?
>
> thanks in advance,
>
> Haiko
>
>
>
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: users-unsubscribe@wicket.**apache.org<us...@wicket.apache.org>
> For additional commands, e-mail: users-help@wicket.apache.org
>
>