I am trying to implement a form that uses the Autocompleter component
  http://tapestry.apache.org/tapestry4.1/components/dojo/autocompleter.html


I had a look at the TimeTracker demo application. It already works, but I have one requirement that's differnet from the way the demo is implemented:

The time trackler loads a complete list of objects from the DAO layer:

return new DefaultAutocompleteModel(getProjectDao().list(), "id", "name");


In my application it is not possible to load the complete list from the database. Instead the function in my DAO layer takes one argument:

   List<Location> getManager().getLocations(String startWith);


So, how can I retrieve the user's input in the autocompleter field? For example: the user enters "Aber", I retireve all Locations from the database that start with "Aber" (Aberdeen), and then build a model.

I tried

    @EventListener(
        events = "onValueChanged",
        targets = "locationChoose"
    )
    public void projectSelected(BrowserEvent event){

        String selection = event.getMethodArguments().getString(0);
        LOG.trace("Selected value = '" + selection + "'");


        getBuilder().updateComponent("locationDescription");
    }

but that return an identifier. The problem is: I don't need an identifier for my call into the DAO layer, but the raw user's input...


Another question: I want my autocompleter to start async request only when the user entered three or more chars. Is that possible?

Andy


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

Reply via email to