I have to display a drop down on my JSP using html select tag. Since I
am using struts , I am using <html:select>  tag. I have a Form Bean
FooForm in request scope. This form bean has array of custom defined
Action objects. My Action object is a bean with ActionID and ActionName
as the attributes.  I require Actions actionName as the value for my
select option. Can someone help me with some code snippet on how to do
this.


My Form bean

public class FooForm extends ActionForm {

                public Action[] actionList;

                public Action[] getActionList() {
                        return actionList;
                }
        
                public Action getActionList(int index) {
                        return actionList[index];
                }

                public void setActionList(Action action, int index) {
                        this.actionList[index] = action;
                }
                
                public void setActionList(Action[] actionList) {
                        this.actionList = actionList;
                }

}

public class Action {

                
                public int actionId;

                
                public String actionName;
                                                
                public int getActionId()
                {
                        return actionId;
                }
                
                public String getActionName()
                {
                        return actionName;
                }
                
                public void setActionId(int id)
                {
                        this.actionId = id;
                }
                
                public void setActionName(String name)
                {
                        this.actionName = name;
                }
                
}

On my JSP

<html:select property="actionList">
        <html:options property="actionList" />
</html:select>


Thanks for your help in advance.

Sandhya


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to