cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From oceatoon <>
Subject Re: ImageMap widget for CForms
Date Thu, 02 Jun 2005 01:07:21 GMT
Hi Luca

> I made my first Cocoon widget :)
> It isn't at all that hard, though I managed to waste time by trying to
> subclass my widget from the Action class :(
Congratulations , I'll definitly be looking into this
> Anyway, here's how to use it:
> 1) Definition document:
> <fd:imagemap id="map">
> <fd:hint>
> <i18n:text>refresh.hint.mapZoomin</i18n:text>
> </fd:hint>
> <fd:on-action>
> <javascript>onClickMap();</javascript>
> </fd:on-action>
> </fd:imagemap>
If the Map widgets is concidered as the map itself, then wouldn't it be
usefull to pass the url of the image as attribute @url
or fd:value, offcourse this could also be specified in the styling tag but
you allready have the SetImageSource .

fd:datatype could also be an interesting piece of information to specify the
type of map, image, SVG , GML ...other

And a very usefull piece of definition would be fd:selection-list containing
items, values, and labels, maybe urls or even GML... ???
> 2) Template document:
> <ft:widget id="map">
> <fi:styling border="2"/>
> </ft:widget>
> 3) No binding required.
This could be a very nice feature to connect to datasrc's for filling the
map. It Could be similar to what the selection-list does , don't you
think ?

> 4) Flow:
> function onClickMap () {
> var x= Number(cocoon.request.getParameter("map.x"));
> var y= Number(cocoon.request.getParameter("map.y"));
> var uri;
> uri= "<zoomed map uri/>";
> frm.getWidget().lookupWidget("map").setImageSource(uri);
> }
> So, the image map's URI is set by setImageSource(); when the user clicks
> on it the onClickMap (or whatever is specified in on-action)  flowscript
> is called, which gets mouse coordinates from request parameters.

> Simple, isn't it ?
> If someone would like some features to be added, this is the right time
> to speak... otherwise I'll make a zipball and donate the thing.
I suspect you reading in my last night dreams, a day goes by and voila
Thanks for this
exactly the base I needed to jump :)


View raw message