You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by "Dr. Wolf Blecher" <wo...@itk-engineering.de> on 2010/06/22 09:51:48 UTC
body-tag onLoad/onScroll
Hi all,
I have the following situation:
I want to add a java script function call to the body tag which get's as
parameter the id of a wicket panel:
<body onload="javascript: initPosition('sidebarRightSelection65');"
onscroll="javascript: sideBarRightPos('sidebarRightSelection65');">
So I tried the following:
add(new BodyTagAttributeModifier("onload", true, new Model("javascript:
initPosition('" + selection.getMarkupId() + "');"), selection));
I also let the Panel implement the IHeaderContributor Interface but this did
not work either.
Neither way worked.
What I want to basically achieve is that if the element is scrolled out of the
page, its style will be set to fixed, so that keeps shown. I have a javascript
function for this, but this function needs the id of the element.
Any hints?
Cheers
Wolf
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: body-tag onLoad/onScroll
Posted by Jeremy Thomerson <je...@wickettraining.com>.
And in that webmarkupcontainer, override istransparentresolverand return
true.
That will allow you to add components directly to the page without having to
add them all to the body's web markup container.
Jeremy Thomerson
-- sent from my smartphone - please excuse formatting and spelling errors
On Jun 22, 2010 5:00 AM, "Martin Grigorov" <mc...@e-card.bg> wrote:
Make <body> a regular Wicket component: <body wicket:id="theBody">
Then in .java:
WebMarkupContainer body = new WebMarkupContainer("theBody");
body.add(new (Simple)AttributeModifier(....))
afair <body> is no more special element.
On Tue, 2010-06-22 at 09:51 +0200, Dr. Wolf Blecher wrote:
> Hi all,
>
> I have the following situ...
Re: body-tag onLoad/onScroll
Posted by Martin Grigorov <mc...@e-card.bg>.
Make <body> a regular Wicket component: <body wicket:id="theBody">
Then in .java:
WebMarkupContainer body = new WebMarkupContainer("theBody");
body.add(new (Simple)AttributeModifier(....))
afair <body> is no more special element.
On Tue, 2010-06-22 at 09:51 +0200, Dr. Wolf Blecher wrote:
> Hi all,
>
> I have the following situation:
> I want to add a java script function call to the body tag which get's as
> parameter the id of a wicket panel:
>
> <body onload="javascript: initPosition('sidebarRightSelection65');"
> onscroll="javascript: sideBarRightPos('sidebarRightSelection65');">
>
> So I tried the following:
>
> add(new BodyTagAttributeModifier("onload", true, new Model("javascript:
> initPosition('" + selection.getMarkupId() + "');"), selection));
>
> I also let the Panel implement the IHeaderContributor Interface but this did
> not work either.
>
> Neither way worked.
>
> What I want to basically achieve is that if the element is scrolled out of the
> page, its style will be set to fixed, so that keeps shown. I have a javascript
> function for this, but this function needs the id of the element.
>
> Any hints?
>
> Cheers
>
> Wolf
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org