Hi,

I need some help with the AutoCompleteTextField.  I would like it to show
the choice list when some one clicks in the field not just when the user
type a letter or two.  I find that, atleast in my case, when I click on the
field getChoices method is not called.  

I have tried some thing such as adding 'onClick' ajax event. But it does not
seem to work.

Below is my code and I will gretaly appreciate any help.

Thanks,

-Mohammad


        private void addAutoCompleteTextField(
                final PresenterParameterText presenter)
        {
                AutoCompleteSettings autoCompleteSettings = new 
AutoCompleteSettings();
                autoCompleteSettings.setShowListOnEmptyInput(true);
                
                
                final AutoCompleteTextField<String> textField 
                                = new AutoCompleteTextField<String>(
                                                "value", 
                                                new 
PropertyModel<String>(presenter, "value"),
                                                autoCompleteSettings)
                {
                                @Override
                                protected Iterator<String> getChoices(String 
input)
                                {
                                        List<String> list;
                                        try
                                        {
                                                //list = ..........             
                                                                                
   
//return list.iterator();                                               
                                        }
                                        catch (Throwable t)
                                        {
                                                
getRequestCycle().setRedirect(true); 
                                                throw new 
RestartResponseException(new ErrorPage(t));                                     
                              
                                        }                                       
                                }                               
                };
                
                add(textField);
                
                textField.setOutputMarkupPlaceholderTag(true);
                textField.add(  new AjaxEventBehavior("onclick") 
                {
                                    @Override
                                 protected void onEvent(AjaxRequestTarget
target) 
                                    {
                                     presenter.setValue("");
                                     target.addComponent(textField);

                                       // How do I fire the event to call
the textFields getChoices method ???
                                    }
                           });
                
                
        }
-- 
View this message in context: 
http://www.nabble.com/AutoCompleteTextField%3A-Making-Wicket-call-getChoices-method-on-%27onClick%27-event-tp20411983p20411983.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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

Reply via email to