Re: onmouseover image
I am seeking a solution and found this mail. This is a very useful implementation. I strongly suggest future wicket to include this Component. Thank you , Jeremy -- smallufo 2008/10/8 Jeremy Thomerson jer...@wickettraining.com This doesn't preload the images, but it is a simple way to do a Mouseover. You could easily add a header contributor within the constructor of this class that outputs some javascript to preload the images. public class MouseoverImage extends Image { private static final long serialVersionUID = 1L; private final ResourceReference mImage; private final ResourceReference mMouseoverImage; public MouseoverImage(String id, ResourceReference image, ResourceReference mouseoverImage) { super(id, image); mImage = image; mMouseoverImage = mouseoverImage; add(new AttributeModifier(onmouseover, null, true, new LoadableDetachableModelString() { private static final long serialVersionUID = 1L; @Override protected String load() { return this.src=' + urlFor(mMouseoverImage) + ';; } })); add(new AttributeModifier(onmouseout, null, true, new LoadableDetachableModelString() { private static final long serialVersionUID = 1L; @Override protected String load() { return this.src=' + urlFor(mImage) + ';; } })); } }
Re: onmouseover image
; add(new StringHeaderContributor(javascript2)); // ADD 3 ATTRIBUTES TO IMAGE: name, onmouseover, onmouseout /* * button_off.GIF */ AttributeModifier nameAtt = new AttributeModifier(name, true, new ModelString(uniqueImageName)); add(nameAtt); AttributeModifier onMouseOverAtt = new AttributeModifier(onmouseover, true, new ModelString(display('+uniqueImageName+', +uniqueImageName+_over);)); add(onMouseOverAtt); AttributeModifier onMouseOutAtt = new AttributeModifier(onmouseout, true, new ModelString(display('+uniqueImageName+', +uniqueImageName+_out);)); add(onMouseOutAtt); } } -- View this message in context: http://www.nabble.com/onmouseover-image-tp19567984p19905061.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: onmouseover image
This doesn't preload the images, but it is a simple way to do a Mouseover. You could easily add a header contributor within the constructor of this class that outputs some javascript to preload the images. public class MouseoverImage extends Image { private static final long serialVersionUID = 1L; private final ResourceReference mImage; private final ResourceReference mMouseoverImage; public MouseoverImage(String id, ResourceReference image, ResourceReference mouseoverImage) { super(id, image); mImage = image; mMouseoverImage = mouseoverImage; add(new AttributeModifier(onmouseover, null, true, new LoadableDetachableModelString() { private static final long serialVersionUID = 1L; @Override protected String load() { return this.src=' + urlFor(mMouseoverImage) + ';; } })); add(new AttributeModifier(onmouseout, null, true, new LoadableDetachableModelString() { private static final long serialVersionUID = 1L; @Override protected String load() { return this.src=' + urlFor(mImage) + ';; } })); } } -- Jeremy Thomerson http://www.wickettraining.com On Wed, Sep 24, 2008 at 2:04 AM, Tim Squires [EMAIL PROTECTED] wrote: Thanks Alastair, that's a good idea. AjaxEventBehavior would give the effect but with a round trip to the server. It would be nice to have a javascript only onmouseover where the images are pre-loaded. I'm currently using the wicketstuff-dojo onmouseover-highlight, which is good enough for now. http://wicketstuff.org/wicketdojo13/?wicket:bookmarkablePage=%3Aorg.wicketstuff.dojo.examples.lfx.DojoFXTestPage Thanks again, Tim Have a look at AjaxEventBehavior. You can either combine this with an Image component or add an AttributeModifier and manually tweak the img's src attribute. Alastair 2008/9/19 Tim Squires [EMAIL PROTECTED] Hi All, Before I go and write my own component to change the src of an img onouseover, I just wanted to make sure that there is no standard component. I don't want to re-invent the wheel. Is there a standard component for changing the Image or ImageButton image onmouseover? Thanks, Tim - 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: onmouseover image
Thanks Alastair, that's a good idea. AjaxEventBehavior would give the effect but with a round trip to the server. It would be nice to have a javascript only onmouseover where the images are pre-loaded. I'm currently using the wicketstuff-dojo onmouseover-highlight, which is good enough for now. http://wicketstuff.org/wicketdojo13/?wicket:bookmarkablePage=%3Aorg.wicketstuff.dojo.examples.lfx.DojoFXTestPage Thanks again, Tim Have a look at AjaxEventBehavior. You can either combine this with an Image component or add an AttributeModifier and manually tweak the img's src attribute. Alastair 2008/9/19 Tim Squires [EMAIL PROTECTED] Hi All, Before I go and write my own component to change the src of an img onouseover, I just wanted to make sure that there is no standard component. I don't want to re-invent the wheel. Is there a standard component for changing the Image or ImageButton image onmouseover? Thanks, Tim - 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: onmouseover image
Have a look at AjaxEventBehavior. You can either combine this with an Image component or add an AttributeModifier and manually tweak the img's src attribute. Alastair 2008/9/19 Tim Squires [EMAIL PROTECTED] Hi All, Before I go and write my own component to change the src of an img onouseover, I just wanted to make sure that there is no standard component. I don't want to re-invent the wheel. Is there a standard component for changing the Image or ImageButton image onmouseover? Thanks, Tim - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
onmouseover image
Hi All, Before I go and write my own component to change the src of an img onouseover, I just wanted to make sure that there is no standard component. I don't want to re-invent the wheel. Is there a standard component for changing the Image or ImageButton image onmouseover? Thanks, Tim - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]