Hi,

Not sure it is the best practice...

I have a for to edit a user called UserForm. This form contains a popup
(<select>) with Customers.

I didnąt find an easier way to include the data of the popup in the
UserForm:

Public class UserForm extends ActionForm {
    ....
    protected ArrayList customer_popup;

    ....

    public ArrayList getCustomerPopup() {
        return this.customer_popup;
    }
    
    public void setCustomerPopup(ArrayList customer_popup) {
        this.customer_popup = customer_popup;
    }
} 

So before editing the user and while building the form, I build the form and
fill the ArrayList with the customers as well.

So far so good that works, but if I use validation, and the page with the
form needs be reloading to tell me what went wrong, I have the problem that
struts doesnąt find the arraylist in the form anymore:

javax.servlet.ServletException: ServletException in
'/setup/users/edit_user_data.jsp': Failed to obtain specified collection

In the jsp, I use:

<html:select property='customerId'>
       <html:optionsCollection property='customerPopup' label='name'
value='id' />
</html:select>

If I remove it, it works fine.


Using struts 1.2.4 with TC 5.5.

Any idea?

Thank you, BW.

Reply via email to