struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Senthivel U S" <senthivel.usilap...@uaeexchange.com>
Subject Prepopulating DynaActionForm
Date Thu, 02 Jan 2003 14:11:30 GMT
Greetings,
 
I am using DynaAction Form. I want to pre populate Form with multiple
rows. In the form property , I specified
 
<form-bean name="exampleForm"
type="org.apache.struts.action.DynaActionForm">
<form-property name="name" type="java.lang.String"/>
<form-property name="address" type="java.lang.String"/>
<form-property name="country" type="java.lang.String"/>
 
I want to prepopulate the form from database.
 
So what I have done is 
 
ArrayList arraylist = new ArrayList();
 
For (int i = 0; i<count; ++i) {
            DynaBean exampleForm  = DynaActionFormClass.
 
getDynaActionFormClass("exampleForm").newInstance();
 
             PropertyUtils.setSimpleProperty(exampleForm, "name", name);
             PropertyUtils.setSimpleProperty(exampleForm, "customerNo",
address);
             PropertyUtils.setSimpleProperty(exampleForm,
"beneficiaryNo", country);
 
            arraylist.add(exampleForm);
}
 
request.setAttribute("exampleForm", arraylist);
 
Now what I want is , is it correct way of doing or any other better way
is there.
Pls help me.
 
Thanx,
Sen

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message