List Info

Thread: Created: (STR-2927) nested:select multiple select box not storing empty values, i.e. retaining previ




Created: (STR-2927) nested:select multiple select box not storing empty values, i.e. retaining previ
user name
2006-08-15 19:34:21
nested:select  multiple select box not storing empty values,
i.e. retaining previous values if none is selected.
------------------------------------------------------------
----------------------------------------------------

                 Key: STR-2927
                 URL: http:
//issues.apache.org/struts/browse/STR-2927
             Project: Struts 1
          Issue Type: Bug
          Components: Taglibs
    Affects Versions: 1.2 Family
         Environment: Windows XP professional
            Reporter: Sreedhar Mada
            Priority: Critical


I'm using nested:select tag in my application to hold
multiple values. Here is the HTML for my element.

<select name="testBox"
multiple="multiple" size="3"
><option value="1">ABC</option>
<option value="3"
selected="selected">DEF</option>
<option value="4">GHI</option>
<option value="6"
selected="selected">JKL</option>
<option value="9">MNO</option>
<option value="44"
selected="selected">PQR</option>
<option value="66"
selected="selected">STU</option>
<option value="08"
selected="selected">VWX</option>
<option value="11"
selected="selected">YZA</option>
<option value="21111">BCDE</option>
<option value="1111">FFFFF</option>
<option value="0000">RGEV</option>
<option value="209">TQPN</option>
<option value="102">MTR</option>
</select>


This element represents the data I previously saved in the
database. If I re-visit the application and deselect all the
options selected in this box, it is not reflecting to show
empty list. I'm using a string array in my form bean to
hold these values. 
Once all the values are deselected, the String array should
be empty or null. But  it is still holding the previous set
of values.

