Okay, so I figured out the right syntax for the question I posted
yesterday (subject: List properties in Struts 2).

Let's say I have a List of key-value pairs and I want to render the
entire list to the user as a form.  In Struts 1.x, here's the JSP
snippet:

  <logic:iterate list="pairs">
    <html:text name="pairs" property="key" indexed="true" />
    <html:text name="pairs" property="value" indexed="true" />
  </logic:iterate> 

But in S2, I have to do this:

  <s:iterator value="pairs" status="status">
    <s:textfield name="%{'pairs['+#status.index+'].name'}" />
    <s:textfield name="%{'pairs['+#status.index+'].value'}" />
  </s:iterator>

It seems to me that this use case is common enough that the S2 method
should be more friendly and obvious, and should not involve assembling
an OGNL expression manually in the JSP.  It seems to me that bringing
back Struts 1's iterator-aware field tags would be relatively
straightforward.  It'd be extra nice if the tag simply recognized that
the value being pulled in from an iterator automatically, so that you
didn't even need the "indexed" attribute:

  <s:iterator value="pairs" id="pair">
    <s:textfield name="name" />
    <s:textfield name="value" />
  </s:iterator>

How difficult would that be?  It already works to *populate* a form; I
just can't submit back to the action and have it fill in my object.  

Am I the only one that thinks that the current S2 way is a huge pain?

-Jake Robb

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

Reply via email to