« Return to Thread: How to fill a DropDownList with custom options?

Re: How to fill a DropDownList with custom options?

by Roy Abu Bakar :: Rate this Message:

Reply to Author | View in Thread

i gave u an example (in your ApplicationBean1)

private String[] status;

public String[] getStatus() {
    return status;
}

private Option[] statusOptions;

public Option[] getStatusOptions() {
    return statusOptions;
}

public void init() {
        this.status = new String[]{"Enabled", "Disabled"                };
        this.statusOptions = new Option[this.status.length];
        for (int i = 0; i < getStatus().length; i++) {
            statusOptions[i] = new Option(getStatus()[i]);
        }
}

 « Return to Thread: How to fill a DropDownList with custom options?