You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "NARANJO-SANCHEZ, Annick" <a....@bouygues-construction.com> on 2001/04/04 17:48:41 UTC

How do you create a table populated with a bean's property which is a vector ?

How do you create a table populated with a bean's property which is a vector
?
We've looked at the "Re: Antwort: Re: iterate / bean write problem" mail on
this list (16 Feb. 2001), we've download the latest build to get sure to
have the bug fixed, but we've been unable to make it works.
We've populated first a drop-down list to get sure that we had handled the
bean properly. We've done this :
	<jsp:useBean id="search" scope="request" type="xxx.xxx.ourBean"/>
      <bean:define id="myCollection" name="search" property="ourList"
scope="request"/>
      <html:select name="search" property="ourList">
            <html:options collection="myCollection" property="code"
labelProperty="description"/>
      </html:select>

where ourBean is a bean which has got a ourList property :
	private Vector ourList;
    	public Vector getOurList() {

        return this.ourList;

    	}

ourList is a vector of objects which countain :
    private String code;		
    private String description;     
    public String getCode(){
        return code;
    }
    public String getDescription(){
        return description;
    }
The list got populated perfectly.
So, we tried this to populate our table :
<logic:iterate id="ourTable" name="ourList" scope="request">
  <tr>
    <td align="left">
      <bean:write name="ourTable" property="code" filter="true"/>
    </td>
    <td align="left">
      <bean:write name="ourTable" property="description" filter="true"/>
    </td>
  </tr>
</logic:iterate>
We got a "Cannot find bean region in scope null" error. What are we doing
wrong ?
Thanks for any help.
Annick Naranjo Sanchez
a.naranjosanchez@bouygues-construction.com