nuRunPHPHidden runs a server-side PHP procedure (setHashCookieOnServerSide) asynchronously. This means the script execution does not pause and wait for nuRunPHPHidden to finish.
The nuGetProperty('hash_cookie') line runs immediately after nuRunPHPHidden is called, but since the callback hasn't been processed yet, the property value hasn't been updated when nuMessage is triggered.
What is then the best approach to make this working ? Procedure will be always async ? How to know when the procedure has finished ? Another alternative ? thx
Generally, I found quite difficult to pass data from the client to the serveur vs to the database. Do we have a good example explaining how to best solve that ? I thought that hash cookie was THE solution and it seems it is a little bit more complex.
Many thanks for your help,
yvesf wrote: ↑Thu Jan 23, 2025 7:57 pm
What is then the best approach to make this working ? Procedure will be always async ? How to know when the procedure has finished ? Another alternative ? thx
In your form's custom code, declare a function called onProcedureComplete(); for example, and add there the code to be executed after the procedure has been executed.
yvesf wrote: ↑Fri Jan 24, 2025 12:48 am
It doesn't work with this proposed approach.
How did you test it? It seems to be working fine on my end.
Also, I'm curious about the reasoning behind using nuSetProperty().
Wouldn’t it be possible to simply pass a parameter to the onProcedureComplete() function instead?
cannot be put directly after the call to the procedure on the custom code's form. It has to be put directly in php code or via a procedure.
Many thx for your help and implication,