Is it possible to fire event when a certain character is put in the textbox


We are thinking of using WiseJ for an app that gets a text field stuffed by stuffing the keyboard.  This is done by a barcode scanner that simply puts the value into the keyboard buffer which stuffs the textbox.

We would like to fire an event when the textbox has our end of string character (in this case a “@”).

Is that possible?



  • You must to post comments

I think we have created an example that does exactly what you need. Try the example here:

It shows two ways: event and callback. You can pick either one. The control has a new property that accepts a regular expression and fires a “match” event when matched. You may want to tweak the javascript code: now it checks on focus in but you can instead listen to “changeValue” like this in construct():

this.getChildControl(“textfield”).addListener(“changeValue”, this._onChangeValue, this);

or on keypress

this.getChildControl(“textfield”).addListener(“keypress”, this._onKeyPress, this);

or try

this.addListener(“keypress”, this._onKeyPress, this);

since keypress bubbles up.


  • Shawn Ramirez
    I wanted to share that I got this to work without javascript. I just used the textbox’s KeyPress event and check for the character I needed. Thanks, Shawn
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.