RE: Using a static image map

2008-04-16 Thread Cristina


Martijn C. Vos wrote:
 
 [...]
 Ofcourse if the ImageMap's areas are completely static, you may
 want to keep the shape and coordinates of the links outside the
 Wicket code and only in the html, so I'm kinda wondering if it
 would be possible to keep the map outside Wicket, and simply
 give each area a wicket:id corresponding to a Link in your
 Wicket code.
 
 No idea if that would work (the ImageMap is kinda old and rarely
 used), but that's what I'd try.
 [...]
 

Well, Martijn, I've tried and it actually works... :-) It's a very clean
solution so I'll left a code snippet here just in case someone else needs to
solve the same problem:

In the HTML file:

div class=image-place
!-- img and usemap definition here... --
map name=basic-process-500x375
area shape=rect coords=8,136,71,178 href=# 
wicket:id=module-01 title=Subprocess 1 /
area shape=rect coords=9,3,70,47 href=# 
wicket:id=module-02 title=Subprocess 2 /
/map
br /
Basic Business Process (BPMN)
/div

In the Java class:

// Links to the area elements of the image map...
add(new PageLink(module-01, Module01.class));
add(new PageLink(module-02, Module02.class));

Thanks for your help,

Cristina
 
-- 
View this message in context: 
http://www.nabble.com/Using-a-static-image-map-tp16656656p16738785.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: Using a static image map

2008-04-14 Thread Martijn C. Vos
Cristina wrote:
 Hello,
 
 I've defined a simple HTML image map from a business process diagram:
 
 div class=image-place
 !-- img and usemap definition here... --
 map name=basic-process-500x375
 area shape=rect coords=8,136,71,178
 href=Module01.html title=Subprocess 1 /
 area shape=rect coords=9,3,70,47
 href=Module02.html title=Subprocess 2 /
 area shape=rect coords=78,67,140,109
 href=Module03.html title=Subprocess 3 / /map
 br /
 Basic Business Process (BPMN)
 /div
 
 Now I would like to enable this image map within Wicket...
 I've found out the ImageMap class in the API javadoc but I
 don't see how I should combine it with the above HTML.

What exactly is it that you want to enable about this in Wicket?
Do you want the areas to remain static, and only the links to
become Wicket links?

As far as I can tell, the standard Wicket ImageMap lets you
add areas (called ShapeLinks) to an ImageMap, and each ShapeLink
has a shape (rect, circle, polygon), coordinates, and a Link.
Ofcourse if the ImageMap's areas are completely static, you may
want to keep the shape and coordinates of the links outside the
Wicket code and only in the html, so I'm kinda wondering if it
would be possible to keep the map outside Wicket, and simply
give each area a wicket:id corresponding to a Link in your
Wicket code.

No idea if that would work (the ImageMap is kinda old and rarely
used), but that's what I'd try.

Otherwise, simply use the ImageMap the way it's written (which
is a bit odd, I admit): give a static img a wicket:id
corresponding to an ImageMap, and add ShapeLinks (with shape,
coords and Link) to that ImageMap. That should work.

(It's probably a good idea to take my advice with a grain of
salt; I'm still very new to Wicket myself. My own problem
with the ImageMap is that it's not dynamic enough, instead of
too dynamic.)


mcv.

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