struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rajan Gupta <rgupta99_1...@yahoo.com>
Subject Re: How to iterate to create select box.
Date Fri, 27 Apr 2001 16:03:30 GMT
How is scope valid, the documentation says that scope is a valid tag
attribute, but looking at the IterateTag.java I could not find such an
attribute. Am I missing something?
--- Alex Colic <alex.colic@pop-ware.com> wrote:
> Hi,
> 
> I am trying to iterate through a vector to populate a select box.
> 
> I have a class CategoryList in application scope that holds a list of
> Categories. Each category has a CategoryGroup name and a vector of
> CategoryValues.
> 
> At run time I am trying to create a page that dynamically creates the
> above
> select boxes not knowing how many elements will be in the list.
> 
> I can iterate through the CategoryGroupName via:
> 
> <logic:iterate id="category" name="CategoryList" property="categoryList"
> scope="application">
>   <bean:write name="category" property="categoryGroup" filter="true"/>
> 
> <!--need to figure out how to create select box -->
> 
> </logic:iterate>
> 
> Any help in figuring this out is appreciated.
> 
> My category class is as follows:
> 
> public class pwCategory
> {
> 
>   private String categoryGroup;
>   private String categoryName;
>   private String categoryAbrv;
>   private int categoryNumber;
>   private String categoryValue;
>   java.util.Vector categoryValues;
> 
>   public pwCategory()
>   {
>   }
> 
>   public String getCategoryGroup()
>   {
>     return categoryGroup;
>   }
> 
>   public void setCategoryGroup(String newCategoryGroup)
>   {
>     categoryGroup = newCategoryGroup;
>   }
> 
>   public void setCategoryAbrv(String newCategoryAbrv)
>   {
>     categoryAbrv = newCategoryAbrv;
>   }
> 
>   public String getCategoryAbrv()
>   {
>     return categoryAbrv;
>   }
> 
>   public void setCategoryNumber(int newCategoryNumber)
>   {
>     categoryNumber = newCategoryNumber;
>   }
> 
>   public int getCategoryNumber()
>   {
>     return categoryNumber;
>   }
> 
>   public void setCategoryValue(String newCategoryValues)
>   {
>     categoryValue = newCategoryValues;
>   }
> 
>   public String getCategoryValue()
>   {
>     return categoryValue;
>   }
> 
>   public void setCategoryValues(java.util.Vector newCategoryValues)
>   {
>     categoryValues = newCategoryValues;
>   }
> 
>   public java.util.Vector getCategoryValues()
>   {
>     return categoryValues;
>   }
> }
> 
> My categoryList class is as follows:
> 
> 
> import java.util.*;
> import com.popware.avantis.*;
> 
> public class pwCategoryList
> {
>   private List categoryList=new Vector();
> 
>   public pwCategoryList()
>   {
>   }
> 
>   public List getCategoryList()
>   {
>     return categoryList;
>   }
> 
>   public void setCategoryList(List categoryList)
>   {
>     this.categoryList = categoryList;
>   }
> 
>   public void addCategoryList(pwCategory newCategory)
>   {
>     categoryList.add(newCategory);
>   }
> }
> 
> Regards
> 
> Alex
> 


__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/

Mime
View raw message