hi all,

I would like to display an autocompleter associated with a application-defined Javabean and have it picking up the right key and value out of the bean properties (getters). I have hard time following the examples as I cant find any that provides the code required on the Action side. I would prefer staying away from magical encodings etc just to have it pull the Id and Value out of the bean property as shown below.

Say I have e.g.:

********************************************************
@Immutable
class Customer {
   private String id;
   private String name;
   public Customer(String id, String name) {
          this.id=id;
          this.name=name;
   }
   public String getName {
         return name;
   }
   public String getId {
         return id;
   }
}
**********************************************************
public MyAction extends ActionSupport {
   List<Customer> customers = new ArrayList<Customer>();
   @Override
   public String execute() throws Exception {
       super.execute();
       customers.clear();
       customers.addAll(findSomeCustomers());
       return SUCCESS;
   }
   public List<Customer> getCustomers() {
       return this.customers;
   }
}
**********************************************************
example.jsp
**********************************************************
<s:head theme="ajax"/> <s:form action="Something.action" method="post" theme="%{currentTheme}"> <s:autocompleter name="customer" list="customers" /> </s:form>

I cant find THE way to say:

autocompleter VALUE is Customer.name
autocompleter KEY is Customer.id

TIA,
regards,
Giovanni

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

Reply via email to