You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Greg Bearth <gr...@fourthgen.com> on 2002/12/31 16:21:33 UTC

Updating collections of information

I've read the Struts User Guide, "Programming Jakarta Struts", searched
Google, and asked a couple of acquaintances, but have yet to find a
definitive answer to whether Struts can help me in the following situation.
The closest thing I've found is a reference to IndexTags under Struts
Resource.

I have a form which correctly displays information found in a collection of
beans.  However, each piece of displayed information is potentially
updateable.  When the form is subsequently submitted, does Struts
rebuild/update the collection of elements?  I suspect it doesn't because
attempting to retrieve the collection from the form bean returns null.  If
not, any suggestions as to how I should handle this?  Shall I resort to
using straight html elements with a naming convention and Java scriptlets,
as opposed to trying to use the struts html element tags?

Sample portion of JSP:
<logic:iterate name="selectedBean" id="element" property="elements"
type="xxx.yyy.ElementBean" indexId="rowNum" >
  <tr class="<%= rowNum.intValue() % 2 == 0 ? "evenRow" : "oddrow" %>" >
    <td align="left"><html:text name="element" property="propertyA"/></td>
    <td align="center"><html:checkbox name="element"
property="propertyB"></html:checkbox></td>
    <td align="center"><html:checkbox name="element"
property="propertyC"></html:checkbox></td>
  </tr>
</logic:iterate>

I am using Struts 1.0.2 and Tomcat 4.1.12.

Any assistance, or confirmation that this is not possible with Struts will
be appreciated.  Thanks.

Greg Bearth
Fourth Generation, Inc.
175 East Fifth Street, Suite 251
St Paul  MN  55101
mailto:greg_bearth@fourthgen.com
(651) 260-7643



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Updating collections of information

Posted by "V. Cekvenich" <vc...@basebeans.com>.
Multirow updates and MasterDetail and even more complex processing is 
done all the time with Sturts.
In resource you will find many sample apps, one of the multirow links is 
here:
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/basicportal/basicportal_07/portlets/cms/ContentApprovePortlet.jsp?rev=1.7&content-type=text/vnd.viewcvs-markup

So yes, of course that works.

.V

Greg Bearth wrote:
> I've read the Struts User Guide, "Programming Jakarta Struts", searched
> Google, and asked a couple of acquaintances, but have yet to find a
> definitive answer to whether Struts can help me in the following situation.
> The closest thing I've found is a reference to IndexTags under Struts
> Resource.
> 
> I have a form which correctly displays information found in a collection of
> beans.  However, each piece of displayed information is potentially
> updateable.  When the form is subsequently submitted, does Struts
> rebuild/update the collection of elements?  I suspect it doesn't because
> attempting to retrieve the collection from the form bean returns null.  If
> not, any suggestions as to how I should handle this?  Shall I resort to
> using straight html elements with a naming convention and Java scriptlets,
> as opposed to trying to use the struts html element tags?
> 
> Sample portion of JSP:
> <logic:iterate name="selectedBean" id="element" property="elements"
> type="xxx.yyy.ElementBean" indexId="rowNum" >
>   <tr class="<%= rowNum.intValue() % 2 == 0 ? "evenRow" : "oddrow" %>" >
>     <td align="left"><html:text name="element" property="propertyA"/></td>
>     <td align="center"><html:checkbox name="element"
> property="propertyB"></html:checkbox></td>
>     <td align="center"><html:checkbox name="element"
> property="propertyC"></html:checkbox></td>
>   </tr>
> </logic:iterate>
> 
> I am using Struts 1.0.2 and Tomcat 4.1.12.
> 
> Any assistance, or confirmation that this is not possible with Struts will
> be appreciated.  Thanks.
> 
> Greg Bearth
> Fourth Generation, Inc.
> 175 East Fifth Street, Suite 251
> St Paul  MN  55101
> mailto:greg_bearth@fourthgen.com
> (651) 260-7643



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Broken link on Jakarta's Struts webpage

Posted by John Bigboote <y0...@yahoo.com>.
Like there isn't enough for you guys to do, there's a
broken link on the Struts website.  On the page:

http://jakarta.apache.org/struts/status.html

under the "Relevant Proposals" section, the
"struts-faces taglib" link is busted.  It points to:

http://jakarta.apache.org/proposals/struts-faces.html

but should point to:

http://jakarta.apache.org/struts/proposals/struts-faces.html



Thanks.

J

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>