Page 3 of 3

html component

Posted: Wed Nov 12, 2014 11:40 pm
by Yurii Orishchuk

HI EJLD,

Unfortunatly nope, that's not clear at all even with your descriptions.

I can not find "complete" event handler from 2-nd step. But i see 2nd "Run javascript" that's run "blockText();".

http://prntscr.com/55sztt/direct

Also i don't know where your "blockText" function located.

Please make screen shots where we can see you use this ".innerHTML".

Regards.


html component

Posted: Wed Nov 12, 2014 11:46 pm
by EJLD

you look like very picky on terminology. complete or success, is both triggered on completion anyway ...

as for where to find "my" blockText(); if you read again carefully my post, you'll find "FOM120_blockText_code" which is the name of the page.

... anyway I'll send you screen shots asap.

thks for your kind support


html component

Posted: Thu Nov 13, 2014 1:28 am
by Yurii Orishchuk

Thanks EJLD,

We will help as soon as we could understand how it implemented.

Regards.


html component

Posted: Thu Nov 13, 2014 3:49 am
by EJLD

I am preparing some screenShots.
however, in the mean time if you don't understand maybe ask your colleagues for help. it looks like simple for me who is a very beginner folk at the app stuff.
thk you for your efforts


html component

Posted: Thu Nov 13, 2014 4:35 am
by EJLD

Hi again,

here att'd are the step by step screenShots.

thk you for your time,
Eric

1/ Builder's UI page
Image

2/ Event Tab showing the invoking the service
Image

3/ on service success, the records are stringified in a localstorage
Image

4/ on service success still, a function is triggered
Image

5/ JS page of the function code
Image

6/ JS code 2 steps which extracts the parts of texts in the LS to place them into their respective HTML blocks
Image


html component

Posted: Thu Nov 13, 2014 11:35 pm
by Yurii Orishchuk

Hi EJLD,

This time it's clear.

I analyzed your problem and here is results:

1 You receive response from server as pure JS object.

2 Then you stringify this object in to JSON string - http://prntscr.com/56454c/direct

3 When object converts to JSON string - it have some rules.. One of this rule - is escapes. See details here: http://www.json.org/

4 Then you get this string and cut some values from this string.. Actually this string contains escapings.

So:

You need:
1 Get JSON string and convert this string to pure JS object with following code:

pre

var textContents = localStorage.getItem("FOM"+CnTp+"textContents");
var textContentsObject = JSON.parse(textContents);

/pre

2 Now you can use "textContentsObject" as JS object. Navigate through it and get values you need. In this object all values should be correct.

Regards.


html component

Posted: Fri Nov 14, 2014 12:49 am
by EJLD

Hi, thk you very much for all that.
let me try.
hv a good day,
Eric


html component

Posted: Fri Nov 14, 2014 2:42 pm
by EJLD

Hi There, make sure Yurii gets that msg !

Hi Yurii,
I used your code but it didn't work unfortunately. none of the txts got displayed in the UI's html components ... some error msgs when parsing with that JSON.parse. however, you gave me a good advice with the http://www.json.org/ . once the rule understood, I added some do-while code which parse the JSON string as a walk-through to remove all the backslashes inserted under that JSON rules in order to make it pure JS.

consequently, it works WELL !

all tables' titles centered over 2 columns appear so, as well as the indented single unit digits ... beautiful !

thks for the advice again!
Best
Eric

att'd is the additional code. simple but effective.

Image