When I wrote ui tags for velocity back around 1.2, I used a directive for each tag (#textfield, #hidden, etc), which is still the format that I prefer. The problem I ran into (and why I've never committed anything to CVS) was dealing with parameters, and dealing with directives having to be either inline, or body tags, but not both. I never came up with a solution that I liked.
On what you've done. I like diretives better than a variable. Using a variable like you were seemed... out of scope for a variable. I didn't like .Show either (though I understood the need for it). The "key=value" syntax I've never liked. I like #tagname("value" "name" "label") or something like that, but that would require a certain order for the params, which is again ugly. I have a love/hate relationship with velocity. I love it when I'm using it, but hate it when I try to extend it. Go figure. --Erik On Sat, 31 May 2003, Matt Ho wrote: > I've checked an alternate format for rendering the WebWork2 ui tags from > Velocity. My hope is to migrate to this new style and deprecate (then > remove) the current $ui style for rendering. > > Previously, the following JSP tags > > <ui:textfield label="mylabel" name="myname" value="myvalue"/> > > would be written as > > $ui.TextField.set("mylabel", "myname", "myvalue").Show > > in Velocity. Under the new format, you would write: > > #tag( TextField "label=mylabel" "name=myname" "value=myvalue" ) > > or > > #bodytag( TextField "label=mylabel" "name=myname" "value=myvalue" ) > #param( "param1" "value1") > #param( "param2" "value2") > #end > > if you need to pass in additional parameters. Any and all feedback > would be most welcome. My feeling is that the first construct feels > awkward and unintuitive. > > One issue with this new style is that attributes are declared via > "name=name1" rather than the JSP style of name="name1". This is because > Velocity's parser pukes on the later for custom user Directives. If > anyone knows a way around this, I'm all ears! > > Enjoy! > > ps - does anyone know of an IDEA plugin that can chromacode Velocity > templates? > > M ------------------------------------------------------- This SF.net email is sponsored by: eBay Get office equipment for less on eBay! http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5 _______________________________________________ Opensymphony-webwork mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork