Edit Masks

Current version of NJX allows edit masks on numeric fields and with only restricted characters.
We need the possibility to use edit masks on text field and we would like to use more characters in the edit masks.
Is there anyone facing a similar problem? We are investigating the possibility to create custom controls to allow this kind of edit masks.
Can someone tell me if this is a possible solution?

Hi Jan,

it should be possible to write a control that supports edit mask handling.

But you must be aware of the following

  1. Your custom control has a different tag. It is not field but for instance xx:mytag
    2)If you build new applications you can surely use the new tag. For existing applications the new “edit mask functionality” is not automatically added. You must replace for instance already existing field tags with xx:mytag
  2. You probably want your new custom control to support also some of the nice functionality, a field control supports: having statusprops, focushandling, datatype handling,…Actually you probably would like to extend (=inheritence) the field control. This would mean not writing simply an own Java class implementing ITagHandler, but to extend the FIELDHandler with all pros and cons.

Best Regards,
Christine

Hi Christine,
Thanks for the information, could you tell me if we can have a look at the FIELDHandler.
If we can inherit the properties of the FIELD control it would surely be great.
Is an expansion of the edit masks something we can expect in future releases?
Jan

Hi Jan,

You’ve got the point:

It is possible to build some text control with edit mask feature but this control will not have all the nice functionality of the FIELD control.

It is also possible to write Macro controls. This way you can actually extend existing controls like the FIELD control. The Macro controls are the official way to build “extensions”. You can for instance add visual elements or properties to controls (see the Application Designer documentation).

But even if you directly extended the FIELDHandler you cannot achieve the following: Replace exactly the line which handles the “KEY DOWN” or “FOCUS” events with your own Java Script functionality.
Copying the code from the FIELDHandler, adapt it and integrate it into another MYFIELDHandler is not possible. This is internal implementation and frequently changes. It would brake the framework and your application.

Best Regards,
Christine

Christine,
Could you provide an example of how to inherit of the the FIELD control?
Most tools for applying edit masks need to handle keydown, focus events. We thought maybe we could extend the events.
Jan

Hi Jan,

sorry if my last answer was not clear:
It is not possible to extend the FIELD Control in this way. The Macro Control concept and the public interfaces do not support this.

You can only write an own text control providing Edit Masks, but you cannot extend the FIELD Control and somehow overwrite the KEYDOWN or FOCUS handling.

This kind of control extension is not covered in the current interfaces of the custom controls support of Application Designer

Best Regards,
Christine

Sorry Christine,
NO, your answer was clear, I perfectly understood that we cannot extend the existing FIELD control. We want to create a MYFIELD control that inherits of the FIELD control. But allows us to customise the keypress events.
We also did some test, adding the (EM=…) in the adapter (we know this is not allowed ;-)) this seems to work, so we don’t really understand why the application designer doesn’t allow to specify the edit mask on strings as it does for numeric fields.
Best regards,
Jan

Hi Jan,

numeric EMs are a subset of the EMs Natural provides. The subset, NJX currently provides, had the highest priority.

We probably don’t want to reimplement Natural in the Ajax layer but to add EM support for other types is a perfectly valid enhancement request.

To my mind this should be handled as enhancement request for the NJX product. A real solutions, which meets the requirements, cannot be achieved by custom controls.

Best Regards,
Christine