Here's a simple ww:component example. Let's say we have the following Action
public class MyAction implements Action { ....
public List getResults(); }
And you wanted a component that would generate a set of rows for you. You would probably want to write:
<ww:component value="results" template="/foo.vm"/>
Where foo.vm looked something like:
#foreach( $item in $tag.Value ) <tr> <td>$item.Foo</td> <td>$item.Bar</td> </tr> #end
This example assumes that getResults() returns a Collection of objects that support getFoo() and getBar().
M
On Sun, 30 Mar 2003 21:38:34 +0100, Pat Lightbody <[EMAIL PROTECTED]> wrote:
FYI: Nitin is asking about WebWork2 here.
I am pretty sure #1 is already supported, but I never verified personally.
Matt?
For #2, you can use the webwork:component tag and instruct it to use any
template you'd like. To have the surrounding "stuff" done for you, all you
need to do is #include the controlheader.vm and controlfooter.vm stuff in
you new velocity template you write. It should exist in
/WEB-INF/classes/decorators/xhtml, I believe.
-Pat
----- Original Message -----
From: "Nitin Patil" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, March 28, 2003 7:02 PM
Subject: [OS-webwork] How to mark options as "selected" for webwork:select
tag?
Hi,this
I've 2 Qs.
1. For an HTML select control, I would like to show the values that the user had previously selected. I couldn't find directly any support forin webwork:select. Is there a way to achieve this? Ideally, I would liketohave another attribute in the webwork:select tag, such as"selectedValues",towhich accepts a list of selected values (that should match OPTION value attribute) or a single selected value (in case "multiple" is false).
2. The other option I see is writing the HTML select tag by myself. However, in that, it doesn't get rendered within the sitemesh decorator table. So, I have to explicitly add the "tr" and "td" tags. I would likeknow if there's a way to rightly render a normal HTML tag, such as"select"by using a webwork tag? I checked "webwork:component", but probably that's
more for custom UI templates.
Thanks, - Nitin
________________________________________________________________________ Nitin Patil ASTG TACWeb Phone: +1 408-853-8889 Email: [EMAIL PROTECTED] ________________________________________________________________________
------------------------------------------------------- This SF.net email is sponsored by: The Definitive IT and Networking Event. Be There! NetWorld+Interop Las Vegas 2003 -- Register today! http://ads.sourceforge.net/cgi-bin/redirect.pl?keyn0001en _______________________________________________ Opensymphony-webwork mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork
------------------------------------------------------- This SF.net email is sponsored by: The Definitive IT and Networking Event. Be There! NetWorld+Interop Las Vegas 2003 -- Register today! http://ads.sourceforge.net/cgi-bin/redirect.pl?keyn0001en _______________________________________________ Opensymphony-webwork mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork
-- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
-------------------------------------------------------
This SF.net email is sponsored by: ValueWeb: Dedicated Hosting for just $79/mo with 500 GB of bandwidth! No other company gives more support or power for your dedicated server
http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/
_______________________________________________
Opensymphony-webwork mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork