I filed an issue in April 2007 (the patch probably unusable right now) to support autocompleting multiple fields

https://issues.apache.org/jira/browse/WICKET-488

An example would be to select an address from the autocompleter which will fill in the fields for street, zip code, city, etc.

The basic idea was to change this line in the wicket-autocompleter.js:

                        obj.value=getSelectedValue();

which can only replace the value of one dom object with something like

if(handleSelection(value)) // execute optional 'onselect' handler
                      obj.value = value;


  function handleSelection(input) {
      var menu = getAutocompleteMenu();
var attr = menu.firstChild.childNodes[selected].attributes['onselect'];
      if(attr)
        return eval(attr.value)(input);
      else
        return true;
  }

all the generated list items of the autocompleter html could optionally have an onselect attribute to execute arbitrary javascript

<ul>
  <li onselect="fillAddressData()"> autocompleter item #1 </li>
  <li onselect="doSomethingElse()"> autocompleter item #2 </li>
</ul>

Maybe this almost dead issue could be revived if you like the idea ...

(In that case I wouldn't mind update the patch for current 1.3.x and 1.4.x)

Cheers
Peter


Am 30.05.2008 um 09:23 schrieb Roland Huss:


Hi Daniel,


Daniel Stoch-2 wrote:

The main
problem is that the AutoCompleteTextField and related classes
(behavior, renderer) are not easily to extend (eg. it is necessary to
make a few modifications in wicket-autocomplete.js but in
AbstractAutoCompleteBehavior the standard js is added in renderHead
method, so there is no way to replace it, etc.). So I must made a copy
of these standard classes and then made modifications in them.


I had the same problem with extending AbstractAutoCompleteBehavior while
working on wicketstuff-objectautocomplete and I already
opened a Jira issue for that. You might want to vote for
https://issues.apache.org/jira/browse/WICKET-1651 which provides a patch for putting AACB's renderHead() logic into a protected initHead() method, which
then
can be overwritten by a subclass and AACB.super.renderHead() is still
called.

...roland
--
View this message in context: 
http://www.nabble.com/AutoCompleteTextField---autocomplete-multiple-fields-tp17500271p17553097.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]


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

Reply via email to