Again I haven't used Niall's classes but I'd hazard a guess that as they extend DynaBean that you use the map like interface for accessing these properties. In fact I imagine you can cast them as a DynaBean like you can with the DynaActionForms

DynaBean myForm = (DynaBean) form;
String foo = myForm.get("foo").toString();



On 9 Mar 2004, at 20:27, Metin Carl wrote:

This is really good. An example of processing this form in Action classes
would be very useful too as the way Shanmugam needs.



"Niall Pemberton" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
Yup, thats it - plus dynamic="true"

 <form-bean name="fooForm1"
type="lib.framework.struts.LazyValidatorActionForm" dynamic="true" />
 <form-bean name="fooForm2"
type="lib.framework.struts.LazyValidatorActionForm" dynamic="true" />
 <form-bean name="fooForm3"
type="lib.framework.struts.LazyValidatorActionForm" dynamic="true" />
 <form-bean name="fooForm4"
type="lib.framework.struts.LazyValidatorActionForm" dynamic="true" />

Oh, I noticed an error in LazyValidatorForm, its declared as "abstract" -
which it shouldn't be - I don't use it directly, I use
LazyValidatorActionForm which extends it.


Niall


----- Original Message ----- From: "Mark Lowe" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" <[EMAIL PROTECTED]> Sent: Tuesday, March 09, 2004 8:53 AM Subject: Re: Populating form Elements from another object.


I haven't seen the code but if what i understand of what Niall has been
saying you'd use them instead of DynaActionForm.


<form-bean name="fooForm" type="com.ilovesparrows.struts.NiallsForm" />

of course you'll need to call the package and class name to something
appropriate.

On 9 Mar 2004, at 09:47, shanmugampl wrote:

Hi,

   I saw your code. I have one doubt. How do you plugin your own
DynaBean implementation into the struts framework.

Shanmugam PL

Niall Pemberton wrote:

I wrote these....

http://www.niallp.pwp.blueyonder.co.uk

Niall

----- Original Message ----- From: "shanmugampl"
<[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, February 25, 2004 7:00 AM
Subject: Populating form Elements from another object.



Hi,

I have a requirement where i need to populate the values of a
form from another object, and then again transform the contents of
the form back to the object once the form is submitted. i.e Say,
when i click a button, i do some functionalities and have a
Properties object as an output. The keys in the Properties object
are not static. These values need to be shown in a form. As the keys
retrieved for the current operation is not known, i cant define the
values in the struts-config.xml for the dynaactionclass.


      Is it possible to extend the dynaactionclass, and during its
init or something, iterate the properties object and populate the
form.  Are there any other way of doing it.

Thanks
Shanmugam PL



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






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





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






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



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



Reply via email to