textbox content truncated after saved to the database

Hi Guys,

I am using XOJO 2018 rel 1 on Windows 10 64bit. I experienced that the content typed by user from the textbox is truncated upon saving to the cubesql database?

example:
User typed to textfield:
FIRSTNAME: Jolly
LASTNAME: Beethoven

In Cube, it saved:
FIRSTNAME: Jol
LASTNAME: Beet

I had frequent problem like this specially if the user is using his phone to access my web application (maybe slow internet connection).

I hope somebody can share your solution. Thank you.

Does the truncation always happen, and do the fields always truncate to the same lengths? If so the first place to look would be the database field lengths. But you imply the problem is intermittent, so I don’t think that is the issue.

The problem arise intermittently.

Sometime ok, sometimes truncated.

I have never run into this problem with any of my apps, but I have also never used cubesql either. I would look for patterns in when/what/how things get truncated, and try to reliably reproduce the problem:

-When input is truncated, do all inputs get truncated or just some?
-Are they always truncated to the same length every time it happens?

I’ve been using CubeSQL, and have also never run into this.

If I had such a problem, I would put in some diagnostic code: After saving to the database, read the data back out and compare to what you were trying to save. Might get some clues as to what’s going on.

Does seem strange.

Hi Cliff,

The saved data on the field sometime 3 characters and sometime 5 characters.

I tried to simulate this just using a text box and a msgbox triggered by a button. The message box shows complete information typed on the textbox.

Looks like there something wrong when saving it on cubesql.

[quote=392736:@Bob Gordon]I’ve been using CubeSQL, and have also never run into this.
Does seem strange.[/quote]

i have been using CubeSQL for many years and never have this problem.

Same here. If this was happening to me, I would move the SQLite file out of cubeSQLServer and then see if it still happens.

my application change from single to multiple user by moving the data file from the folder the app is running on to the databases folder for cubesql. also i remove the xxlogin.rsd from same app folder.

in the code, the difference between single user and multiuser is the way it is connect.

Thank you for the insight.

Looks like event from something wrong when subclassing the webtextfield and accessing the event change.
I’m still evaluating the scenario.

I have the some problem - but using Sqlite. This problem only happens when user is imputing text on Android mobile phone. All other platforms work perfectly. Very weird?
So I created test, made webtext field. Set AutoComplete & AutoCorrect OFF.
Type in “abcdefg” then I have a button which raises MsgBox(myTextfield.text) - and guess what? MsgBox displays only “ab” - but if I press the button a second time, msgBox display the full text correctly.

[quote=490662:@Tony Davies][/quote]
behave it the same if you put this text field in a variable first?
which events are used from webtext field?
xojo web api 2 coming soon :slight_smile:

I ceased developing xojo + sqlite. I use xojo + mysql instead.

I don’t think this problem has any relevance to database. I can reproduce the issue with just WebTextField and MsgBox.
The behaviour is the same if I assign the textfield value to a variable. The issue is related solely to the native Samsung Android browser. (iPhone works perfectly, Windows Chrome / Firefox / Edge all work perfectly)

If I change focus to any other control, then press my button, the MsgBox will display the correct contents. I am not using any events on the webtextfield.

[quote=490675:@Tony Davies]I don’t think this problem has any relevance to database. I can reproduce the issue with just WebTextField and MsgBox.
The behaviour is the same if I assign the textfield value to a variable. The issue is related solely to the native Samsung Android browser. (iPhone works perfectly, Windows Chrome / Firefox / Edge all work perfectly)

If I change focus to any other control, then press my button, the MsgBox will display the correct contents. I am not using any events on the webtextfield.[/quote]
as tony said
as workaround maybe you can give other control focus by code with method SetFocus?

I have done a lot of remedies, but none of them succeed.
I think it is related to the SQLite driver used by xojo. I don’t know. But it fixed after I shifted to MySQL.

What is your schema?

Maybe my issue is not the same as Ronaldo’s …
In my case database is irrelevant - I can re-create this issue without any database.
For some reason Android / mobile Chrome does not complete the text field until the focus is lost, then re-focused.

Workaround is easy, I added code to textfield.lostfocus event to set a variable flag. Then my Save button.Action is setting 400ms timer to check flag is ready, before reading the text field contents. This seems to work fine across every OS / Device / Platform.