On a fresh Seam from CVS and pristine JBossAS 4.2.1:
- Deploy the seam-ui example
- Select the s:selectItems topic
- Select the "Edit the continent/country relationship"
- Add some countries to Antarctica
- Click on Apply
- Select the s:fragment topic
- Select the s:selectItems topic again (you'll get a new conversation)
=> Bug: Your previous edits are lost
Gosh - this cost me the best part of the night.
I copied the "h:selectManyListbox" part from continents.xhtml but my changes to
the DB were always lost.
I did not notice that the changes weren't persisted in the example either, because I
always stayed in the same conversation (and of course I expected the example to be
correct).
What is the best way to solve this, specifically:
How to update country.continent when the selectManyListbox is used?
Here's what worked for me in my own code, but maybe there's a better way?
| public void setDepartments(List<Department> departments) {
| for (Department department : departments) {
| DepartmentGroup oldGroup = department.getGroup();
| if (oldGroup != null)
| oldGroup.getDepartments().remove(department);
| department.setGroup(this);
| }
| this.departments = departments;
| }
|
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4069440#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...