I am working with the latest version of Stripes.

I am trying to use indexed properties in a form where users are allowed to
add new items to the end of a list property.  This is working to the extent
that modifications to existing items in the list are being persisted as
expected.  However, it is failing to work when the user adds values to the
fields of the form that are specifying values for a new item that is to be
added to the list.  Those values are being ignored.

In my case, the list property is, itself, a property of a single object that
is being edited using the web form.  Thus, the form fields have names like
description.commonNames[0].name and description.commonNames[0].language
description.commonNames[1].name and description.commonNames[1].language

Thus, the list is a property of the description object rather than the
actionBean supporting the form.

When users navigate to the web form, the page is loaded with a single
parameter that is the ID of the description.  Most of the properties of the
description object are not to be edited on the form; just the list of
commonNames in the description.  A description can have any number of
commonNames.  A stripes type converter converts the ID of the description
into an actual description object that is accessible from the actionBean
using the getDescription() method.

The description object has a "void setCommonNames(List<CommonName> names)"
method and a public "List<CommonName> getCommonNames()" method.

The description in the actionBean then makes its existing commonNames
available to the form which accessing their values using the
description.getCommonNames() method.  That works well.

When the user modifies existing common names in the description, those
changes are copied back into the description's common names and all is well.

When the user adds content to the form fields for a new commonName, however,
those values are not used to instantiate a new commonName.  Nor is any newly
instantiated commonName added to the list of commonNames in the description.
Importantly, the setCommonNames(...) method of the description is never
called.

The content that should have been used to instantiate the new commonName is
available in the form action bean (I have been checking using the
context.getRequest().getParameterMap()).

Any thoughts that people have on what is going wrong would be very much
appreciated.

Thanks in advance,

Geoff Shuetrim
------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to