Text password = new Text( compInput, SWT.BORDER | SWT.PASSWORD);
i saved the value of these textfield in an ClientStore for the next start.
ClientStore store = RWT.getClient().getService(ClientStore.class);
String passwordValue = store.get("Password");
passwort.setText(passwordValue);
My problem is that the method setText() from Text class is being called two times. And after these two calls the length from textfield getting greater.
For example:
Value for textfield after first call of setText(): "password"
Value for textfield after second call of setText(): "password "
I debuged this problem and find the following:
in class ClientMessage (Version RAP 2.0 R) i became at line 217 the following JSONObject during the second call of the setText() method:
Hi Jens,
the character \u200b is 'zero width space' character. What Tabris
platform are you using - Android or iOS?
Best,
Ivan
On 3/7/2013 4:19 AM, Jens Lauble wrote:
> i have the following simple Textfield
>
> Text password = new Text( compInput, SWT.BORDER | SWT.PASSWORD);
>
> i saved the value of these textfield in an ClientStore for the next
> start.
>
>
> ClientStore store = RWT.getClient().getService(ClientStore.class);
> String passwordValue = store.get("Password");
>
> passwort.setText(passwordValue);
>
> My problem is that the method setText() from Text class is being
> called two times. And after these two calls the length from textfield
> getting greater.
> For example:
>
> Value for textfield after first call of setText(): "password"
>
> Value for textfield after second call of setText(): "password "
>
> I debuged this problem and find the following:
>
> in class ClientMessage (Version RAP 2.0 R) i became at line 217 the
> following JSONObject during the second call of the setText() method:
>
> {"text":"password\u200b","selectionStart":0,"selectionLength":0}
>
> My question is why is the character with the Unicode \u200b in the
> text parameter and why is the method setText two times call ?
>
>
Regarding the empty space character in the text field: That is a known tabris android bug and will be fixed in the next release.
For your setText being called twice... The code you pasted should not get called twice so it has probably something to do with your code setup. More insights would be needed.
Btw... for direct feedback on tabris related questions you should use the tabris issue tracker on github.com/eclipsesource/tabris