Re: onload event on img-tag

2012-05-29 Thread Pasithee Jupiter
Thanks a lot. That works like a charm.

cheers


On Mon, May 28, 2012 at 9:02 AM, Martin Grigorov mgrigo...@apache.orgwrote:

 Hi,

 Do something like:
 img = new NonCachingImage(...);
 img.add(new AttributeModifier(onload, yourStuffHere));
 form.add(img);

 On Mon, May 28, 2012 at 1:21 AM, Pasithee Jupiter pasit...@gmail.com
 wrote:
  Hi all
 
 
  How can i add the onload attribute to an image? or is it possible to
  prevent wicket overwriting html attributes on the img-tag?
 
 
  In my HTML I have a form, and inside the form an img and several input
  fields and a button. Click on the button triggers an ajax request and
  returns new form values and a new NonCachingImage. So my goal is to run
  some javascript after the image is loaded means img ...
  onload=javascript:abc();. How can I do that with wicket?
 
 
  Thanks a lot



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

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




Re: onload event on img-tag

2012-05-28 Thread Martin Grigorov
Hi,

Do something like:
img = new NonCachingImage(...);
img.add(new AttributeModifier(onload, yourStuffHere));
form.add(img);

On Mon, May 28, 2012 at 1:21 AM, Pasithee Jupiter pasit...@gmail.com wrote:
 Hi all


 How can i add the onload attribute to an image? or is it possible to
 prevent wicket overwriting html attributes on the img-tag?


 In my HTML I have a form, and inside the form an img and several input
 fields and a button. Click on the button triggers an ajax request and
 returns new form values and a new NonCachingImage. So my goal is to run
 some javascript after the image is loaded means img ...
 onload=javascript:abc();. How can I do that with wicket?


 Thanks a lot



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

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



onload event on img-tag

2012-05-27 Thread Pasithee Jupiter
Hi all


How can i add the onload attribute to an image? or is it possible to
prevent wicket overwriting html attributes on the img-tag?


In my HTML I have a form, and inside the form an img and several input
fields and a button. Click on the button triggers an ajax request and
returns new form values and a new NonCachingImage. So my goal is to run
some javascript after the image is loaded means img ...
onload=javascript:abc();. How can I do that with wicket?


Thanks a lot


AjaxEventBehaviour on page onload

2011-03-03 Thread drf
I wonder if anyone can help with the following:
I've added this code to a the constructor of a WebPage:

this.add(new AjaxEventBehavior(onload) {

@Override
protected void onEvent(AjaxRequestTarget target) {
System.out.println( IN on-LOAD);
}
});

Am expecting the event to be called when the page loads, but it is not.
Here is the snippet for the page head:



VCF



Any ideas are appreciated!

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/AjaxEventBehaviour-on-page-onload-tp618p618.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: AjaxEventBehaviour on page onload

2011-03-03 Thread Pedro Santos
You can implement an IHeaderContributor:

http://wicket.apache.org/apidocs/1.4/org/apache/wicket/markup/html/IHeaderContributor.html
http://wicket.apache.org/apidocs/1.4/org/apache/wicket/markup/html/IHeaderResponse.html#renderOnLoadJavascript(java.lang.String)
http://wicket.apache.org/apidocs/1.4/org/apache/wicket/markup/html/IHeaderResponse.html#renderOnLoadJavascript(java.lang.String)
On Thu, Mar 3, 2011 at 1:00 PM, drf davidrfi...@gmail.com wrote:

 I wonder if anyone can help with the following:
 I've added this code to a the constructor of a WebPage:

this.add(new AjaxEventBehavior(onload) {

@Override
protected void onEvent(AjaxRequestTarget target) {
System.out.println( IN
 on-LOAD);
}
});

 Am expecting the event to be called when the page loads, but it is not.
 Here is the snippet for the page head:



VCF



 Any ideas are appreciated!

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/AjaxEventBehaviour-on-page-onload-tp618p618.html
 Sent from the Users forum mailing list archive at Nabble.com.

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




-- 
Pedro Henrique Oliveira dos Santos


Ajax like event for onLoad

2011-02-16 Thread Brown, Berlin [GCG-PFS]
I am using the Ajax Tabbed Panel class and I could possibly hijack the
onUpdate/onClick routines to suit my needs. 
 
But I was curious, is there an event/behavior  that I can call when a
panel loads or render.
 
Something along the lines of:
 
