Need help... I want to try the auto-complete capabilities of beta8, but what I have to do please:
1) have to set a document listener with setDocument(Document) and then add to it a DocumentListener or use the method addPropertyChangeListener(TEXT_CHANGED_PROPERTY, java.beans.PropertyChangeListener) ?
2) ...how can I set the delay to notify server of keyboard event? Is there a method inside text-field (didn't see)?
3) are you planning to add to Echo3Extra a "Autocomplete combo box"? ...would be very useful - I vote for this!!! - please add it to roadmap!!! :-)
4) if no, what is the best way to create a "Autocomplete combo box" or something similar using echo3 components?
THANKS very much! Kind regards!
---Matteo---
Not sure yet on the
Not sure yet on the autocomplete combo box...I think we need something along these lines. Have done one for a client before but we'd need something a bit more generic if it were to go into the framework.
To configure a text component t initiate synchronizations after input/blur, you need t invoke:
You can also use the
PROPERTY_SYNC_DELAYandPROPERTY_SYNC_INITIAL_DELAYto configure the delay between the user not having typed in the text field and the synchronization occurring.Please disregard the
EXPERIMENTALflags on these properties, they appear to have not been pulled before beta8.Take a look at TextComponentTest for an example. https://svn.nextapp.com/svn/echo3/trunk/src/server-java/testapp-interactive/lib/nextapp/echo/testapp/interactive/testscreen/TextComponentTest.java
Thank you!!!
I experimented as you told me.... it's easy to implement and reliable (on my little intranet).... Thanks!
Again, I vote for a component in the framework like auto-complete combo box or something similar!!! (very important for database application)
Another request: can you implement a lost-focus listener on text-component in order to have the possibility to validate input immediately as the user leave the single text-field (even if the user push "tab" or move with the mouse on another component...)!
Thanks in advice for you patience!
---Matteo---
Blur
I understand the SYNC_ON_CHANGE/SYNC_ON_ACTION thing, still, I can't figure out how to perform a "onBlur" synchronization.
Any hint?
I'm trying to replace all the javascript code I wrote with the new features in beta8...
Thanks in advance.
---
Cheers
Carlo.
Amateurs practice until they get it right.
Professionals practice until they can't get it wrong.
Any news about this
Just like Carlo I was looking for a way to perform a onBlur synch that, shoud be included in the last version of echo3.
Any news about that ?
As we can see in the Echo.Sync.TextComponent now the event registred from the component render phase are
Core.Web.Event.add(this.input, "keydown", Core.method(this, this._processKeyDown), false);
Core.Web.Event.add(this.input, "click", Core.method(this, this._processClick), false);
Core.Web.Event.add(this.input, "focus", Core.method(this, this.processFocus), false);
Core.Web.Event.add(this.input, "blur", Core.method(this, this.processBlur), false);
I've not understooden yet in deep the next step introduced by echo3 component to synch, to do its "magic".
To manage the keypress I only need to
textField.set(TextComponentPeer.PROPERTY_SYNC_MODE, TextComponentPeer.SYNC_ON_CHANGE);
textField.set(TextComponentPeer.PROPERTY_SYNC_DELAY, 10);
textField.set(TextComponentPeer.PROPERTY_SYNC_INITIAL_DELAY, 10);
textField.addPropertyChangeListener(TextField.TEXT_CHANGED_PROPERTY, new PropertyChangeListener(){
@Override
public void propertyChange(PropertyChangeEvent evt) {
logger.debug("old value:"+ evt.getOldValue());
logger.debug("new value:"+ evt.getNewValue());
}
});
How could I get the onblur event synch ?
Thanks very much for patience and for any hint.
Riccardo