You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Pasithee Jupiter <pa...@gmail.com> on 2012/05/28 00:21:06 UTC

onload event on img-tag

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

Re: onload event on img-tag

Posted by Pasithee Jupiter <pa...@gmail.com>.
Thanks a lot. That works like a charm.

cheers


On Mon, May 28, 2012 at 9:02 AM, Martin Grigorov <mg...@apache.org>wrote:

> 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 <pa...@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-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: onload event on img-tag

Posted by Martin Grigorov <mg...@apache.org>.
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 <pa...@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-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org