Title: Message
Unless I missed it, the iterator is only capable of iterating over a collection vs. being able to iterate between a range of numbers. I believe a valuable enhancement would be to change the <ww:set> tag to extend BodySupport instead of TagSupport so you could do something like this:
 
<c:forEach begin='0' end='${model.numItems-1}' varStatus='status'>
    <cf:set name="label">'<c:out value="Item ${status.count}"/>'</cf:set>
    <cf:set name="name">'<c:out value="model.items[${status.index}].id"/>'</cf:set>
    <tr><ww:select label="#label" name="#name" list="@[EMAIL PROTECTED]()" listKey="id" listValue="label" headerKey="''" headerValue="'Select'"/></tr>
</c:forEach>
 
This would allow for much more flexible UI's, IMHO. In fact, you'll notice the <cf:set> tag in my example - I eventually ended up rewriting the <ww:set> tag to extend BodyTagSupport instead of WebWorkTagSupport and then merged in the necessary code from WebWorkTagSupport after writing my own doAfterBody(). I'm not sure if modifying WebWorkTagSupport to extend BodyTagSupport instead of TagSupport would create any problems (it was 4:30 am and I had to call it a night) but is there any reason SetTag has to extend WebWorkTagSupport? As a side note, I'd send you my version of SetTag if it weren't for a minor bug... I've got my version working the the value in the body but I've got to debug an issue with being about to use the value attribute, if it exists, or the body content, if not. I can debug this issue and post my version to the list after I meet my deadline in the next day or two.


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jason Carreira
Sent: Sunday, November 23, 2003 5:30 AM
To: [EMAIL PROTECTED]
Subject: RE: [OS-webwork] Lost in the woods once again...

You can't embed one JSP tag in the attribute value of another JSP page...
 
Take a look at the iterator examples that ship with WebWork to see how this could be done w/ all WW tags (I don't know JSTL that well)
-----Original Message-----
From: Peter White [mailto:[EMAIL PROTECTED]
Sent: Saturday, November 22, 2003 8:17 PM
To: [EMAIL PROTECTED]
Subject: [OS-webwork] Lost in the woods once again...

I'm trying to convert one of the pages of my old JSP-based wizard over to webwork and I'm at a loss since it doesn't appear that the ww:iterator tag supports what I'm trying to do. If anyone has any ideas, I'd be more than willing to try them out since nothing I've tried has worked so far. Here's what I'm trying to do…

Wizard page #1 asks how many items I want to chose and stores it in model.numItems
Wizard page #2 needs to do something along the lines of:

<c:forEach begin='0' end='${model.numItems-1}' varStatus='status'>
    <ww:set name="count" value='<c:out value="${status.count}"/>' scope="webwork" />
    <ww:set name="index" value='<c:out value="${status.index}"/>' scope="webwork" />
    <tr><ww:select label="Credit Traunch ${#count}" name="model.creditTraunch[${#index}]" list="@[EMAIL PROTECTED]()" listKey="['label']" listValue="['id']" defaultKey="Select" defaultValue=""/></tr>

</c:forEach>

In this mix of WW & JSTL, the JSTL iterator works correctly and renders the <ww:select> fields. However, the <ww:set tag> isn't taking the value from the JSTL <c:out> tag. If anyone knows how to get a JSTL value into WW that would be perfect. As a side note, I'm using the JSTL request wrapper that was posted to the list.

Thanks!
Peter 

Reply via email to