Page 1 of 1

Confused with global hash cookies...

Posted: Sun Apr 16, 2023 8:19 pm
by luca.ongaro
Me again, a nightmare. :roll:
But nuBuilder is a great platform, worth my learning efforts, and I appreciate so much your assistance!
Now I have problems with global hash cookies.
In my nuuserHome I have an input object ('scelta_anno') and a button to launch a form.
The onclick() code of the button is just:

Code: Select all

nuSetProperty('my_anno', scelta_anno.value, true);
1) In the form that opens, at first #my_anno# appears to be not defined in the BB code, but then it is after a page reload - checked using nuDebug(nuHash());.
2) Instead, it appears to be correctly defined for the form custom code - checked using console.log(nuGetProperty('my_anno'));.
3) Finally, the hash_cookie disappears at all when I reload nuuserHome, disappointingly.

Where am I wrong?

Thank you

Re: Confused with global hash cookies...

Posted: Sun Apr 16, 2023 8:29 pm
by gerese
Look at an example:

Code: Select all

var r1 = nuCurrentProperties().record_id;
nuSetProperty('my_anno', r1, true);

Re: Confused with global hash cookies...

Posted: Mon Apr 17, 2023 8:13 am
by luca.ongaro
Thank you, but, sorry, your hint didn't help me...

Re: Confused with global hash cookies...

Posted: Mon Apr 17, 2023 9:11 am
by kev1n
Does it help if you set the HK when the form is opened and the value of scelta_anno is changed (use the blur event)?

Re: Confused with global hash cookies...

Posted: Mon Apr 17, 2023 9:43 am
by luca.ongaro
Thank you kev1n, you made my day.
But what is the explanation for this behaviour? Just to avoid future pitfalls...
Thanks a lot