It is currently 21 April 2025, 18:38 Advanced search

Mask settings

Questions and answers on how to best use Instant Developer

Mask settings

Postby Gaby_h » 22 August 2013, 21:40

In field properties -> Visual style Exception -> Mask I set one field with Q#####T, and another with AAA-AAA-## (both fields are char). My problem is that Inde does not store the Q and T and dashes. Is there a way to get Inded to store everything?
Gaby_h
 
Posts: 888
Joined: 17 July 2013, 18:22
Location: Vancouver, Canada

Re: Mask settings

Postby v.marino » 23 August 2013, 15:22

I wasn't able to reproduce the same behavior on my projects. Could you please try to explain further what's happening or attach a simple project where I can see the problem?
User avatar
v.marino
Pro Gamma
Pro Gamma
 
Posts: 652
Joined: 2 January 2013, 8:11

Re: Mask settings

Postby Gaby_h » 23 August 2013, 17:12

Please see pic. In this example FileNbr is set with mask in field properties like this QM######TV because a file number always start with QM followed by 6 digits and ends with TV. Inde does not store QM and TV, only stores the variable part (######).
Attachments
Mask2.PNG
Mask2.PNG (84.71 KiB) Viewed 14113 times
Gaby_h
 
Posts: 888
Joined: 17 July 2013, 18:22
Location: Vancouver, Canada

Re: Mask settings

Postby g.cassanelli » 24 August 2013, 7:16

Well, the characters that are displayed do not exist in the information treated, accordingly as they could not be stored in the db.
Seems normal to me.
To do what you want you have to add them yourself.
Informatica ! Meglio lavorare con il granito, è duro, ma è stabile ! - Computer Science ! Better to work with granite, it's hard, but it's stable !

Giuseppe Cassanelli http://www.lab-ud.com
User avatar
g.cassanelli
 
Posts: 2653
Joined: 9 November 2010, 19:00
Location: BOLOGNA

Re: Mask settings

Postby Gaby_h » 24 August 2013, 17:01

This is not good. The system I am currently using there is the option to store or not store the mask characters.
Is there a way to build your own data entry rules in Inde?
Gaby_h
 
Posts: 888
Joined: 17 July 2013, 18:22
Location: Vancouver, Canada

Re: Mask settings

Postby a.maioli » 25 August 2013, 2:30

Yes, you can add the OnUpdatingRow event to the panel. Inside that event, you can modify the value entered by the user adding the mask characters so they will be saved to the database.
For more information about the OnUpdatingRow event you can read the 4.9.2 paragraph of the user guide on page 161.
User avatar
a.maioli
Pro Gamma
Pro Gamma
 
Posts: 1090
Joined: 29 September 2010, 12:47

Re: Mask settings

Postby Gaby_h » 25 August 2013, 4:57

I had already tried onUpdatingRow. Unless I am not understanding how this event works, my finding is that it triggers only when the user changes row. It does not trigger when the user tabs out of the field and moves to the next one. To me adding the mask characters only when the data is sent to the server is not the best solution for the user.

In my current applications, when I apply a mask to a field like for expl: FX#####V (FV 5digits V).
1) When the user tabs into the field the length is enforced, i.e. the user cannot enter more that 5 digits, even if the actual size of the field in the backend is 20. With Inde when I apply the mask to a 15char field and I enter 77895 the result I get is FX77895VVVVVVVV absolutely not desirable at least from a visual point of view. I have to use a function like maxLength() in another event to limit the size to 8.
2) I have the choice to store or not store the mask characters (FX and V)
Also the above can be done dynamically as follows :
Suppose I have vendorid field and filenbr field (30 char) where I want to apply a mask:

if vendorid =v33 apply mask Q######T in filenbr
=v22 K#########
=v17 ###-####-####-####
=v19 AAAAA
etc...
As soon as the user enters the vendori ID, the fielnbr field is automatically formatted with specified mask without extra characters, the data is saved exactly as shown on the screen, all the above with very little coding and no use of events.
Can something similar be done in Inde and how?
Gaby_h
 
Posts: 888
Joined: 17 July 2013, 18:22
Location: Vancouver, Canada

Re: Mask settings

Postby a.maioli » 25 August 2013, 11:08

Hi Gaby_h, thanks for your post. I created a small example that works as in your application.
The only exception is that Instant Developer extends the mask to the maximum length of the field even if the last character is not a placeholder. Hence you have to use a blank as last mask character and limit the length of the field to the maximum length of mask allowed.
In the upcoming release we will correct this problem so the mask won't be extended in cases like yours.
Attachments
TestMask.zip
(389.61 KiB) Downloaded 517 times
User avatar
a.maioli
Pro Gamma
Pro Gamma
 
Posts: 1090
Joined: 29 September 2010, 12:47

Re: Mask settings

Postby Gaby_h » 25 August 2013, 17:28

A.Maioli:
Thank you very much for your example, very helpful. It seems to be working now. The trick was to use the text property to store the mask characters; if I run into further issues I'll post back.
I think this post will be helpful for the next traveler coming from the other side. Thanks again.
Gaby_h
 
Posts: 888
Joined: 17 July 2013, 18:22
Location: Vancouver, Canada

Re: Mask settings

Postby a.maioli » 26 August 2013, 8:38

I''m glad it was helpful. I'll lt you know how and when we fix the mask problem completely.
User avatar
a.maioli
Pro Gamma
Pro Gamma
 
Posts: 1090
Joined: 29 September 2010, 12:47


Return to Tips & Tricks

Who is online

Users browsing this forum: No registered users and 26 guests

cron