Page 1 of 3

STRING MAPPED FROM LOCALSTORAGE

Posted: Sat Mar 24, 2012 11:14 pm
by Michael Klauss

Hi Tiggzi!

I ́m trying calling my service sending a string which is saved in LocalStorage. When i ́m testing the service and put the string direct in the value field... works very well...but when i get the string by LocalStorage and send to my service, my service return my string with plus signal (+++) between the string.

This is the last call of my service, when a get the details about each element. For example:

Cms Cesario de Mello - Ap53 - saved in LocalStorage - ok
Cms+Cesario+de+Mello+-+Ap53 - My service returned it.

When i put : the string (Cms Cesario de Mello - Ap53 ) and called my service..works... because the name it ́s the search field about each element... don ́t exist id. The name is unique.

But when a mapped my service to send the string by LocalStorage...i don ́t know what happen...my service didn ́t return my unique element because can ́t find the name with the plus signal(+) between the string.

Can you help me...I tried insert the javascript with a regular expression...but didn ́t work.

For example... EXAMPLE

myString = "localStorage.getItem('nomeUnidSaude');
myString = myString.replace(/\+/g, " ");
alert(myString);
Tiggr('searchparam').text(myString);

I don ́t know what can i have to do to send my string without the plus (+).

Thanks!


STRING MAPPED FROM LOCALSTORAGE

Posted: Sun Mar 25, 2012 12:29 am
by maxkatz

From the code example you provided at the end, please add the output that you see (invalid) and the output you want to see (valid).


STRING MAPPED FROM LOCALSTORAGE

Posted: Sun Mar 25, 2012 12:56 am
by Michael Klauss

Hi Max,

Sent a email with the print of my screen..step by step..

http://mkblog.exadel.com/2012/03/how-...

Thanks!


STRING MAPPED FROM LOCALSTORAGE

Posted: Sun Mar 25, 2012 11:33 pm
by maxkatz

I'll test this again, it might be a bug. Instead of using of Using Set Local Storage Variable action, save the variable in local storage directly using setItem(key, value) and then get the value using getItem(key);


STRING MAPPED FROM LOCALSTORAGE

Posted: Mon Mar 26, 2012 2:37 pm
by Michael Klauss

Hi Max!

Please, help me!

what happened? My token is not being displayed ... my first service is no longer receiving the token response. Did you change anything?


STRING MAPPED FROM LOCALSTORAGE

Posted: Mon Mar 26, 2012 3:34 pm
by Michael Klauss

Hi Max,

Worked! Did you change anything?


STRING MAPPED FROM LOCALSTORAGE

Posted: Mon Mar 26, 2012 3:48 pm
by maxkatz

No, we didn't change anything. Glad it's working.


STRING MAPPED FROM LOCALSTORAGE

Posted: Mon Mar 26, 2012 4:05 pm
by Michael Klauss

Hi Max,

I need your help to get text of the label.

I ́m trying:

var nomeUnidSaudeLocal = Tiggr('labelNomeItemUnidadeSaude').value;

alert(nomeUnidSaudeLocal);

localStorage.setItem('nomeUnidSaudeLocal', nomeUnidSaudeLocal);

can you help me?

Thanks!


STRING MAPPED FROM LOCALSTORAGE

Posted: Mon Mar 26, 2012 4:12 pm
by maxkatz

It is Tiggr(id).val() - it's jQuery Mobile object: http://help.gotiggr.com/documentation...


STRING MAPPED FROM LOCALSTORAGE

Posted: Mon Mar 26, 2012 4:31 pm
by Michael Klauss

Hi Max,

Didn ́t work.

This label is the label of my list.

Alert printing blank.

var nomeUnidSaudeLocal = Tiggr('labelNomeItemUnidadeSaude');

alert(nomeUnidSaudeLocal.val());

localStorage.setItem('nomeUnidSaudeLocal', nomeUnidSaudeLocal);