Frederick Posted February 17 Posted February 17 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.mp4 localstore.rar Quote
Abaksoft Posted February 17 Posted February 17 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.mp4 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 Quote
Frederick Posted February 17 Author Posted February 17 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. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.