You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Ken nashua <nh...@hotmail.com> on 2007/10/18 16:38:17 UTC

widget recommendation request

Folks,
 
I have a widget that extends from Image and automates a temporary surrogate image if the image happens to be blank.
 
public abstract class MimedImage extends Image
 
No forms... no templates... no html. Just a pure java tapestry widget.
 
And it also fixes up mime properties too. In the event the image is blank/null (which is the case on initialization until the user populates it) and also the case whereby tapestry fails to articulate mime type (which tapestry has shown to fail on) this widget assigns proper mime type.
 
So I get default image and fixed up mime.
 
I want to extend this further. Allow me to elaborate.
 
I am inspired by the nice scripting capabilities tapestry offers and want to put it to good use.
 
USE CASE: I want to create a derivative of MimedImage that paints a transparent dom box inside the lower left corner of the image displaying some kind of title text or date text. Just painting property text on a dom that sits ontop of and within the widget at some determined comfortable location.
 
I am confused about inheritence.
 
QUES: Should I consider using templates and inherit from BaseComponent and delegate? Or can I get away with simple pure java tapestry widget again and use scripting to create the DOM element and enter transparent text? Since I am just painting on DOM element text, I am inclined to go with latter.
 
Can someone shed some light on how to create the DOM element in tapestry SCRIPT and paint it on some comfortable location on this widget?
 
Any sample code would be appreciated.
Best regardsKen in nashua
_________________________________________________________________
Climb to the top of the charts!  Play Star Shuffle:  the word scramble challenge with star power.
http://club.live.com/star_shuffle.aspx?icid=starshuffle_wlmailtextlink_oct