On 11/9/05, Rick Reumann <[EMAIL PROTECTED]> wrote:
> Michael Jouravlev wrote the following on 11/8/2005 7:15 PM:
>
> >> <html:textarea
> >> property="someObject[${aProp.someIndex}].subobject[${bProp.someIndex}].someField"/>
>
> > Any idea how to simplify input using JSTL 1.1 (JSP 2.0) only?
>
> Well, that would be pretty much impossible without writing a tag to do
> it (since as it stands how could JSP or JSTL have any idea what your
> nested property names are?).

Hmm, I can build proper name right as HTML tag. I think I can omit
using Struts nested tags, and use JSTL only + BeanUtil.populate(), of
course:

<c:forEach var="item" items="${cartForm.map.lines}" varStatus="status">
<TR>
  <TD><c:out value="${item.name}"/></TD>
  <TD><c:out value="${item.price}"/></TD>
  <TD>
    <input type="text"
    name="lines[<c:out value="${status.index}"/>].quantity"
    value="<c:out value="${item.quantity}"/>"
    size="3">
  </TD>
</TR>
</c:forEach>

Not pretty... I have to use "map" and I have to use "lines" in input
element, since "lines" is a property of a dynabean. But works.

Can I use an ArrayList or Map instead of plain array? I guess not
since BeanUtils does not understand them, according to docs.

Michael.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to