How to refresh Header Variables when the value is change

Dear master

I had insert header variabel value with Global variabel in form menu.

i want each time when i open form branch grid and select the row (klick the row), then the Header variabel value (in form menu) change to what i am select.

It this possible to do it ? and how?

Note: i had try using sc_redict back to form menu, but this didn’t work.

Thanks for the help

A global variable set as SESSION should do the job

Not sure about this. If you click a row in a grid you at least need an onclick event and afaik there is none…

this will not work then because to show the value you have to refresh menu. You have to use JS to upload the text if you don’t want to refresh

Dear Mr Giu

Can u show me how to do that?

I am only one month using scriptcase, this tools very helpfull and quickly create app ( and i dont expert/newbie in php or javascript)

Thanks

I have create on_click event and put this code :

?>
<script>
document.getElementById(‘lin2_col2’).innerHTML = ‘Welcome [usr_name] - [usr_branch_name]’;
</script>
<?php

But still not working, any have solution, pls

Sorry for delay.

Apps inside a menu run inside an iframe. If you have this code, inside your app, to modify the value on screen of menu, you have to call on parent.

Try with

  window.parent.document.getElementById('lin2_col2').innerHTML = 'Welcome [usr_name] - [usr_branch_name]'; 

Thanks Mr.Giu, i had try it, nothing happen.

where did you wrote this code?

i had put the code in On_click event (when user click the branch for switching in form grid).

Thanks

I created quickly a little demo gif to show it working, and then I readed you that you talk about a grid, not a form.
https://www.dropbox.com/s/gkk7i5s617…title.gif?dl=0

Sadly I don’t have time right now to test over a grid. If I get some time tomorrow I will try to create some demo, but can’t promise anything.

Thanks Mr Giu, i had try it in grid, didn’t work for me.

i want to change header menu when i select(click) branch from a grid.

i will waiting for you time, thanks again.

Mr.Giu thanks for your help before, i had solve this problem using sc_redir back to form menu, and it work fine

Hehe… You did not share to others.
I also experienced with this problem.
I have global variable that put in header of menu
Welcome [user]
When I change global variable above I want to refresh this value.
To solve that problem I am using
sc_redir(application_x, parm1={var_test}; parm2=“xxx”);

Example
sc_redir(menu.php, parm1=[user]; “_parent”);

I made it work as follows:

The menu done with the new Menu Structure of ScriptCase 9 does NOT set the ID, but only the classname, thats why the following code works for me:
?>
<script>
var supname = <?php echo json_encode($_SESSION[‘mySupName’]); ?>;
var supgid = <?php echo json_encode($_SESSION[‘mySupGID’]); ?>;
window.parent.document.getElementsByClassName(‘sc-layer-0-0’)[0].innerHTML = supname;
window.parent.document.getElementsByClassName(‘sc-layer-0-1’)[0].innerHTML = 'Internal ID: ’ + supgid;
</script>
<?php

// ​mySupName and mySupGID must be a GLOBAL var