Welcome to the nuBuilder Forums!
Register and log in to access exclusive forums and content available only to registered users.
Register and log in to access exclusive forums and content available only to registered users.
hash cookies are not populated on form opening
-
- Posts: 7
- Joined: Thu Sep 10, 2020 9:58 am
hash cookies are not populated on form opening
Hi, I've a problem with building a form that make large use of hash cookies:
The entire form should be dinamically populated on the content of the #form_description# hash cookie.
And everything works just fine if I refresh the page one time after opening it.
But that's also the problem: why the hash cookie that contains the form description is populated only after one refresh?
There is a way the form can use the #form_description# at the first opening?
I see that on the video this problem has been also encoutered for Lookups and solved using nuSetFormValue() to update the values realtime.
Many thanks in advance for any reply.
The entire form should be dinamically populated on the content of the #form_description# hash cookie.
And everything works just fine if I refresh the page one time after opening it.
But that's also the problem: why the hash cookie that contains the form description is populated only after one refresh?
There is a way the form can use the #form_description# at the first opening?
I see that on the video this problem has been also encoutered for Lookups and solved using nuSetFormValue() to update the values realtime.
Many thanks in advance for any reply.
-
- Posts: 7
- Joined: Thu Sep 10, 2020 9:58 am
Re: hash cookies are not populated on form opening
I can further specify that I'm trying to obtain the #form_description# populated on the form first load on an EDIT form.
Don't hesitate to ask me for any information that may be useful to reach a solution, because I really need that the form content change completely based on a parameter that should not be changed.
I will basically create a copy of the form many times, changing only the form_description in order to change all the content.
Any alternative idea to obtain the same result is welcome.
Don't hesitate to ask me for any information that may be useful to reach a solution, because I really need that the form content change completely based on a parameter that should not be changed.
I will basically create a copy of the form many times, changing only the form_description in order to change all the content.
Any alternative idea to obtain the same result is welcome.
-
- nuBuilder Team
- Posts: 506
- Joined: Fri Dec 28, 2018 1:41 pm
- Location: Krakow, Poland
- Has thanked: 8 times
- Been thanked: 18 times
Re: hash cookies are not populated on form opening
try to place the following code in the: PHP Before Edit; PHP After Save
in my case it works properly - by checking nuDebug (ctrl+shift+d)
and I do not need to perform refresh.
Is it for all objects, for specific objects, how to replicate your case?
FYI: I had some issue with some need for refresh but it was for the browse form:
https://forums.nubuilder.cloud/viewtopic. ... usz#p19321
Code: Select all
$s=nuHash();
nuDebug($s);
and I do not need to perform refresh.
Is it for all objects, for specific objects, how to replicate your case?
FYI: I had some issue with some need for refresh but it was for the browse form:
https://forums.nubuilder.cloud/viewtopic. ... usz#p19321
If you like nuBuilder, please leave a review on SourceForge
-
- nuBuilder Team
- Posts: 4307
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 448 times
- Contact:
-
- Posts: 7
- Joined: Thu Sep 10, 2020 9:58 am
Re: hash cookies are not populated on form opening
Thank you, but your solution don't work.Janusz wrote:try to place the following code in the: PHP Before Edit; PHP After Savein my case it works properly - by checking nuDebug (ctrl+shift+d)Code: Select all
$s=nuHash(); nuDebug($s);
and I do not need to perform refresh.
Is it for all objects, for specific objects, how to replicate your case?
I tried also to change the form into a "Browse and Edit" one. No luck.
I'll try to better explain my situation: What you see here is now a BROWSE and EDIT form.
All the objects correspond to many SQL queries, and all of them uses the same hash cookie, only one, and that's exactly the #form_description#.
The page is supposed to dinamically update themself only changing the form_description of the form.
This allows me to create more clone pages with different contents.
The image show you the page as it appears at the first load.
Checking nuDebug(), the cookies are populated not at the first launch of the form, but after a refresh, everything's just fine and all the objects are correctly populated with the needed data.
check out the image, all the fields use it, but only the RUN object is effectively using it at the first load. I don't understand why.kev1n wrote:Where and how do you set the Hash Cookie?
You do not have the required permissions to view the files attached to this post.
-
- nuBuilder Team
- Posts: 4307
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 448 times
- Contact:
Re: hash cookies are not populated on form opening
Let me rephrase the question:
Where/when is the hash cookie set?
In another form/by clicking a button?
Can you describe which actions are performed before the form is opened?
Where/when is the hash cookie set?
In another form/by clicking a button?
Can you describe which actions are performed before the form is opened?
-
- Posts: 7
- Joined: Thu Sep 10, 2020 9:58 am
Re: hash cookies are not populated on form opening
Uhm, maybe this is the problem. The hash cookies needs to be set?kev1n wrote:Where/when is the hash cookie set?
I supposed that all the form fields, and especially the FORM_DESCRIPTION, that has been declared at the form creation, were loaded and populated automatically at the form opening.
Clearly, after your question... is not what happens.
Yet why the browse table subform is working?
nothing. From the home, the form is loaded. Nothing more.kev1n wrote:Can you describe which actions are performed before the form is opened?
And after a refresh form, everything works as intended.
-
- nuBuilder Team
- Posts: 4307
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 448 times
- Contact:
Re: hash cookies are not populated on form opening
And Assistant + Numero di telefono Display objects?
You do not have the required permissions to view the files attached to this post.
-
- nuBuilder Team
- Posts: 4307
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 448 times
- Contact:
Re: hash cookies are not populated on form opening
This is a workaround, to refresh the Select Objects with some Javascript when the form opens:
Add this code to your form’s Custom Code field. Also replace the Object Ids assistant,numero_di_telefono, team with yours.
The function refreshSelectObject() is documented here:
https://github.com/smalos/nuBuilder4-Co ... /README.md
Add this code to your form’s Custom Code field. Also replace the Object Ids assistant,numero_di_telefono, team with yours.
Code: Select all
if (nuFormType() == 'edit') {
refreshSelectObject('assistant');
refreshSelectObject('numero_di_telefono');
$('#team').html($('#team').html().replace('#form_description#', nuCurrentProperties().form_description));
}
https://github.com/smalos/nuBuilder4-Co ... /README.md
-
- Posts: 7
- Joined: Thu Sep 10, 2020 9:58 am
Re: hash cookies are not populated on form opening
Yeskev1n wrote:Is Team #form_description# a HTML object?
Yeskev1n wrote:And Assistant + Numero di telefono Display objects?
Code: Select all
if (nuFormType() == 'edit') {
refreshSelectObject('team_assistant_0');
refreshSelectObject('team_assistant_0_tel');
$('#team').html($('#team').html().replace('#form_description#', nuCurrentProperties().form_description));
}
Replacing only assistant and numero_di_telefono with my correspondant field IDs team_assistant_0 and team_assistant_0_tel but the code don't work.
I tried also changing the nuFormType() from edit to browse, nothing changed.
You can see here a list of the objects and their ID in this screenshot: Thank you for your help so far, anyway.

If you know any other workaround or a fix for this one, will be really welcome.
You do not have the required permissions to view the files attached to this post.