CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

DXE2/IW14.0.52/CG2.8.0.181 - Telephone Number mask

by ScottWGast » 21 Apr 2016 18:13

I've updated to CG2.9.0.251 and am now attempting to utilize the .MaskExOptions, but I can't seem to get it working.

Here is a screen shot at run time:

TIWCGJQEdit - phone number mask.png


and my code to setup the mask:
Code: Select all
  Self.editNumber.MaskExOptions.Mask := '((\d{3}))-(\d{3})-(\d{4})((\d*))?';
  Self.editNumber.MaskExOptions.AutoUnmask := True;                                  // Assuming that this option will strip the mask from the raw data
  Self.editNumber.MaskExOptions.Enable := True;


Thank you again for any help you can provide.

Scott Gast
You do not have the required permissions to view the files attached to this post.
ScottWGast
 
Posts: 875
Joined: 23 May 2012 11:02

by Alexander Bulei » 26 Apr 2016 09:52

Hi,

It's a edit form from grid or your custom?

Best Regards.
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3637
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal

by ScottWGast » 26 Apr 2016 12:53

It's a custom frame sitting on a dialog. I've attached the frame to this message.

Scott
You do not have the required permissions to view the files attached to this post.
ScottWGast
 
Posts: 875
Joined: 23 May 2012 11:02

by Alexander Bulei » 26 Apr 2016 14:26

Hi Scott,

it's not enough.
Due the complexity of your application, i suggest you request premium support and make remote session, or create the simple testcase with same workflow as you have in your main app.

Usually, developers/customers finds the problem in creating the simple testcase for us.

Best Regards.
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3637
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal

by ScottWGast » 26 Apr 2016 15:18

I'll have a test case built sometime today.

Thanks!
Scott
ScottWGast
 
Posts: 875
Joined: 23 May 2012 11:02

by ScottWGast » 28 Apr 2016 14:12

I built the test case and posted it to my other thread concerning the .TabOrder; including both the .TabOrder and .MaskExOptions issues.

viewtopic.php?f=118&t=2831

Thank you!
Scott
ScottWGast
 
Posts: 875
Joined: 23 May 2012 11:02

by Alexander Bulei » 28 Apr 2016 17:40

Hi Scott,

Well, I think there some issues with regex inside the jquery plugin...:(

But, you have several things wrong in code:

  1. Use our method to create the frames with CGCallBackDisableAjaxResponse & CGCallBackEnableAjaxResponse functions.
  2. You are calling the Self.editNumber.MaskOptions.Active := False; , which is useless because you are using maskExOptions, and provoke the js error because the plugin is not loaded with property Enable.
  3. try to use the internal mask definitions, e.g: (999) 999-9999 aaa [9{1,10}]

About the focus, I'm still investigating...

Best Regards.
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3637
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal

by ScottWGast » 28 Apr 2016 19:59

Thank you for your continued assistance.

I've incorporated the CGCallBackDisableAjaxResponse / CGCallBackEnableAjaxResponse functions, thank you.

I had been going back and forth between MaskOptions and MaskExOptions, but in the end, I disabled the MaskExOptions and enabled the MaskOptions. I have removed the code that was setting the various MaskOptions and set those options within the IDE, as follows:

MaskOptions.png


According to the Delphi mask documentation,

http://docwiki.embarcadero.com/Libraries/XE2/en/System.MaskUtils.TEditMask

the first part of the MaskOptions.Mask value '(999) 999-9999 aaaaaaaaaa;0;_' SHOULD allow the entry of 10 digits for the phone number and up to 10 alpha/numeric characters following. The second (separated by semi-colon) value of zero (0) SHOULD tell the system to unmask the data before saving to the database. The third value SHOULD be the character that represents blanks.

In actual practice, the JQEdit.MaskOptions.Mask does not seem to accommodate the 2nd and 3rd parts of the mask. Additionally, the 'a' portion of the mask only allows alpha characters and not numeric characters, I need alpha/numeric.

I tried using the mask you suggested... but it does not work: (999) 999-9999 aaa [9{1,10}]. If, in fact, the CGJQEdit mask options are not compatible with the standard Delphi masks, how do I achieve the result I'm looking for using the JQEdit.MaskOptions (or the .MaskExOptions)? Do you have documentation on the valid mask characters and the actual mask structure?

Thank you for looking into the "focus the background form component" issue.

Best regards,
Scott Gast
You do not have the required permissions to view the files attached to this post.
ScottWGast
 
Posts: 875
Joined: 23 May 2012 11:02

by Alexander Bulei » 29 Apr 2016 09:35

Hi ScottWGast,

As I told you before, use the maskExOptions, it's more powerful and extended version.

I tried using the mask you suggested... but it does not work: (999) 999-9999 aaa [9{1,10}]. If, in fact, the CGJQEdit mask options are not compatible with the standard Delphi masks, how do I achieve the result I'm looking for using the JQEdit.MaskOptions (or the .MaskExOptions)? Do you have documentation on the valid mask characters and the actual mask structure?


The mask that I suggested, works nice with MaskExOptions.

Best Regards.
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3637
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal

by ScottWGast » 29 Apr 2016 16:58

Ah, MaskExOptions.

Thank you, thank you.

Scott
ScottWGast
 
Posts: 875
Joined: 23 May 2012 11:02

PreviousNext

Return to JQEdit

Who is online

Users browsing this forum: No registered users and 5 guests

Contact Us.