You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Fred <li...@fh.servebeer.com> on 2004/10/04 15:26:59 UTC

Complex bean structure handling

Hi, 
 
I have a architecture problem, which happen often I suppose, the master
detail management. I would like  to manage a html form with some simple
field and a list : 
 
id
Name
adress
 
than a list of product
 
id, name, qte
id, name, qte
 
Using simple field (non struts form), I get an array of id, an array on
name and a array of qte in the request.
But, the management is complex. How could I structure a dynaform or a
form bean and declare it in struts config to handle this ?
 
I found this article
http://www.developer.com/java/ejb/article.php/2233591 from James Turner
but I do no see how to handle the full form with the embedded master
detail structure. 
Thanks
Frederic

Re: Complex bean structure handling

Posted by Vic Cekvenich <ce...@portalvu.com>.
public class OrderBean extends FormBean {


get/setName ...

get/setAdress ...

}


public class ItemListBean extends FormBean implements Collection {

private OrderBean;

getOrderBean() {return OrderBean;}


get/setProductName ...

getsetQt ...
}

then in form you can do a c tag to iterate the list of product items 
from your one "combo" bean.

For the nested bean you use the dot notation in JSP

orderBean.adress


It happens on... most any form, very few forms are simple beans. You can 
also read the tuotirals on nestedbeans on keyboardmonkey.com

hth,
.V



Fred wrote:
> Hi, 
>  
> I have a architecture problem, which happen often I suppose, the master
> detail management. I would like  to manage a html form with some simple
> field and a list : 
>  
> id
> Name
> adress
>  
> than a list of product
>  
> id, name, qte
> id, name, qte
>  
> Using simple field (non struts form), I get an array of id, an array on
> name and a array of qte in the request.
> But, the management is complex. How could I structure a dynaform or a
> form bean and declare it in struts config to handle this ?
>  
> I found this article
> http://www.developer.com/java/ejb/article.php/2233591 from James Turner
> but I do no see how to handle the full form with the embedded master
> detail structure. 
> Thanks
> Frederic
> 


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