RE: [50% SOLVED] Resetting Multibox problems

2004-04-09 Thread Wendy Smoak
> From: Mathieu Grimault [mailto:[EMAIL PROTECTED] 
> I've found a way of bypassing the problem by using a logic:equal and
> logic:notEqual inside the jsp and testing my row value. This way, the
> display is correct... it's just not clean.

You really shouldn't need to do all that.  Here's a working example of
multibox from my project.  In my case 'accountMap' is not a form
property, it's a Map sitting in session scope.  I'm not sure if the code
you posted is wrapped in a  or not?  Stuts will
pre-select the correct checkboxes based on the values in the String[]
form property.

In the JSP





The Form property is a String[]:
 
   
   

And the reset method, which only resets if the form is actually being
submitted:
public void reset( ActionMapping mapping, HttpServletRequest request )
   {
  log.debug( "reset: begin" );
  if ( request.getMethod().equals( "POST" ) ) {
 log.debug( "reset: request was POSTed, resetting" );
 set( "accounts", new String[]{} );
 set( "includeDetail", Boolean.FALSE );
  }
   }

I put this on my Wiki because it comes up often:  
http://wiki.wendysmoak.com/cgi-bin/wiki.pl?StrutsMultiBox

If anyone has suggestions, just edit the page...

Hope that helps!

-- 
Wendy Smoak
Application Systems Analyst, Sr.
ASU IA Information Resources Management 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[50% SOLVED] Resetting Multibox problems

2004-04-09 Thread Mathieu Grimault
I've found a way of bypassing the problem by using a logic:equal and
logic:notEqual inside the jsp and testing my row value. This way, the
display is correct... it's just not clean.


New jsp :


" checked="checked">


">


Old jsp :







- Original Message - 
From: "Mathieu Grimault" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Friday, April 09, 2004 3:10 PM
Subject: Resetting Multibox problems


Re-Hello !

In addition to my question, i've seen that spy the reset() and constructor
call of my actionForm :

life cylcle :
- constructor -> first access on the jsp
- reset -> first access on the jsp
- display of the jsp and submit
- constructor -> after submiting
- reset -> after submiting
- the form is transmitted to an action who forward to another jsp

Each time i came back to the jsp :
- reset -> each time a leave the jsp

As i mention before, i used combo box. They are correctly initalised the
first time but never changed whatever the reset method does (normally) and
whatever is set in the String[]...

Regards.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]