Instead of deselecting all the options, If I do any other
action(selecting other values or deselecting one or more by
keeping atleast one value selected)  it works fine.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the
administrators: http://issues.apache.org/struts/secure/Administrators.
jspa
-
For more information on JIRA, see: http://www.atl
assian.com/software/jira

        
Commented: (STR-2927) nested:select multiple select box not storing empty values, i.e. retaining pre
user name
2006-08-15 20:37:21
    [ http://issues.apache.org/struts/browse
/STR-2927?page=comments#action_37962 ] 
            
Kalpesh Modi commented on STR-2927:
-----------------------------------

This is not a bug. This is how some browser behaves. You get
key=value 
in the request only if the checkbox/select is selected. If
you dont 
select or unselect it, you wont get the key=value in your
request.

In your reset method of the ActionForm, reset the value for
the array 
to null.

Thanks,
-Kalpesh

> nested:select  multiple select box not storing empty
values, i.e. retaining previous values if none is selected.
>
------------------------------------------------------------
----------------------------------------------------
>
>                 Key: STR-2927
>                 URL: http:
//issues.apache.org/struts/browse/STR-2927
>             Project: Struts 1
>          Issue Type: Bug
>          Components: Taglibs
>    Affects Versions: 1.2 Family
>         Environment: Windows XP professional
>            Reporter: Sreedhar Mada
>            Priority: Critical
>
> I'm using nested:select tag in my application to hold
multiple values. Here is the HTML for my element.
> <select name="testBox"
multiple="multiple" size="3"
><option value="1">ABC</option>
> <option value="3"
selected="selected">DEF</option>
> <option value="4">GHI</option>
> <option value="6"
selected="selected">JKL</option>
> <option value="9">MNO</option>
> <option value="44"
selected="selected">PQR</option>
> <option value="66"
selected="selected">STU</option>
> <option value="08"
selected="selected">VWX</option>
> <option value="11"
selected="selected">YZA</option>
> <option
value="21111">BCDE</option>
> <option
value="1111">FFFFF</option>
> <option
value="0000">RGEV</option>
> <option
value="209">TQPN</option>
> <option
value="102">MTR</option>
> </select>
> This element represents the data I previously saved in
the database. If I re-visit the application and deselect all
the options selected in this box, it is not reflecting to
show empty list. I'm using a string array in my form bean
to hold these values. 
> Once all the values are deselected, the String array
should be empty or null. But  it is still holding the
previous set of values.
> Instead of deselecting all the options, If I do any
other action(selecting other values or deselecting one or
more by keeping atleast one value selected)  it works fine.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the
administrators: http://issues.apache.org/struts/secure/Administrators.
jspa
-
For more information on JIRA, see: http://www.atl
assian.com/software/jira

        
Commented: (STR-2927) nested:select multiple select box not storing empty values, i.e. retaining pre
user name
2006-11-09 01:03:00
    [ http://issues.apache.org/struts/browse
/STR-2927?page=comments#action_38627 ] 
            
Sreedhar Mada commented on STR-2927:
------------------------------------


   [[ Old comment, sent by email on 16 Aug 2006 02:55:27
-0000 ]]

Hi Kalpesh,
           Thanks for Your response. But the issue is that,
I
might be having 50 or even 500 multi select boxes in my
application depending
upon the records in my database.
If I implement reset method, I dont want to
iterate each check box and reset it to a default value. Is
there any way to
reset all the multi select boxes to a default value, in one
shot.
As per your
suggestion, I need to get the request parameters and compare
their values with
those of the multi select box selected options and reset it
accordingly?
My
question here is, multi-selectbox A(String[]) is having a
default value null.
Once data is loaded from database A's value is {x,y}. If
user unselects both
the x and y in browser for this multi-select box then it is
still showing the
{x,y} in my Action class when I pass the values back to
database. what I'm
expecting is a null value for A.

Please let me know how to resolve this.
Thanks and Regards,
Sreedhar.


http://issues.apache.org/struts/browse
/STR-2927?page=comments#action_37962 ]
the request only if the checkbox/select is selected. If you
dont
unselect it, you wont get the key=value in your request.
method of the ActionForm, reset the value for the array
i.e. retaining previous values if none is selected.
------------------------------------------------------------
-----------------
-----------------------------------
URL: http:
//issues.apache.org/struts/browse/STR-2927
Struts 1
Affects Versions: 1.2 Family
is the HTML for my element.
size="3" ><option
value="1">ABC</option>
selected="selected">DEF</option>
<option value="6"
selected="selected">JKL</option>
value="9">MNO</option>
selected="selected">VWX</option>
selected="selected">YZA</option>
<option value="1111">FFFFF</option>
<option value="209">TQPN</option>
</select>
database. If I re-visit the application and deselect all the
options selected
in this box, it is not reflecting to show empty list. I'm
using a string array
in my form bean to hold these values.
the String array should be empty or null. But  it is still
holding the
previous set of values.
any other action(selecting other values or deselecting one
or more by keeping
atleast one value selected)  it works fine.
automatically generated by JIRA.
contact one of the administrators:
http://issues.apache.org/struts/secure/Administrators.
jspa
information on JIRA, see: http://www.atl
assian.com/software/jira


> nested:select  multiple select box not storing empty
values, i.e. retaining previous values if none is selected.
>
------------------------------------------------------------
----------------------------------------------------
>
>                 Key: STR-2927
>                 URL: http:
//issues.apache.org/struts/browse/STR-2927
>             Project: Struts 1
>          Issue Type: Bug
>          Components: Taglibs
>    Affects Versions: 1.2 Family
>         Environment: Windows XP professional
>            Reporter: Sreedhar Mada
>            Priority: Critical
>
> I'm using nested:select tag in my application to hold
multiple values. Here is the HTML for my element.
> <select name="testBox"
multiple="multiple" size="3"
><option value="1">ABC</option>
> <option value="3"
selected="selected">DEF</option>
> <option value="4">GHI</option>
> <option value="6"
selected="selected">JKL</option>
> <option value="9">MNO</option>
> <option value="44"
selected="selected">PQR</option>
> <option value="66"
selected="selected">STU</option>
> <option value="08"
selected="selected">VWX</option>
> <option value="11"
selected="selected">YZA</option>
> <option
value="21111">BCDE</option>
> <option
value="1111">FFFFF</option>
> <option
value="0000">RGEV</option>
> <option value="209">TQPN</option>
> <option value="102">MTR</option>
> </select>
> This element represents the data I previously saved in
the database. If I re-visit the application and deselect all
the options selected in this box, it is not reflecting to
show empty list. I'm using a string array in my form bean to
hold these values. 
> Once all the values are deselected, the String array
should be empty or null. But  it is still holding the
previous set of values.
> Instead of deselecting all the options, If I do any
other action(selecting other values or deselecting one or
more by keeping atleast one value selected)  it works fine.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the
administrators: http://issues.apache.org/struts/secure/Administrators.
jspa
-
For more information on JIRA, see: http://www.atl
assian.com/software/jira

        
Resolved: (STR-2927) nested:select multiple select box not storing empty values, i.e. retaining prev
user name
2006-11-28 18:41:57
     [ http://issues.apache.org/struts/browse/STR-2927?page=all
 ]

Niall Pemberton resolved STR-2927.
----------------------------------

    Resolution: Not A Problem

> nested:select  multiple select box not storing empty
values, i.e. retaining previous values if none is selected.
>
------------------------------------------------------------
----------------------------------------------------
>
>                 Key: STR-2927
>                 URL: http:
//issues.apache.org/struts/browse/STR-2927
>             Project: Struts 1
>          Issue Type: Bug
>          Components: Taglibs
>    Affects Versions: 1.2 Family
>         Environment: Windows XP professional
>            Reporter: Sreedhar Mada
>            Priority: Critical
>
> I'm using nested:select tag in my application to hold
multiple values. Here is the HTML for my element.
> <select name="testBox"
multiple="multiple" size="3"
><option value="1">ABC</option>
> <option value="3"
selected="selected">DEF</option>
> <option value="4">GHI</option>
> <option value="6"
selected="selected">JKL</option>
> <option value="9">MNO</option>
> <option value="44"
selected="selected">PQR</option>
> <option value="66"
selected="selected">STU</option>
> <option value="08"
selected="selected">VWX</option>
> <option value="11"
selected="selected">YZA</option>
> <option
value="21111">BCDE</option>
> <option
value="1111">FFFFF</option>
> <option
value="0000">RGEV</option>
> <option value="209">TQPN</option>
> <option value="102">MTR</option>
> </select>
> This element represents the data I previously saved in
the database. If I re-visit the application and deselect all
the options selected in this box, it is not reflecting to
show empty list. I'm using a string array in my form bean to
hold these values. 
> Once all the values are deselected, the String array
should be empty or null. But  it is still holding the
previous set of values.
> Instead of deselecting all the options, If I do any
other action(selecting other values or deselecting one or
more by keeping atleast one value selected)  it works fine.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the
administrators: http://issues.apache.org/struts/secure/Administrators.
jspa
-
For more information on JIRA, see: http://www.atl
assian.com/software/jira

        
[1-4]

about | contact  Other archives ( Real Estate discussion Medical topics )