Matthew Young wrote:
...ImageMap is supposed to work on a static <img> tag with a hard-coded src atrribute.But you can modify the src tag like below. Would that help? WebMarkupContainer img = new ImageMap("image") { private static final long serialVersionUID = 1L; @Override protected void onComponentTag(final ComponentTag tag){ super.onComponentTag(tag); tag.put("src", YOUR_VERY_OWN_URL); } };
Not a lot. I want to treat my image in the same way as any other Wicket Image, and in my particular case, that means linking it to an RenderedDynamicImageResource. The problem is that the ImageMap needs to be applied to an img tag, which means I can't apply an Image to that tag anymore, but ImageMap doesn't provide anywhere near the functionality that Image does. It should. I see this as a serious bug in ImageMap, and not just some unavoidable limitation that needs to be worked around. The big question is how to fix this. I've got a couple of options: 1: Since ImageMap is applied to an img tag, ImageMap needs to implement the same functionality as Image. The best way to do that by simply making it inherit, but that's a problem since ImageMap already extends WebMarkupContainer. No idea what WebMarkupContainer does, but there's probably a very good reason for it. Also, there seems to be a big difference in the way Image and ImageMap are rendered. ImageMap uses onRender(), whereas Image uses onComponentTag(). I don't know enough about the inner workings of Wicket to know what that means. 2: Since an ImageMap is something completely different from an Image, it should not apply to an img tag, but to a map tag, and Image needs to have a method to link it to an ImageMap. Accept that the current ImageMap was based on a bad idea, and fix it properly. I think the second is better and cleaner, and I have a better idea of how to do it. The problem is that it requires some big changes: Image needs an extra method, compatibility with the old ImageMap will break, and you need to add a <map> tag to your markup. I'm not completely happy with the need to add a <map> tag, and would like to be able to simply add an ImageMap to an Image and have that work, but considering the difference between onRender() and onComponentTag(), I'm not sure that's possible. On the other hand, web designers will probably like having an actual imagemap in their markup. Should I be posting this to the dev list perhaps? mcv. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
