Bug 1377

Clearing string column with EditMask will not result in NULL or empty string in database 13 April, 2021

Constantin Bergatt
28 June, 2018
Product: PowerBuilder Category: DataWindow
Version: 2017 R2 Build:
Classification: Enhancement Publishing: Public
Priority: P3
Status: Closed Reason: RECORDED AS ENHANCEMENT
Constantin Bergatt 04 January, 2021
#10
Hi Amy,

many thanks for the heads up!

Please let me know, if any progress is made.

Best regards,
Constantin Bergatt
Appeon Product 29 December, 2020
#9
Hi Constantin, 

 

Thank you for touching base with us.  

Sorry I cannot provide a rough timeline right away because even if a feature is added to the product development plan, it is possible that the feature gets delayed or pulled midway through or at the last minute. Our team does not want to give false-hope unless we are 100% sure. 

  

Best regards, 

Amy
Constantin Bergatt 09 December, 2020
#8
Hi Amy,

many thanks!

Please keep me updated on any progress of the implementation of the enhancement.

Can you give me a Rough estimate, in which version you think it will be available?

Regards,
Constantin Bergatt
Appeon Product 09 December, 2020
#7
Hi Constantin,  

 

Thank you for submitting the ticket.  

We now acknowledge this ticket to be an enhancement request and will record and track it internally in our enhancement management system. At the same time, we are closing the ticket here because this support system is for handling standard support services but not for maintaining enhancement requests.  

Please note that despite its "Closed" status, you are welcome to come back here and leave further comments or query the relevant development progress on this ticket.  

 

Regards,  

Amy Feng
Mark Lee @Appeon 23 May, 2019
#6
Hi Constantin,

Thank you for the detailed information.
It might be designed so since early PBs.
We'll record it as a new requirement/enhancement request and transfer it to our product team for further consideration. 
Appreciate your understanding.

Regards,
Mark Lee
Constantin Bergatt 22 May, 2019
#5
Hi Ken,

many thanks for the follow-up!

I was just wondering why the difference in behavior between clearing a int / decimal or a string data type with an edit mask?
I mean clearing a int / decimal data type will lead to a zero or NULL (not sure which one will it be currently) value within the database. But if I delete the string data type with an edit mask, it will lead to a non-empty string within the database?
I think it might be a little confusing for the user. When he's clearing a string field, afterwards he's seeing an empty field within the datawindow. After saving the changes to the database and retrieving the datawindow anew he sees the non-empty string (or the cursor at a weird position; at least not at the "start" of the field where he would expect it), although he knows he definitely cleared it before.
Plus a programmer (as we did) may assume when cleared the string field should be empty (as this is also what the GUI shows or implies) and therefore will code his "empty" checks for NULL values or empty strings and will not consider trimming as it may cost performance.

In addition you may be right, that coding a respective check within the update start event may be a possible workaround, but this will in our case require a lot of manual coding as we are using edit masks a lot within our application. And finding all concerned datawindows and columns plus adding the handling will take ages. Another possible solution for us would be to code a general handling of such cases within our datawindow base class itself, which also will take a lot of efforts to code.

So, from my point of view, harmonizing the behavior between int / decimal and string data types on runtime level would be the better option as it would not force all applications out there to code one way or the other their own problem handling.

Best regards,
Constantin Bergatt
Mark Lee @Appeon 26 April, 2019
#4
Hi Constantin,

Thanks for your reporting this problem and we apologize for this late reply.
We reproduced it on out end. However the "#" format is designed so in PB.   
1. If you use the int /decimal data type, there will no such problem.
2. Even if you use string column (databse type is "VARCHAR(15)"), you can also add a judgment in the updatestart event of the datawindow: you can get the value of the column "HS code", and then use trim to judge if it is empty; if it is empty, set the column value to NULL or an empty string and this value will be written to the database.
 
So it seems to be a usage issue rather than a bug.
And we recommend posting tech how-to/advice questions to the Appeon Community:  https://community.appeon.com  
Questions posted to the Appeon Community may be responded to by Appeon support staff, MVPs, or other product users.

Regards,
Mark Lee
Constantin Bergatt 25 April, 2019
#3
Hi Govinda,

any updates on the status of our ticket? Were you able to reproduce the problem?

Regards,
Constantin
Govinda Lopez @Appeon 28 June, 2018
#2
Hi Constantin,

I will be working on analyzing/reproducing your case. We will keep you posted of the results here.


Regards,
Constantin Bergatt 28 June, 2018
#1
AT-1267_testapp.zip (14KB)

*Phenomenon:
When deleting the whole content of a string column, which does have an EditMask enabled, instead of a NULL or an empty string a string with the length of the edit mask as spaces is written to the database.

For an example please have a look into the attached test application ("AT-1267_testapp.zip"). In this example the column "HS code" is a string column (databse type is "VARCHAR(15)") with an enabled EditMask of "#### #### ## #". When entering a valid entry (e.g. "11111111111") and removing it completely (marking all characters and deleting them using the Delete button) the remaining value (and the value stored within the database) would be "          " (11 spaces). Which is not NULL or an empty string, which we would have expected.

*Reproduce Steps:
Create a simple application with a window and a simple datawindow containing a single, editable string column. Add an EditMask to the column and try to change the values. When clearing the field, click somewhere to the right side of the colum in order to reselect the column. The cursor should now (depending on where you clicked) be set in the middle or to the right of the string column.

Remark:
In addition, the fact that the column is also "refilled" with spaces even when all characters are deleted is also confusing. For example, when a user wants to clear the column, he will probably mark all content and press the delete button. But when the user now clicks again in the column field, it may happen that the cursor is not set to the "start" of the column but somewhere in between the 11 spaces. This could potentially confuse the user as he expects the column field to be empty wheras now it seems filled somehow.
OS:
Windows 10
Platform:
All
Database Type:
SAP SQL Anywhere
Database Version:
17.0.9.4793