You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Struts Newsgroup (@Basebeans.com)" <st...@basebeans.com> on 2002/03/14 15:10:01 UTC

FormBean with List of Value Objects

Subject: FormBean with List of Value Objects
From: "Arthur Frankel" <ar...@yahoo.com>
 ===
Assuming that I take my ArrayList of Value Objects coming back from the EJB
container and store them as a List in the FormBean, what's the best way to
easily access the data in the List within the JSP and display the "name" of
each item in the AccountData list (e.g. bean:write)?

Let's say the FormBean (MyForm) has a List of AccountData:

public final class MyForm extends ValidatorForm implements Serializable

{
    private List myAccountData = null;

    public List getAccountDataList() {
       return myAccountData ;
    }

    public void setAccountDataList(List myAccountData ) {
        this.myAccountData = myAccountData ;
    }
......

and AccountData has a getter

public class AccountData implements Serializable
{
    private String name = null;

    public List getName() {
       return name ;
    }

    public void setName(String name ) {
        this.name = name ;
    }
......






--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>