PlanetJava
Custom Search

java-stripes-user
[Top] [All Lists]

Populating Sets

Subject: Populating Sets
Date: Thu, 24 Nov 2005 10:39:35 +0100
Hi,
I wonder what's the best (or "Stripes") way to do the following:
I have a domain model "Foo" which has a Set of "Bar"s. I want to show a form in the web front-end containing all availabe "Bar"s w/ checkboxes. The ones contained in "Foo" are (pre)selected. The user can add or remove "Bar"s by checking/unchecking the checkboxes.
So far, I can go (in the JSP) with something like
<c:forEach items="${actionBean.allBars}" var="b">
<li><stripes:checkbox name="???" value="${b.id}" checked="${actionBean.foo.bars}" /> ${b.name}</li>
</c:forEach>
But how can I (re)populate the set (actionBean.foo.bars) after submitting the form? The Struts-way would be a "Long[] barIds" (w/ checkboxes' name="barIds") and then fill Foo's set explicitly -- cumbersome and repetitive :(
Any ideas?
(Please CC me, I'm not subscribed to this list.)
Thanks,
Sebastian
--
Sebastian Beigel // Software Architekt
(F) Die Firma GmbH // Innovative Kommunikation
Schwalbacher Straße 74 // D-65183 Wiesbaden
T +49.6 11.2 38 50.24 // F +49.6 11.2 38 50.11
mailto:[email protected] // 
http://www.diefirma.de
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
msgmiddle
<Prev in Thread] Current Thread [Next in Thread>
  • Populating Sets,
    • Re: Populating Sets
Current Sitemap | © 2012 planetjava | Contact | Privacy Policy