KeystrokeTextField

mjablonski's picture

Hi,

I've just created a wiki-page for a "KeystrokeTextField"-component:

http://wiki.nextapp.com/echowiki/Echo3KeystrokeTextField

What's a KeystrokeTextField?

If you want to create an "auto suggest"-formular or a search-form which immediately shows the results (without hitting enter or submit), you'll need a TextField which synchronizes each keystroke between client and server. The Echo3-default-TextField synchronizes only when enter is hit to avoid unnecessary load. This is a very good default. But there are special corner-cases where do you want more interaction. Please use the following component with care, it creates a request for every keystroke per default. You can configure a keystrokeDelay which synchronizes only after the specified delay. So someone who is typing rapidly doesn't create lots of requests, instead the synchronization is triggered only when the user stops typing for the specified amount of time (=keystrokeDelay).

Have fun,
Maik

Probably incorrect references to HtmlLabel

Dear Maik,

thx for the contribution.

I have checked out the wiki page you created and there are some references to some "HtmlLabel" in the text (in some titles, for example).

These are probably copy-paste errors; you might want to fix them.

Cheers,
Robert

mjablonski's picture

Hi Robert, thanks for

Hi Robert,

thanks for reporting, I've found two references to "HtmlLabel" and fixed them.

Cheers, Maik

Client side prevalidation ?

Hi,

This component looks very useful - thanks for contributing it.

I wanted to be able to prevalidate (text fields in particular) on the client
side (presumably in JavaScript), before bothering the server with any
unnecessary updates. Could what you have posted be modified, to do
the following:

1. Validate the characters are digits on the client side, and pass them initially on the server side
at Java Echo3 object construction time (or as a post construction setRange(lower, upper) type function) ?
Something like an "RangeLimitedIntegerTextField" type class ?

2. Provide a more generalized TextField, which is validated against a regular expression on the client
side ?

A tooltip would probably suffice for providing sufficient guidance for the user, although a popup
or status bar update would be nice to explain validation violations as they are typed on the
client side ?

Any assistance, pointers, or tips would be much appreciated.

I am not very familiar with JavaScript, but have many years of Java / Swing experience.

Thanks
Andrew