Here is how it should work

If you have 5 fields like so:

<input name="myMap['key1']" value=""/>
<input name="myMap['key2']" value="A"/>
<input name="myMap['key3']" value=""/>
<input name="myMap['key4']" value="B"/>
<input name="myMap['key5']" value=""/>


you should have the myMap property on the action populated with the
equivalient of:

Map myMap = new HashMap();
myMap.put("key1", null);
myMap.put("key2", "A");
myMap.put("key3", null);myMap.put("key4", "B");
myMap.put("key5", null);

If that is how it is working then it is expected functionality and what the
JIRA ticket rolled back to. The original fix was to remove null value keys.
That was removed and it *should* be allowing null value keys.

If you don't want null value keys you can always iterate through the map and
remove all null values.

It would be good to post your code too.

Brandon Goodin

On Tue, Jun 23, 2009 at 10:36 AM, Danny C <[email protected]> wrote:

>
> Team,
>
> I'm having the same problem, but reading the bug log it looks like the
> "fix"
> was reverted (which is what I want). I need empty fields to come through my
> map as empty/null. I'm running Version: 1.5.1, Build: 1102. is there
> something I need to do to get the map to come through the "other side"
> intact?
>
> Thanks!
>
> D
>
>
> bgoodin wrote:
> >
> > Phil what version of Stripes are you using? Just curious if it is an old
> > one
> > or current?
> > Brandon
> >
> > On Mon, Mar 30, 2009 at 4:04 AM, Phil Sladen
> > <[email protected]>wrote:
> >
> >> I have an actionbean property "HashMap<String,String> tagMap" that is
> >> used
> >> to gather dynamically generated form values from input fields named like
> >> "tagMap[propName]". Works fine as long as the value in the form field is
> >> not
> >> empty. But if it is empty, it appears that
> >> DefaultActionBeanPropertyBinder.validateRequiredFields() deliberately
> >> ignores the form field. Please can anyone explain such logic and how I
> >> can
> >> get mapped values to work sensibly even when the values are empty.
> >> Thanks.
> >>
> >>
> >>
> >>
> >>
> ------------------------------------------------------------------------------
> >>
> >> _______________________________________________
> >> Stripes-users mailing list
> >> [email protected]
> >> https://lists.sourceforge.net/lists/listinfo/stripes-users
> >>
> >>
> >
> >
> ------------------------------------------------------------------------------
> >
> > _______________________________________________
> > Stripes-users mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/stripes-users
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Mapped-property-ignored-if-value-is-empty---tp22778936p24167334.html
> Sent from the stripes-users mailing list archive at Nabble.com.
>
>
>
> ------------------------------------------------------------------------------
> Are you an open source citizen? Join us for the Open Source Bridge
> conference!
> Portland, OR, June 17-19. Two days of sessions, one day of unconference:
> $250.
> Need another reason to go? 24-hour hacker lounge. Register today!
>
> http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org
> _______________________________________________
> Stripes-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/stripes-users
>
------------------------------------------------------------------------------
Are you an open source citizen? Join us for the Open Source Bridge conference!
Portland, OR, June 17-19. Two days of sessions, one day of unconference: $250.
Need another reason to go? 24-hour hacker lounge. Register today!
http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org
_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to