[CustomMasks] Updating InputMask version

[CustomMasks] Updating InputMask version

  
Forge Component
(17)
Published on 14 Sep (11 days ago) by Jogait
17 votes
Published on 14 Sep (11 days ago) by Jogait
Hi there,
 
I have been working on a project which is using CustomMasks.
However, I there are some problematic behavior (Scenario #2) and trying to solve it by replacing InputMask with newer version.
 
<Phenomenon>
Can be reproduced in the following Web page
https://labsdev.outsystems.net/CustomMasks/Examples.aspx
 
(Scenario #1)
1. Enter "121.111.111.111" to IP text box
   * A user only types numbers, and period(.) is automatically inserted.
 
2. Delete "2" using back space key, and try to type another number.
    -> The application works as expected.
 
(Scenario #2)
1. Enter "121.111.111.111" to IP text box
   * A user only types numbers, and period(.) is automatically inserted.
 
2. Copy the entered values and paste it.
 
3. Delete "2" using back space key, and try to type another number.
   -> Cannot enter any value
 
Problem happens when a value which includes "delimiter" like Scenario#2.
 
I have tested with InputMask itself but this phenomenon did not happen.
Demo site for InputMask (IP address)
http://robinherbots.github.io/jquery.inputmask/
 
Thus, decided to replace InputMask with newr version, but we encountered the following issue and would like to ask you for help.
 
Issue: There are some differences between the scripts in InputMask used by MaskPlugin(WebBlock)(refer to "3.1.27_osp.txt" file) and the one available at github (refer to "3.1.27_github.txt" file) 
 
If we replace InputMask with the newer version, the differences will be gone, and we would like to know if it will not cause any problems on the behavior of CustomMasks. And if there will be a problem, I woulkd like to know how to fix it.
 
The attached file (CustomMasks2.oml)) is the one having the issue described above.

Thanks,

Emi Yokota

Hello Emi,

I'm happy that you are using the CustomMasks component :)
About the problem that you described... That behaviour is new to me and really strange. But you're right, by replacing with a newer version the problem disappears. The bug must be related with the plugin, so the replacement by the new version seems a good solution to me.

I did some quick tests, and from the examples in that module there are two masks with problems:
1. The URL doesn't work properly since the new version seems to not support the mask definition 'url'. This is not really an issue since doing an URL mask using a regex is simple to do.

2. The maskDate block doesn't work, properly because the API has changed. If you open the console in browser (while testing the examples) you will see a javascript error. The function maskDate has the $.inputMask undefined.

In the meanwhile if you are not using the maskDate you can use the newer version, at least that will fix your problem.
I will do my best to try to upload a component with a newer version and together with other fixes that have being requested.

Thank you Emi and let me know if you have any other trouble using CustomMasks.

Sara Gonçalves
Hi Sara-san,

Thank you for your reply.

I am looking forward to see the new version of CustomMasks, and hace some quetions regarding the new version you are working on.

#1. Since I need to make modifications to our projects' schedule, I would like to ask you when the new version of CustomMasks will be uploaded (rough estimate will be fine)?

#2. Since a lot of WebScreens are using this module, I would like to know ahead if there will be some changes on the usage (e.g. the number of input parameter will change). In other words, when the new version is released, do we just need to publish the version and refresh eSpace references which are using CustomMasks or need to make some changes where the module is used?

Thanks,

Emi 
Hello Emi,

#1. By the end of the week I expect to upload a new version, but in the worst case (in case of some surprise cames up) next monday will be a more secure estimation.

#2. I will do my best to avoid changing the number of input parameters, and at first side I don't think that will be needed. What means that you will just need to refresh the eSpace references :)

Thank you!

Sara Gonçalves
Hi Sara-san,

Thank you for your reply.

I am going to share the schedule with our project members.
If anything wrong happens and need to postpone your schedule, please let me know.

Thanks,

Emi
Solution
Hello Emi,

Good news, the new version was already uploaded, and a refresh references will be enough to update the component in your project.
Please let me know if all went fine or if you continue to have any other troubles.

Thank you!
Solution
Hi Sara-san,

Thank you for your update.

I am going to test with our applications and will let you know if anyring went wrong.

Thanks,


Emi
Hi Sara-san,

We have tested the new CustomMasks with our applications and confirmed that it is working fine without any problem.
We really appreciate your help.

Thank you,

Emi
Hello Emi,

I'm glad to know that the new version solved your issue.
Feel free to give feedback about the component anytime.

Thank you!

Sara Gonçalves

Can you update to the latest version (3.3.2-109)  and make it available for all stacks again?

Thanks.

Tiago Flor wrote:

Can you update to the latest version (3.3.2-109)  and make it available for all stacks again?

Thanks.

Hi Tiago,

I didn't validate the behavior in Java but since there is nothing specific to some stack I already made it available for all stacks :)

Cheers

Latest version (3.0.0) broke functionality, the inputs with masks have underline and calendar inputs show calendar when page loads.

For my previews post to remove the underline all it is needed to is to add "greedy: false" in the AdvancedOptions.


Could you upgrade to the latest version of the jquery (3.3.4 as of today) and also release a P10 version?

Hi there,

I am working on a project using CustomMasks Version 2.0.4 with PlatformServer 9.1.401.0, and noticed a the following phenomenon.

When MaskText Web Block is placed on a WebScreen with "KeepMask" input parameter set as False, the highlighted code in the image is executed.
The more times an area containing the Web Block is Ajax Refreshed, WebScreen gets slower (= takes more time for the Ajax Refresh Action to be completed) due to BindBeforeSubmit and BindAfterSubmit functions. This gets worse when many MaskText Web Blocks are used in a Edit page, and input validation finds out invalid input.
Thus I would like to request to fix the module so that BindBeforeSubmit and BindAfterSubmit functions are executed only once when the Web Screen is loaded. This phenomenon happens also with MaskCurrency but not sure about the other mask Web Blocks, so I really appreciate to check the other modules when fixing it.


Thanks,

Emi

Hello Emi,

Thank you for reporting this behavior. At the moment I'm not able to upload a new version compatible with PlatformServer 9.1.401.0, but in my environment, I was able to make a quick fix.

All the webblocks should make a validation if the binds were already made previously, in order to have the expected behavior that you mentioned.

if(!window.customMasksInitialized) {
    osAjaxBackend.BindBeforeSubmit(function () {
        $(elementID).inputmask('remove');
    });
    osAjaxBackend.BindAfterSubmit(function () {
        $(elementID).inputmask('remove');
        $(elementID).inputmask(maskDefinition, maskOpts);
    });
    window.customMasksInitialized = true;
}

Can you try this and check if it solves your issue?

Let me know if you need any help :)


Thank you,

Sara Gonçalves

Hi Sara-san,


Thank you for your reply.

I am going to talk to project members, and I am going to let you know if we have another question.


Thanks,


Emi

Hi Sara-san,


I have attached an OML files which works with PlatformServer 9.1.401.0 and with changes applied you have mentioned before. The OML file is based on the version 2.0.4, and the change is only applied to "MaskText" Web Block.

I am wondering if you could upload this OML file as new version so that everyone else can use it.


Thanks,


Emi

Hi Sara-san,


I have attached OAP file which includes the fix.


Thanks,


Emi

Emi Yokota wrote:

Hi Sara-san,


I have attached OAP file which includes the fix.


Thanks,


Emi


Hello Emi, 


I already uploaded the version with your fix.


Thank you for your contribution!


Sara Gonçalves

Hi Sara-san,

We have noticed that inputmask version is revered from 3.3.2-27 to 3.1.27 at version 2.0.3, and it is causing the phenomenon which I talked to you last year around June-July. Was there any problem using inputmask version 3.3.2-27?

In addition we found another strange behavior with inputmask version 3.3.2-27 as the followings.

 E.g. When you input a large number and move the cursor, the input value changes.

        If you input 922337203685 and move the cursor, it changes to 922337203686.

We have updated the inputmask version to 3.3.8, and it seems that all the problematic behaviors which I have described above seems to be solved. I have attached the fixed version, and would you mind uploading it as the new version?


Thanks,


Emi

Emi Yokota wrote:

Hi Sara-san,

We have noticed that inputmask version is revered from 3.3.2-27 to 3.1.27 at version 2.0.3, and it is causing the phenomenon which I talked to you last year around June-July. Was there any problem using inputmask version 3.3.2-27?

In addition we found another strange behavior with inputmask version 3.3.2-27 as the followings.

 E.g. When you input a large number and move the cursor, the input value changes.

        If you input 922337203685 and move the cursor, it changes to 922337203686.

We have updated the inputmask version to 3.3.8, and it seems that all the problematic behaviors which I have described above seems to be solved. I have attached the fixed version, and would you mind uploading it as the new version?


Thanks,


Emi

Hello Emi, 

Thank you for contributing to a new improved version! I just uploaded as 2.0.6 version.

Cheers,