I am attempting to use a TIWHTML5LocalStorage control on a form containing iPhone Controls. I followed the code in the LocalStorage Demo, but I do not seem to be able to save any actual values.
Are there any issues with this combination? Is this something that only works at deployment?
D2010 w/IW12
I have confirmed that the Local Storage component fails under iOS and Android. It always has an empty Items list in the ansync events.
Hi,
Can you please make sure private browsing is turned off in Safari settings on iOS?
Private browsing is turned off. I can accomplish what I need using cookies, but I would rather use Local Storage. My test is very simple. I am simulating a login page. I have 3 edits and a couple of buttons.
When the login button is clicked I store the three edit values. IN the FormCreate event I call GetAllItems to populate the edits on the next visit.
When I run the test as a normal IW form everything works. When I drop an iPhoneStyle onto the form and place the edits inside an iPhone region the items are no longer loaded.
Can you send/show me the code you tested? Am I doing something wrong in the code below?
procedure TIWForm1.IWAppFormCreate(Sender: TObject);
begin
TIWHTML5LocalStorage1.GetAllItems;
end;
procedure TIWForm1.ntnLoginAsyncClick(Sender: TObject; EventParams: TStringList);
begin
TIWHTML5LocalStorage1.SetItem('phone', IWEdit1.Text);
TIWHTML5LocalStorage1.SetItem('password', IWEdit3.Text);
TIWHTML5LocalStorage1.SetItem('email', IWEdit2.Text);
TIWHTML5LocalStorage1.GetAllItems;
end;
procedure TIWForm1.TIWHTML5LocalStorage1AsyncGetAllItems(Sender: TObject; EventParams, Items: TStringList);
var I: integer;
begin
for I := 0 to Items.Count - 1 do
begin
if Items.Names = 'phone' then
IWEdit1.Text := Items.ValueFromIndex;
if Items.Names = 'email' then
IWEdit2.Text := Items.ValueFromIndex;
if Items.Names = 'password' then
IWEdit3.Text := Items.ValueFromIndex;
end;
end;
Hi,
I've retested now by adding an IWiPhoneStyle and IWiPhoneRegion to the demo. Then I moved all controls except the IWiPhoneStyle into the IWiPhoneRegion.
Can you please provide a ready to run sample project that demonstrates the issue so I can further investigate this?
I am using D2010 w/IW 12.2.20.
Here is a link to my test project.
https://dl.dropboxusercontent.com/u/44457478/Project6IWLocalStorage.zip
It is in a generic IW application state. To reproduce the condition:
1. drop a iPhoneStyle component.
2. Cut the controls.
3. Drop an iPhoneRegion
4. Paste the controls onto the iPhone region
5. Run.
Your sample project (with or without IWiPhoneStyle and IWiPhoneRegion controls) is working as expected when tested here.