struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Harig" <James.Ha...@systemsandsoftware.net>
Subject RE: Can struts do it / 2?
Date Fri, 21 Apr 2006 12:47:43 GMT
The problem might have something to do with the way you have defined the
scope of your bean.  If it is "request," then you will lose the original
contents of the bean when the user submits the form. 

Here's an example,

ACTION: Populate form bean, and forward to jsp
STRUTS: display jsp
USER: Submit the form
STRUTS: Reset the form bean, and/or create a new form bean, and submit
the new values

It's at this last step that problems can occur.  The form bean now has a
data member of type array[] that may or may not have the same number of
elements that are on the screen.
To alleviate this problem, you should use something like a Lazy List. 

This link might help: 
http://wiki.apache.org/struts/StrutsCatalogLazyList

Good luck

-James
 

-----Original Message-----
From: Marco Mistroni [mailto:mmistroni@waersystems.com] 
Sent: Friday, April 21, 2006 6:24 AM
To: 'Struts Users Mailing List'
Subject: RE: Can struts do it / 2?

Hello,
  Thx... but seems not to work

i cant manage to populate back to the Action class,.. since I will have
an array of DTO that needs to be submitted from the page.

The crucial problem that I am having is mainly that within the
logic:iterate, for each 'row' I need to create an input parameter that
is associated to a property of type array[]

In pseudocode, it would be like this

<logic:iterate>
..   <html:checkbox property="x"/>
</logic:iterate>


And that should generate a checkbox for each row. 

I cannot manage how to do that... I m sure someone has already had this
problem...

Any help?

Regards
 marco


-----Original Message-----
From: Tremal Naik [mailto:tremalnaik@gmail.com]
Sent: 21 April 2006 11:09
To: Struts Users Mailing List
Subject: Re: Can struts do it?

2006/4/21, Marco Mistroni <mmistroni@waersystems.com>:
> I have a DynaActionForm.  It has two array fields (String[] ownerRef 
> and Boolean[] suspendPart) and some other fields.  I want to populate 
> these arrays from a form and be able to submit the value from the
page.
>  That's it.

why don't you define an array of beans, each of which containing two
properties:

class myBean{

}
--
TREMALNAIK

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


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


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


Mime
View raw message