SomeAjaxPanel {
  onBeforeRender() {
this.add(AjaxBehavior(onload') {
  onEvent(target) {
 
  }
   }
  }
 
}


Re: Ajax like event for onLoad

2011-02-16 Thread Martin Grigorov
AjaxEventBehavior

On Wed, Feb 16, 2011 at 5:41 PM, Brown, Berlin [GCG-PFS] 
berlin.br...@primerica.com wrote:

 I am using the Ajax Tabbed Panel class and I could possibly hijack the
 onUpdate/onClick routines to suit my needs.

 But I was curious, is there an event/behavior  that I can call when a
 panel loads or render.

 Something along the lines of:

 SomeAjaxPanel {
  onBeforeRender() {
this.add(AjaxBehavior(onload') {
  onEvent(target) {
 
  }
   }
  }

 }



onload

2010-09-23 Thread Ole Hansen
Hi,

Newbee question: I need to add the onload attribute to the body tag (I
can't use other methods to accomplish the same thing...)

My html:
html xmlns=http://www.w3.org/1999/xhtml;
xmlns:wicket=http://org.apache.wicket.sourceforge.net/; 
wicket:head
...
/wicket:head
wicket:extend
body wicket:id=bodyElement
...
/body
/wicket:extend
/html

Java:
WebMarkupContainer body = new WebMarkupContainer(bodyElement);

add(new WebMarkupContainer(bodyElement) {
�...@override
 public boolean isTransparentResolver() {
   return true;
 }
�...@override
 protected void onComponentTag(final ComponentTag tag) {
   super.onComponentTag(tag);
   tag.put(onload, onload(););
 }
});

Result html:
html
head
...
/head
body
body onload=onload();
...

I now have two body start tags.
The code below results in a runtime exception stating that bodyElement
was not declared..

body wicket:id=bodyElement
wicket:extend
...
/wicket:extend
/body
/html

I have also tried adding:
add(new BodyTagAttributeModifier(onload, true, new Model(onload();), this));

But nothing gets added to the body tag.

Can someone direct me in the right direction?


Wicket version: 1.4.1
JDK: IBM JDK 5.0.10

Regards,
Jess

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



onload

2010-09-23 Thread Ole Hansen
Hi,

Newbee question: I need to add the onload attribute to the body tag (I
can't use other methods to accomplish the same thing...)

My html:
html
wicket:head
...
/wicket:head
wicket:extend
body wicket:id=bodyElement
...
/body
/wicket:extend
/html

Java:
WebMarkupContainer body = new WebMarkupContainer(bodyElement);

add(new WebMarkupContainer(bodyElement) {
�...@override
 public boolean isTransparentResolver() {
   return true;
 }
�...@override
 protected void onComponentTag(final ComponentTag tag) {
   super.onComponentTag(tag);
   tag.put(onload, onload(););
 }
});

Result html:
html
head
...
/head
body
body onload=onload();
...

I now have two body start tags.
The code below results in a runtime exception stating that bodyElement
was not declared..

body wicket:id=bodyElement
wicket:extend
...
/wicket:extend
/body
/html

I have also tried adding:
add(new BodyTagAttributeModifier(onload, true, new Model(onload();), this));

But nothing gets added to the body tag.

Can someone direct me in the right direction?


Wicket version: 1.4.1
JDK: IBM JDK 5.0.10

Regards,
Jess

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



Re: onload

2010-09-23 Thread Martin Grigorov
Why do you have two components on bodyElement ?

WebMarkupContainer body = new WebMarkupContainer(bodyElement);

add(new WebMarkupContainer(bodyElement) {

On Thu, Sep 23, 2010 at 11:00 AM, Ole Hansen ssej1...@gmail.com wrote:

 Hi,

 Newbee question: I need to add the onload attribute to the body tag (I
 can't use other methods to accomplish the same thing...)

 My html:
 html
 wicket:head
 ...
 /wicket:head
 wicket:extend
 body wicket:id=bodyElement
 ...
 /body
 /wicket:extend
 /html

 Java:
 WebMarkupContainer body = new WebMarkupContainer(bodyElement);

 add(new WebMarkupContainer(bodyElement) {
  @Override
  public boolean isTransparentResolver() {
return true;
  }
  @Override
  protected void onComponentTag(final ComponentTag tag) {
super.onComponentTag(tag);
tag.put(onload, onload(););
  }
 });

 Result html:
 html
 head
 ...
 /head
 body
 body onload=onload();
 ...

 I now have two body start tags.
 The code below results in a runtime exception stating that bodyElement
 was not declared..

 body wicket:id=bodyElement
 wicket:extend
 ...
 /wicket:extend
 /body
 /html

 I have also tried adding:
 add(new BodyTagAttributeModifier(onload, true, new Model(onload();),
 this));

 But nothing gets added to the body tag.

 Can someone direct me in the right direction?


 Wicket version: 1.4.1
 JDK: IBM JDK 5.0.10

 Regards,
 Jess

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




Re: onload

2010-09-23 Thread Ole Hansen
Hi,

2010/9/23 Martin Grigorov mgrigo...@apache.org:
 Why do you have two components on bodyElement ?

 WebMarkupContainer body = new WebMarkupContainer(bodyElement);

Yes it is redundant, but dosent seem to make a difference weather it
is there or not.


Thanks,
Jess


 add(new WebMarkupContainer(bodyElement) {

 On Thu, Sep 23, 2010 at 11:00 AM, Ole Hansen ssej1...@gmail.com wrote:

 Hi,

 Newbee question: I need to add the onload attribute to the body tag (I
 can't use other methods to accomplish the same thing...)

 My html:
 html
 wicket:head
 ...
 /wicket:head
 wicket:extend
 body wicket:id=bodyElement
 ...
 /body
 /wicket:extend
 /html

 Java:
 WebMarkupContainer body = new WebMarkupContainer(bodyElement);

 add(new WebMarkupContainer(bodyElement) {
 �...@override
  public boolean isTransparentResolver() {
    return true;
  }
 �...@override
  protected void onComponentTag(final ComponentTag tag) {
    super.onComponentTag(tag);
    tag.put(onload, onload(););
  }
 });

 Result html:
 html
 head
 ...
 /head
 body
 body onload=onload();
 ...

 I now have two body start tags.
 The code below results in a runtime exception stating that bodyElement
 was not declared..

 body wicket:id=bodyElement
 wicket:extend
 ...
 /wicket:extend
 /body
 /html

 I have also tried adding:
 add(new BodyTagAttributeModifier(onload, true, new Model(onload();),
 this));

 But nothing gets added to the body tag.

 Can someone direct me in the right direction?


 Wicket version: 1.4.1
 JDK: IBM JDK 5.0.10

 Regards,
 Jess

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




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



Re: onload

2010-09-23 Thread Ole Hansen
Hi,

2010/9/23 Ole Hansen ssej1...@gmail.com:
 Hi,

 2010/9/23 Martin Grigorov mgrigo...@apache.org:
 Why do you have two components on bodyElement ?

 WebMarkupContainer body = new WebMarkupContainer(bodyElement);

 Yes it is redundant, but dosent seem to make a difference weather it
 is there or not.

No need to look further into this. I messed up.




 Thanks,
 Jess


 add(new WebMarkupContainer(bodyElement) {

 On Thu, Sep 23, 2010 at 11:00 AM, Ole Hansen ssej1...@gmail.com wrote:

 Hi,

 Newbee question: I need to add the onload attribute to the body tag (I
 can't use other methods to accomplish the same thing...)

 My html:
 html
 wicket:head
 ...
 /wicket:head
 wicket:extend
 body wicket:id=bodyElement
 ...
 /body
 /wicket:extend
 /html

 Java:
 WebMarkupContainer body = new WebMarkupContainer(bodyElement);

 add(new WebMarkupContainer(bodyElement) {
 �...@override
  public boolean isTransparentResolver() {
    return true;
  }
 �...@override
  protected void onComponentTag(final ComponentTag tag) {
    super.onComponentTag(tag);
    tag.put(onload, onload(););
  }
 });

 Result html:
 html
 head
 ...
 /head
 body
 body onload=onload();
 ...

 I now have two body start tags.
 The code below results in a runtime exception stating that bodyElement
 was not declared..

 body wicket:id=bodyElement
 wicket:extend
 ...
 /wicket:extend
 /body
 /html

 I have also tried adding:
 add(new BodyTagAttributeModifier(onload, true, new Model(onload();),
 this));

 But nothing gets added to the body tag.

 Can someone direct me in the right direction?


 Wicket version: 1.4.1
 JDK: IBM JDK 5.0.10

 Regards,
 Jess

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





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



Re: Trouble creating a behaviour that adds JS and also a Body onLoad event

2010-07-31 Thread Mark Doyle
Ah ok, I'll test that.  I never thought of just adding it to the Page.


What, if any, is the difference between this and adding the behaviour to the
WebPage which is a kind of Component?


On Fri, Jul 30, 2010 at 7:03 PM, Martin Makundi 
martin.maku...@koodaripalvelut.com wrote:

 Hi!

 You could try this:

 public class HomePage extends WebPage implements IHeaderContributor {
  @Override
  public void renderHead(IHeaderResponse response) {
response.renderOnLoadJavascript(javascript)
  }


 **
 Martin

 2010/7/30 Mark Doyle markjohndo...@googlemail.com:
  Firstly, I'm having some trouble finding a decent behaviour tutorial.  If
  anybody knows of one post a link up.
 
  Now, the problem I am having is creating a behaviour that adds some JS to
  the head and sets an onLoad method.  The JS project instructs users to
 add:
 
  body onload=jsfunctionhere ( options, callback );
 
  but I'm not sure how Wicket supports this.
 
  Any ideas?
 
  Cheers
 

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




Re: Trouble creating a behaviour that adds JS and also a Body onLoad event

2010-07-31 Thread Martin Makundi
Headercontribution can be added to many things ...

2010/7/31 Mark Doyle markjohndo...@googlemail.com:
 Ah ok, I'll test that.  I never thought of just adding it to the Page.


 What, if any, is the difference between this and adding the behaviour to the
 WebPage which is a kind of Component?


 On Fri, Jul 30, 2010 at 7:03 PM, Martin Makundi 
 martin.maku...@koodaripalvelut.com wrote:

 Hi!

 You could try this:

 public class HomePage extends WebPage implements IHeaderContributor {
 �...@override
  public void renderHead(IHeaderResponse response) {
    response.renderOnLoadJavascript(javascript)
  }


 **
 Martin

 2010/7/30 Mark Doyle markjohndo...@googlemail.com:
  Firstly, I'm having some trouble finding a decent behaviour tutorial.  If
  anybody knows of one post a link up.
 
  Now, the problem I am having is creating a behaviour that adds some JS to
  the head and sets an onLoad method.  The JS project instructs users to
 add:
 
  body onload=jsfunctionhere ( options, callback );
 
  but I'm not sure how Wicket supports this.
 
  Any ideas?
 
  Cheers
 

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




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



Re: Trouble creating a behaviour that adds JS and also a Body onLoad event

2010-07-31 Thread Mark Doyle
Yeah, I actually messed up the behaviour because I never noticed the
rendOnLoad method.

I've done as you suggested in the behaviour and then simply added that to
the component.  It works perfectly, thanks Martin.


The progression to more advanced Wicket certainly requires more web specific
knowledge that Wicket has shielded me from in the past :)


On Sat, Jul 31, 2010 at 12:48 PM, Martin Makundi 
martin.maku...@koodaripalvelut.com wrote:

 Headercontribution can be added to many things ...

 2010/7/31 Mark Doyle markjohndo...@googlemail.com:
  Ah ok, I'll test that.  I never thought of just adding it to the Page.
 
 
  What, if any, is the difference between this and adding the behaviour to
 the
  WebPage which is a kind of Component?
 
 
  On Fri, Jul 30, 2010 at 7:03 PM, Martin Makundi 
  martin.maku...@koodaripalvelut.com wrote:
 
  Hi!
 
  You could try this:
 
  public class HomePage extends WebPage implements IHeaderContributor {
   @Override
   public void renderHead(IHeaderResponse response) {
 response.renderOnLoadJavascript(javascript)
   }
 
 
  **
  Martin
 
  2010/7/30 Mark Doyle markjohndo...@googlemail.com:
   Firstly, I'm having some trouble finding a decent behaviour tutorial.
  If
   anybody knows of one post a link up.
  
   Now, the problem I am having is creating a behaviour that adds some JS
 to
   the head and sets an onLoad method.  The JS project instructs users to
  add:
  
   body onload=jsfunctionhere ( options, callback );
  
   but I'm not sure how Wicket supports this.
  
   Any ideas?
  
   Cheers
  
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 

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




Re: Trouble creating a behaviour that adds JS and also a Body onLoad event

2010-07-31 Thread Martin Makundi
Wicket is wicked ;)

**
Martin

2010/7/31 Mark Doyle markjohndo...@googlemail.com:
 Yeah, I actually messed up the behaviour because I never noticed the
 rendOnLoad method.

 I've done as you suggested in the behaviour and then simply added that to
 the component.  It works perfectly, thanks Martin.


 The progression to more advanced Wicket certainly requires more web specific
 knowledge that Wicket has shielded me from in the past :)


 On Sat, Jul 31, 2010 at 12:48 PM, Martin Makundi 
 martin.maku...@koodaripalvelut.com wrote:

 Headercontribution can be added to many things ...

 2010/7/31 Mark Doyle markjohndo...@googlemail.com:
  Ah ok, I'll test that.  I never thought of just adding it to the Page.
 
 
  What, if any, is the difference between this and adding the behaviour to
 the
  WebPage which is a kind of Component?
 
 
  On Fri, Jul 30, 2010 at 7:03 PM, Martin Makundi 
  martin.maku...@koodaripalvelut.com wrote:
 
  Hi!
 
  You could try this:
 
  public class HomePage extends WebPage implements IHeaderContributor {
  �...@override
   public void renderHead(IHeaderResponse response) {
     response.renderOnLoadJavascript(javascript)
   }
 
 
  **
  Martin
 
  2010/7/30 Mark Doyle markjohndo...@googlemail.com:
   Firstly, I'm having some trouble finding a decent behaviour tutorial.
  If
   anybody knows of one post a link up.
  
   Now, the problem I am having is creating a behaviour that adds some JS
 to
   the head and sets an onLoad method.  The JS project instructs users to
  add:
  
   body onload=jsfunctionhere ( options, callback );
  
   but I'm not sure how Wicket supports this.
  
   Any ideas?
  
   Cheers
  
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 

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




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



Trouble creating a behaviour that adds JS and also a Body onLoad event

2010-07-30 Thread Mark Doyle
Firstly, I'm having some trouble finding a decent behaviour tutorial.  If
anybody knows of one post a link up.

Now, the problem I am having is creating a behaviour that adds some JS to
the head and sets an onLoad method.  The JS project instructs users to add:

body onload=jsfunctionhere ( options, callback );

but I'm not sure how Wicket supports this.

Any ideas?

Cheers


Re: Trouble creating a behaviour that adds JS and also a Body onLoad event

2010-07-30 Thread Martin Makundi
Hi!

You could try this:

public class HomePage extends WebPage implements IHeaderContributor {
  @Override
  public void renderHead(IHeaderResponse response) {
response.renderOnLoadJavascript(javascript)
  }


**
Martin

2010/7/30 Mark Doyle markjohndo...@googlemail.com:
 Firstly, I'm having some trouble finding a decent behaviour tutorial.  If
 anybody knows of one post a link up.

 Now, the problem I am having is creating a behaviour that adds some JS to
 the head and sets an onLoad method.  The JS project instructs users to add:

 body onload=jsfunctionhere ( options, callback );

 but I'm not sure how Wicket supports this.

 Any ideas?

 Cheers


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



body-tag onLoad/onScroll

2010-06-22 Thread Dr. Wolf Blecher
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-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: body-tag onLoad/onScroll

2010-06-22 Thread Martin Grigorov
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-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 
 



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



Re: body-tag onLoad/onScroll

2010-06-22 Thread Jeremy Thomerson
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 mcgreg...@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...


onLoad never fires -- is there a bug in 1.4?

2009-02-21 Thread Brill Pappin
I have a panel with which I'm implementing IHeaderContributor and the  
following code:



@Override
public void renderHead(IHeaderResponse response) {
response.renderOnLoadJavascript(alert('test'));
}
...

which output in the HTML:

...
script type=text/javascript src=../../resources/ 
org.apache.wicket.markup.html.WicketEventReference/wicket-event.js/ 
script


script type=text/javascript !--/*--![CDATA[/*!--*/
Wicket.Event.add(window, load, function(event) { alert('test');});
/*--]]*//script
...


However no matter what I seem to do (i've tried this about six  
different way so far) the alert *never* fires (note: my actual script  
is more complex, but I'm using alert to debug).


I've also tried it in both Safari 3.2.1 and Firefox 3.0.6 with the  
same result (i.e. nothing happens)


Is there a known bug in 1.4-SNAPSHOT?
Does anyone else have this working?

- Brill

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



Re: onLoad never fires -- is there a bug in 1.4?

2009-02-21 Thread Brill Pappin

Addendum to my last:
Apparently the simple alert case *is* working in Safari 3.2.1 but *is  
not* in Firefox 3.0.6.


This suggests to me that the script has not been updated for Firefox,  
or that firefox just doesn't support the script (which I find hard to  
believe).


is anyone else using this method of capturing onLoad events?

- Brill

On 21-Feb-09, at 2:14 PM, Brill Pappin wrote:

I have a panel with which I'm implementing IHeaderContributor and  
the following code:



@Override
public void renderHead(IHeaderResponse response) {
response.renderOnLoadJavascript(alert('test'));
   }
...

which output in the HTML:

...
script type=text/javascript src=../../resources/ 
org.apache.wicket.markup.html.WicketEventReference/wicket- 
event.js/script


script type=text/javascript !--/*--![CDATA[/*!--*/
Wicket.Event.add(window, load, function(event) { alert('test');});
/*--]]*//script
...


However no matter what I seem to do (i've tried this about six  
different way so far) the alert *never* fires (note: my actual  
script is more complex, but I'm using alert to debug).


I've also tried it in both Safari 3.2.1 and Firefox 3.0.6 with the  
same result (i.e. nothing happens)


Is there a known bug in 1.4-SNAPSHOT?
Does anyone else have this working?

- Brill



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



Re: onLoad never fires -- is there a bug in 1.4?

2009-02-21 Thread Jason Lea

I wonder if this is related to a bug that was fixed in firefox 3.0.6...

https://bugzilla.mozilla.org/show_bug.cgi?id=444322
Firefox 3 onload and DOMContentLoaded event firing before the page is 
fully loaded


We experienced that problem with Firefox 3.0.5 made a work around for 
it, and then 3.0.6 arrived and fixed it
But there is another bug mentioned in comment #72 
https://bugzilla.mozilla.org/show_bug.cgi?id=444322#c72 which might be 
similar to this problem (even mentions using an alert will cause the 
problem to appear)




Brill Pappin wrote:

Addendum to my last:
Apparently the simple alert case *is* working in Safari 3.2.1 but *is  
not* in Firefox 3.0.6.


This suggests to me that the script has not been updated for Firefox,  
or that firefox just doesn't support the script (which I find hard to  
believe).


is anyone else using this method of capturing onLoad events?

- Brill

On 21-Feb-09, at 2:14 PM, Brill Pappin wrote:

  
I have a panel with which I'm implementing IHeaderContributor and  
the following code:



@Override
public void renderHead(IHeaderResponse response) {
response.renderOnLoadJavascript(alert('test'));
   }
...

which output in the HTML:

...
script type=text/javascript src=../../resources/ 
org.apache.wicket.markup.html.WicketEventReference/wicket- 
event.js/script


script type=text/javascript !--/*--![CDATA[/*!--*/
Wicket.Event.add(window, load, function(event) { alert('test');});
/*--]]*//script
...


However no matter what I seem to do (i've tried this about six  
different way so far) the alert *never* fires (note: my actual  
script is more complex, but I'm using alert to debug).


I've also tried it in both Safari 3.2.1 and Firefox 3.0.6 with the  
same result (i.e. nothing happens)


Is there a known bug in 1.4-SNAPSHOT?
Does anyone else have this working?

- Brill




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


  


--
Jason Lea




Re: onLoad never fires -- is there a bug in 1.4?

2009-02-21 Thread Brill Pappin

Hmm... that could be related.

For the moment I've worked around it in a somewhat kludgy way, but I  
plan to go back and try again with a cleanroom test app as soon as I  
have some time to look into it more.


- Brill


On 21-Feb-09, at 6:18 PM, Jason Lea wrote:

I wonder if this is related to a bug that was fixed in firefox  
3.0.6...


https://bugzilla.mozilla.org/show_bug.cgi?id=444322
Firefox 3 onload and DOMContentLoaded event firing before the page  
is fully loaded


We experienced that problem with Firefox 3.0.5 made a work around  
for it, and then 3.0.6 arrived and fixed it
But there is another bug mentioned in comment #72 https://bugzilla.mozilla.org/show_bug.cgi?id=444322 
#c72 which might be similar to this problem (even mentions using an  
alert will cause the problem to appear)




Brill Pappin wrote:

Addendum to my last:
Apparently the simple alert case *is* working in Safari 3.2.1 but  
*is  not* in Firefox 3.0.6.


This suggests to me that the script has not been updated for  
Firefox,  or that firefox just doesn't support the script (which I  
find hard to  believe).


is anyone else using this method of capturing onLoad events?

- Brill

On 21-Feb-09, at 2:14 PM, Brill Pappin wrote:


I have a panel with which I'm implementing IHeaderContributor and   
the following code:



@Override
public void renderHead(IHeaderResponse response) {
response.renderOnLoadJavascript(alert('test'));
  }
...

which output in the HTML:

...
script type=text/javascript src=../../resources/  
org.apache.wicket.markup.html.WicketEventReference/wicket-  
event.js/script


script type=text/javascript !--/*--![CDATA[/*!--*/
Wicket.Event.add(window, load, function(event) { alert('test');});
/*--]]*//script
...


However no matter what I seem to do (i've tried this about six   
different way so far) the alert *never* fires (note: my actual   
script is more complex, but I'm using alert to debug).


I've also tried it in both Safari 3.2.1 and Firefox 3.0.6 with  
the  same result (i.e. nothing happens)


Is there a known bug in 1.4-SNAPSHOT?
Does anyone else have this working?

- Brill




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





--
Jason Lea





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



onLoad javascript event with Markup inheritance

2008-11-25 Thread itayh

Hi,

I use Markup inheritance in my site in order to keep common logic in the
base page. 
I would like my child pages to do certain javascript actions when they are
loaded. I try to define the the javascript on the childs body (between the
wicket:extend and /wicket:extend) but I don't see them in the generated
page (the base + child page). Any Idea how to generate onLoad javascript
action for child page?
-- 
View this message in context: 
http://www.nabble.com/onLoad-javascript-event-with-Markup-inheritance-tp20681885p20681885.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: onLoad javascript event with Markup inheritance

2008-11-25 Thread Ernesto Reinaldo Barreiro
Something like:

HTML

wicket:extend   script wicket:id=script
type=text/javascriptalert('Hi');/script
  .
/wicket:extend

Java code:

Label script = new Label(script, new ModelString()) {
private static final long serialVersionUID = 1L;

@Override
protected void onComponentTagBody(MarkupStream markupStream, ComponentTag
openTag) {
StringBuffer sb = new StringBuffer();
sb.append(var );
// some more Javascript code...
replaceComponentTagBody(markupStream, openTag, sb.toString());
}
};
addOrReplace(script);

does not work? I use that kind of things for panel and works just fine...
That should also work for extend...

Best,

Ernesto

On Tue, Nov 25, 2008 at 3:08 PM, itayh [EMAIL PROTECTED] wrote:


 Hi,

 I use Markup inheritance in my site in order to keep common logic in the
 base page.
 I would like my child pages to do certain javascript actions when they are
 loaded. I try to define the the javascript on the childs body (between the
 wicket:extend and /wicket:extend) but I don't see them in the generated
 page (the base + child page). Any Idea how to generate onLoad javascript
 action for child page?
 --
 View this message in context:
 http://www.nabble.com/onLoad-javascript-event-with-Markup-inheritance-tp20681885p20681885.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: onLoad javascript event with Markup inheritance

2008-11-25 Thread Serkan Camurcuoglu
you should implement the IHeaderContributor interface in your page and 
use IHeaderResponse.renderOnLoadJavascript() method in the 
implementation of the renderHead method..




Ernesto Reinaldo Barreiro wrote:

Something like:

HTML

wicket:extend   script wicket:id=script
type=text/javascriptalert('Hi');/script
  .
/wicket:extend

Java code:

Label script = new Label(script, new ModelString()) {
private static final long serialVersionUID = 1L;

@Override
protected void onComponentTagBody(MarkupStream markupStream, ComponentTag
openTag) {
StringBuffer sb = new StringBuffer();
sb.append(var );
// some more Javascript code...
replaceComponentTagBody(markupStream, openTag, sb.toString());
}
};
addOrReplace(script);

does not work? I use that kind of things for panel and works just fine...
That should also work for extend...

Best,

Ernesto

On Tue, Nov 25, 2008 at 3:08 PM, itayh [EMAIL PROTECTED] wrote:

  

Hi,

I use Markup inheritance in my site in order to keep common logic in the
base page.
I would like my child pages to do certain javascript actions when they are
loaded. I try to define the the javascript on the childs body (between the
wicket:extend and /wicket:extend) but I don't see them in the generated
page (the base + child page). Any Idea how to generate onLoad javascript
action for child page?
--
View this message in context:
http://www.nabble.com/onLoad-javascript-event-with-Markup-inheritance-tp20681885p20681885.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





  



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: onLoad javascript event with Markup inheritance

2008-11-25 Thread jWeekend

You can use wicket:head or HeaderContributors.
See  http://cwiki.apache.org/WICKET/javascript-and-css-support.html this .

Regards - Cemal
http://www.jWeekend.co.uk http://jWeekend.co.uk 


itayh wrote:
 
 Hi,
 
 I use Markup inheritance in my site in order to keep common logic in the
 base page. 
 I would like my child pages to do certain javascript actions when they are
 loaded. I try to define the the javascript on the childs body (between the
 wicket:extend and /wicket:extend) but I don't see them in the
 generated page (the base + child page). Any Idea how to generate onLoad
 javascript action for child page?
 
http://cwiki.apache.org/WICKET/javascript-and-css-support.html
http://cwiki.apache.org/WICKET/javascript-and-css-support.html 
-- 
View this message in context: 
http://www.nabble.com/onLoad-javascript-event-with-Markup-inheritance-tp20681885p20682066.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: onLoad javascript event with Markup inheritance

2008-11-25 Thread Ernesto Reinaldo Barreiro
that would be a cleaner solution, indeed... but normally I use at most a
couple of pages and lot of  panel replacements so each component just
contributes what it needs...
On Tue, Nov 25, 2008 at 3:32 PM, Serkan Camurcuoglu 
[EMAIL PROTECTED] wrote:

 you should implement the IHeaderContributor interface in your page and use
 IHeaderResponse.renderOnLoadJavascript() method in the implementation of the
 renderHead method..




 Ernesto Reinaldo Barreiro wrote:

 Something like:

 HTML

 wicket:extend   script wicket:id=script
 type=text/javascriptalert('Hi');/script
  .
 /wicket:extend

 Java code:

 Label script = new Label(script, new ModelString()) {
 private static final long serialVersionUID = 1L;

 @Override
 protected void onComponentTagBody(MarkupStream markupStream, ComponentTag
 openTag) {
 StringBuffer sb = new StringBuffer();
 sb.append(var );
 // some more Javascript code...
 replaceComponentTagBody(markupStream, openTag, sb.toString());
 }
 };
 addOrReplace(script);

 does not work? I use that kind of things for panel and works just fine...
 That should also work for extend...

 Best,

 Ernesto

 On Tue, Nov 25, 2008 at 3:08 PM, itayh [EMAIL PROTECTED] wrote:



 Hi,

 I use Markup inheritance in my site in order to keep common logic in the
 base page.
 I would like my child pages to do certain javascript actions when they
 are
 loaded. I try to define the the javascript on the childs body (between
 the
 wicket:extend and /wicket:extend) but I don't see them in the
 generated
 page (the base + child page). Any Idea how to generate onLoad javascript
 action for child page?
 --
 View this message in context:

 http://www.nabble.com/onLoad-javascript-event-with-Markup-inheritance-tp20681885p20681885.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]









 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: onLoad javascript event with Markup inheritance

2008-11-25 Thread itayh

Thank you, it works great.


jWeekend wrote:
 
 You can use wicket:head or HeaderContributors.
 See  http://cwiki.apache.org/WICKET/javascript-and-css-support.html this .
 
 Regards - Cemal
  http://www.jWeekend.co.uk http://jWeekend.co.uk 
 
 
 itayh wrote:
 
 Hi,
 
 I use Markup inheritance in my site in order to keep common logic in the
 base page. 
 I would like my child pages to do certain javascript actions when they
 are loaded. I try to define the the javascript on the childs body
 (between the wicket:extend and /wicket:extend) but I don't see them
 in the generated page (the base + child page). Any Idea how to generate
 onLoad javascript action for child page?
 
  http://cwiki.apache.org/WICKET/javascript-and-css-support.html
 http://cwiki.apache.org/WICKET/javascript-and-css-support.html 
 

-- 
View this message in context: 
http://www.nabble.com/onLoad-javascript-event-with-Markup-inheritance-tp20681885p20682858.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Contribute to the body tag (onload)

2008-10-04 Thread Stefan Lindner
Have a look at 
http://www.nabble.com/body-onload-contribution-to13097473.html#a13097473

-Ursprüngliche Nachricht-
Von: Edgar Merino [mailto:[EMAIL PROTECTED] 
Gesendet: Freitag, 3. Oktober 2008 13:53
An: users@wicket.apache.org
Betreff: Contribute to the body tag (onload)

Hello,

Is it possible to contribute to the body html tag from within 
children pages? directly in markup, like when using the wicket:head 
tag (without modifying the java WebPage).

Thanks in advance.
Edgar Merino

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Contribute to the body tag (onload)

2008-10-03 Thread Edgar Merino

Hello,

   Is it possible to contribute to the body html tag from within 
children pages? directly in markup, like when using the wicket:head 
tag (without modifying the java WebPage).


Thanks in advance.
Edgar Merino

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



About Wicket portlets, DatePicker, onLoad and onDomReady

2008-09-17 Thread Serkan Camurcuoglu

Hi all,
While I was experimenting with date pickers in portlets, I've noticed 
something. When a portlet makes a header contribution, it cannot 
directly contribute to document's head, instead it generates something like:


script type=text/javascript 
src=/subscriber-web/buyOffer/ps:P-11c703e086b-1/resources/org.apache.wicket.extensions.yui.YuiLib/yuiloader-beta.js/script
script type=text/javascript 
src=/subscriber-web/buyOffer/ps:P-11c703e086b-1/resources/org.apache.wicket.markup.html.WicketEventReference/wicket-event.js/script
script type=text/javascript !--/*--![CDATA[/*!--*/


in the page body. Here P-11c703e086b is the portlet's id, and each 
portlet fragment on the page has a different id, and hence they load 
different javascript files (from the browser's point of view). So now, 
when I have two instances of the same portlet which contains date 
pickers, they both include their own wicket-event and yuiloader 
javascript files. The result of this is that only the date pickers in 
the second (last loaded) portlet work, and the date pickers in the first 
portlet do not work. I think that the global javascript objects from the 
last loaded file override the ones from the first (such as Wicket and 
YAHOO objects).


However, I've noticed that (while developing a different javascript 
behaviour for myself), if I execute the required javascript code during 
the onLoad event (instead of the onDomReady event), all of the date 
pickers work as expected. I have confirmed this by modifying the 
DatePicker class and using it within my portlets.


Does anybody have an explanation for this? I know that using onLoad is 
bad, but it seems to solve my problem..


(BTW I'm using wicket 1.3.4 and Jetspeed 2.1.3)

Best regards,

SerkanC



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: body onload contribution

2007-10-18 Thread John Patterson
Something I have noticed with renderOnLoad with my site is that it  
stopped being called after I added some Javascript for banner ads.   
Maybe their included script replaced the wicket function.  I had to  
revert to using onLoad which makes gives the impression that the maps  
load more slowly.


I have been thinking about creating a panel to include at the bottom  
of the page that renders scripts etc.  Anyone tried something like this?


On 8 Oct 2007, at 08:15, Matej Knopp wrote:


What wicket version are you using?

In 1.3 there's much better way to do this. Just use
renderOnLoad/renderOnDomReady javascript on IHeaderResponse.

-Matej

On 10/8/07, Evan Chooly [EMAIL PROTECTED] wrote:
I used the following in my page constructor, but I'm not seeing  
the change

in the HTML.  What am I missing?

add(new BodyTagAttributeModifier(onload, true, new Model 
(foo()),

this));



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



body onload contribution

2007-10-08 Thread Evan Chooly
I used the following in my page constructor, but I'm not seeing the change
in the HTML.  What am I missing?

add(new BodyTagAttributeModifier(onload, true, new Model(foo()),
this));


Re: body onload contribution

2007-10-08 Thread Matej Knopp
What wicket version are you using?

In 1.3 there's much better way to do this. Just use
renderOnLoad/renderOnDomReady javascript on IHeaderResponse.

-Matej

On 10/8/07, Evan Chooly [EMAIL PROTECTED] wrote:
 I used the following in my page constructor, but I'm not seeing the change
 in the HTML.  What am I missing?

 add(new BodyTagAttributeModifier(onload, true, new Model(foo()),
 this));


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: body onload contribution

2007-10-08 Thread Evan Chooly
Ah.  that was the 1.3ism i was looking for.  I'll try that.  Thanks.  I knew
it had changed but couldn't remember the new approach.

On 10/8/07, Matej Knopp [EMAIL PROTECTED] wrote:

 What wicket version are you using?

 In 1.3 there's much better way to do this. Just use
 renderOnLoad/renderOnDomReady javascript on IHeaderResponse.

 -Matej

 On 10/8/07, Evan Chooly [EMAIL PROTECTED] wrote:
  I used the following in my page constructor, but I'm not seeing the
 change
  in the HTML.  What am I missing?
 
  add(new BodyTagAttributeModifier(onload, true, new
 Model(foo()),
  this));
 

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]