I'm trying to use a autocompleter that is to be built from a list (of
objects).

I want the objects id to be the value of the option and code to bethe label
to be shown in the autocompleter dropdown options.

I should be shown codes as select options in the dropdown and when I select
any of the code, the corresponding id should go as the value that has been
selected

Pointers on this would be of great help


newton.dave wrote:
> 
> Search a database of city names?
> 
> I'm not sure what you're asking.
> 
> 
> --- On Thu, 6/12/08, xianwinwin <[EMAIL PROTECTED]> wrote:
> 
>> From: xianwinwin <[EMAIL PROTECTED]>
>> Subject: struts2: how to read the 'potenrial list' from a database
>> To: user@struts.apache.org
>> Date: Thursday, June 12, 2008, 6:07 PM
>> I have a list of 20,000 cities; I would like the user to
>> provide at least 2
>> chars and then present him a'potential list'.
>> 
>> I managed to do this:
>> 
>> JSP
>> 
>> <s:autocompleter theme="simple"
>> list="state" name="StateName"/>
>> 
>> 
>> 
>> Java:
>> 
>> public class autocompleter extends ActionSupport
>> {
>>   private List state;
>>   public String execute() throws Exception{
>>     state = new ArrayList();
>>     state.add("Bonn");
>>     state.add("Paris");
>> .
>> .
>> .
>>  
>>     return SUCCESS;
>>   }
>>   
>>    public List getState(){
>>     return state;
>>   }
>> }
>> 
>> as you can see, the autocompliter is based on the
>> 'state' I initially
>> provided. But what if the list is huge???
>> 
>> Q: How can I invoke an action once the user types a letter
>> (str) and the
>> string gets to the invoked-method (based on the str the
>> method will invoke
>> the appropriate list)
>> 
>> thank you!!!
>> -- 
>> View this message in context:
>> http://www.nabble.com/struts2%3A-how-to-read-the-%27potenrial-list%27-from-a-database-tp17810726p17810726.html
>> Sent from the Struts - User mailing list archive at
>> Nabble.com.
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail:
>> [EMAIL PROTECTED]
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/struts2%3A-autocompleter---howto-read-the-%27potenrial-list%27-from-a-database-tp17810726p17820863.html
Sent from the Struts - User mailing list archive at Nabble.com.


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

Reply via email to