You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Sundar Narasimhan <su...@ascent.com> on 2003/05/23 06:57:38 UTC

how to get multibox to set the zero-length case correctly

Hi, When I use a html or nested:multibox, is there a way to get
set<Property> called on the form object when NONE of the check-boxes
are selected?  The behavior I'm seeing is that struts does NOT invoke 
    setProperty(String arg[]) 
with a 0 length array (which is what I would expect) in this case.

In most of the cases, I can get away with "reset" setting the string
array to a zero length array, but there are a couple of cases where I
don't want to do this. 

More detail:

Consider a query-page that has a bunch of fields, a couple of
multiboxes etc. Imagine you have the query page returning hundreds of
results so you want to use a pager tag. Pages in the query results are
traversed by GET html links and I really don't want to be mucking with
the URL's it generates to "POST" the current state of all my
check-boxes.  I would like to display the query form used to generate
the results along with the results themselves. Unfortunately w/ the
above design page 1 looks ok but when you traverse to page 2, all
state pertaining to the multi-boxes are lost -- why? Because the reset
method sets them to null, and the GET url does not have the checkbox
states. Even when I have the form in a session context.. it's
surprising that this can't be made to work easily.

Thoughts on how people handle this sort of situation in general?

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org