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

Welcome to Wisej Support.
Questions, suggestions and plain old bugs - are all welcome here!
0
0

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?

Thanks,

Shawn

  • You must to post comments
0
0

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

http://wisej.com/support/question/how-to-properly-sub-class-an-existing-wisej-control-and-augment-with-javascript

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
Post as a guest by filling out the fields below or if you already have an account.
Name*
E-mail*
Attachment
File Name Size
There are currently no files uploaded.
Maximum number of files 5, maximum file size 3.9MB.
Supported file formats: zip pdf gif jpg bmp png cs vb theme json