Luke Szemis
Posts: 0
Joined: Mon Jun 17, 2013 8:29 am

Popup and set property priority / blocking

hello,

I am having a problem in getting localStorage variable to be applied correctly to text field. Trick is a mesh of service invocation and invoke priorities

here is the scenario.
actions:

  1. Taphold on Button1 on page1 - open popup_page

  2. popup_page has load event which startup service1 . Service1 populates clickable labels using REST api on popup_page

  3. on popup_page user taps clickable label and stores text value in localstorage, closes popup

  4. Button1 on page1 is updated with localstorage valuable stored in point 3.

    Problem is that action 4 is being invoked first before action 1.
    Although the Taphold button in priority shows that popup should open first I can see that action 4 is being run before popup opens. .

    My question is how can I block events allowing for popup_page actions complete first and then resume with actions in 4 ?

    Is it possible to open popup_page in service success event ?

    thanks and regards,
    Luke

Luke Szemis
Posts: 0
Joined: Mon Jun 17, 2013 8:29 am

Popup and set property priority / blocking

Is it possible to open popup_page in service success event ?
I know it is possible, but still won't work for me, since the service needs to update already open popup to populate the labels.

Luke Szemis
Posts: 0
Joined: Mon Jun 17, 2013 8:29 am

Popup and set property priority / blocking

Meanwhile I've circumvented the problem it by adding open page1 and refresh as last action in label click actions. But there has to be better nicer way of doing this ?

thanks!

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Popup and set property priority / blocking

Hello! Working on it.

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Popup and set property priority / blocking

Hi Luke,

To check if there is the value in the storage run the following JavaScript code:
codeif (localStorage.getItem("item_name") == undefined) {
// default button text
} else {
// change button text
}/code
Delete the value as soon as you don't need it. Otherwise the button will get an old value when run next time.

Return to “Issues”