[CustomMasks] Need mobile version for Outsystems 10

[CustomMasks] Need mobile version for Outsystems 10

  
Forge Component
(17)
Published on 23 Sep by Pedro Oliveira
17 votes
Published on 23 Sep by Pedro Oliveira

Can this great plugin be ported to Mobile Apps for Outsystems 10?

Thanks.

Hi Harin, 

I agree with you, we need an enhancement to default validations. The web runtime's custom masks relies on jQuery, and messing with the DOM using jQuery breaks React's bindings.

However, we can leverage the simplicity of including JavaScript in the client side logic using the platform's mobile runtime, so, while a proper replacement for that component doesn't exist, you can try js reflex. Check this example:

  1. Replacement regex to be used onChange of an input
    1. var replaceRX = new RegExp(/[^0-9\-]/g);
    2. "140s0-004".replace(replaceRX, "")
  2. To calculate the IsValid widget's field
    1. var validate = new RegExp(/[0-9]{4}-[0-9]{3}/);
    2. validateRX.test("1344-244");

This particular example works for Portuguese postal codes.

Kind Regards,

João Grazina