Home › Forum › Omnis General Forum › Desktop client – $allowcopy for Masked Entry Field
-
Desktop client – $allowcopy for Masked Entry Field
Posted by Giacomo Manzoli on June 22, 2022 at 9:10 amHi, for the Entry Field of the desktop client there is the property $allowcopy which allows the user to select and copy the content of a field when the field is disabled ($active=kTrue and $enabled=kFalse), but i can’t find the same property for the Masked Entry Field, is there a way to achieve the same result?
Silvan Baach replied 2 years ago 3 Members · 6 Replies -
6 Replies
-
Hi Giacomo,
As far as I can see there is a $allowcopy property for multiline entry fields in Omnis Studio 10.2.
Best,
Andreas
-
Sorry, just saw that you are asking for the masked entry field. I miss-read your question.
Best,
Andreas
-
Maybe you can use a page pane object that switches between a normal entry field which is disabled and allows copy and a masked entry field when you allow to enter the data?
Best,
Andreas
-
Hi Andreas,
well that could be an option but when the field is disabled, and therefore the Entry Field is visible, in order to display a formatted number (with fixed decimal and with Euro symbol) i have to display a character variable formatted with jst(…) instead of the plain number. This, other than the manually formatting downside has another issue: also the format is copied (i.e. the euro symbol) when maybe only the numeric value is useful.
Another solution that came to my mind is to add an handler for the evDoubleClick of the Masked Entry Field which copies the data to the clipboard:
On evDoubleClick
Copy to clipboard $cfield().$contentsbut it’s not really intuitive from an user perspective.
-
Hi Giacomo
I don’t know of any solution to your original question. But I think you are on the right way with the DoubleClick event. I suggest you make a small push button next to the field with a clipboard icon. This should be intuitive enough for most users since it’s a very common way of copying data on most websites.
– Silvan
-
Another idea: If you implement the solution proposed from Andreas you could catch the Ctrl + C command and do some cleanup to the copied value. In the example code I am replacing all spaces and the € symbol. It’s important that you discard the event otherwise the OS will proceed with the standard event will override the value which you copied manually to the clipboard.
Example Code:
On evKey
If pKey=’C’&cmd()
Calculate testStr as $cobj.$contents
Calculate testStr as replaceall(testStr,’€’,”)
Calculate testStr as replaceall(testStr,’ ‘,”)
Copy to clipboard testStr
Quit event handler (Discard event)
End If
– Silvan
-
-
Log in to reply.