Content of Select Box
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Raji_Sriram
Posted On:   Wednesday, January 16, 2002 02:12 PM

I have an application where, on submitting the form, I need all the data inside the select box. But the form bean stores just the ones that were selected. If I select all explicitly, everything gets highlighted which does not give a good look. Is there a work around? One solution I thought of is to have a hidden select box that would duplicate the original select box and in the Action class, we could take the values of the hidden one. But, I think there should be a better way to do it. Thanks in advance for any help you may provide.    More>>

I have an application where, on submitting the form, I need all the data inside the select box.
But the form bean stores just the ones that were selected.
If I select all explicitly, everything gets highlighted which does not give a good look.


Is there a work around?


One solution I thought of is to have a hidden select box that would duplicate the original select box
and in the Action class, we could take the values of the hidden one.
But, I think there should be a better way to do it.



Thanks in advance for any help you may provide.

   <<Less

Re: Content of Select Box

Posted By:   Ted_Husted  
Posted On:   Sunday, January 20, 2002 05:52 AM


The formbean can store whatever is submitted with the request.
Unfortunately, HTTP does not expect that unselected options
will be sumitted, and so the browsers don't do that. :(



The only recourse I know of is to use some type of hidden field.
One trick people use to write a number of hidden properties
is to use a serializable bean and write that as the
hidden property. Haven't tried it myself, though,
so I don't have any code samples of that. :((



-Ted

About | Sitemap | Contact