Page 1 of 1

label text not escaped when using Set Local storage variable action

Posted: Wed Jul 10, 2013 5:51 am
by TN

I created a test screen with a label containing text "B&G" and a button that when pressed, grabs the label text, sets a 'test' variable (using Set local storage variable action) and displays using
alert (localStorage.getItem('test'));

The text stored in the variable returns 'B & amp ; G' without spaces

Is there a way that I can get it to properly escape this character?

I also tested with a text area component and that seemed to return the correct string.


label text not escaped when using Set Local storage variable action

Posted: Wed Jul 10, 2013 6:05 am
by TN

label text not escaped when using Set Local storage variable action

Posted: Wed Jul 10, 2013 7:23 am
by Kateryna Grynko

Hello,

Working on it


label text not escaped when using Set Local storage variable action

Posted: Wed Jul 10, 2013 9:30 am
by Kateryna Grynko

Hi,

Run the following JavaScript code:
codelocalStorage.setItem( "name", "value & value" );/code


label text not escaped when using Set Local storage variable action

Posted: Wed Jul 10, 2013 11:50 pm
by TN

Hello Katya,

I'm not sure I understand what value I'm meant to use.

I tried doing:
code
var n = Appery('SkuLabel');
localStorage.setItem("szSkuLookup", n.text() );
alert (localStorage.getItem('szSkuLookup'));
/code

The thing is my actual screen has a label within a grid and the label is mapped to json reponse array, so accessing the label text when the user clicks the label from the grid it return empty


label text not escaped when using Set Local storage variable action

Posted: Wed Jul 10, 2013 11:53 pm
by TN

label text not escaped when using Set Local storage variable action

Posted: Thu Jul 11, 2013 12:31 am
by TN

label text not escaped when using Set Local storage variable action

Posted: Thu Jul 11, 2013 1:25 am
by TN

I used the following JS code as a workaround:

codelocalStorage.szSkuLookup = $(this).closest("[name=mobilegrid_121]").find('[name=SkuLabel]').text();/code

Not sure why the built-in click event for set variable action did not return the correct string. Could this be a bug?

Thanks.


label text not escaped when using Set Local storage variable action

Posted: Thu Jul 11, 2013 1:47 am
by Igor

Hello,

Try to use Javascript with next code:

precode
Appery('mobilelabel_42').text("a \u0026 b");
localStorage.setItem("test","a \u0026 b");
/code/pre