Jump to content

Recommended Posts

Posted

I am attempting to validate a TUniEdit that is populated with a local store item. In order to do the validation, I need to get the Text property of the TUniEdit control.

However, when I attempt to get the Text value, It is not the current value after the read but the value before the read.

In the example video, I want to get the value of "111" but I get the blank value (value before I save to local storage) or "222" (the current value before I click the Get button).

How do I get the correct value after the local store is read?

Note: I have attached a testcase.

--
Frederick
(UniGUI Complete - Professional Edition 1.95.0.1577)
 

localstore.rar

Posted
3 hours ago, Frederick said:

I am attempting to validate a TUniEdit that is populated with a local store item. In order to do the validation, I need to get the Text property of the TUniEdit control.

However, when I attempt to get the Text value, It is not the current value after the read but the value before the read.

In the example video, I want to get the value of "111" but I get the blank value (value before I save to local storage) or "222" (the current value before I click the Get button).

How do I get the correct value after the local store is read?

Note: I have attached a testcase.

--
Frederick
(UniGUI Complete - Professional Edition 1.95.0.1577)
 

localstore.rar 54.87 kB · 1 download

Hello,

You have to Set Key, before.

I modified your code, see in attachment...

Regards

localstore_2.7z

Posted

Hi Abaksoft,

I have already set the code correctly as shown below:-

      with edtText.JSInterface do
         JSCall('setValue', [jsstatement('localStorage.getItem("TEST")')]);      // important : Key must be Quoted " "
      // lblValue.Caption:=edtText.Text;   // Redundant
      lblValidate.Caption:=edtText.Text;  // Nothing shows from this line

edtText shows the correct value but lblValidate's caption shows nothing.
 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...