So, I have an application (panel) with the standard (UX) login, and an embedded object (panel application) which merely gets a community from a dropdown box of them. I need to store, as global variables I assume, both the username from the login and the community from the dropdown. Working first just with the community, I am able to store it in window.community, which I immediately test with an alert box showing the correct community. So far so good.
Once the user selects the community from the list, he will click a button which takes the user to another panel which does, among other things, create a record including an address, a description and a photo. This record becomes one in a database. All that works just fine. I need to use the previously chosen community name (and username, but I'm not trying to do that now, just doing one thing at a time...) in the database record as well, but when I try to use it, even just display it in an alert box, it has no value. Other posts suggest that I need to DIM GLOBAL the window.community everywhere it is used - or rather those variables that are declared as DIM GLOBAL need to be so declared everywhere. It seems that using window.community (and hopefully window.myusername soon) gets around that necessity. Am I missing something? I have read the excellent CSDA tips section on this (Variable Usage, Dimensioning & Deletion (Email Comments) Updated 07 November 2011) but I'm not seeing an answer there. I have seen the M43 video (Understanding Global Javascript Variables and the 'Window' Namespace) which is why I thought to use the Window namespace but it does not go far enough to answer my question, it seems :)
There are many pieces to this, it seems, but nothing comprehensive that I have found to help me understand the what-seems-to-me-to-be-simple method(s) to be able to pass a couple of variables from panel to panel! Any help would be appreciated.
Once the user selects the community from the list, he will click a button which takes the user to another panel which does, among other things, create a record including an address, a description and a photo. This record becomes one in a database. All that works just fine. I need to use the previously chosen community name (and username, but I'm not trying to do that now, just doing one thing at a time...) in the database record as well, but when I try to use it, even just display it in an alert box, it has no value. Other posts suggest that I need to DIM GLOBAL the window.community everywhere it is used - or rather those variables that are declared as DIM GLOBAL need to be so declared everywhere. It seems that using window.community (and hopefully window.myusername soon) gets around that necessity. Am I missing something? I have read the excellent CSDA tips section on this (Variable Usage, Dimensioning & Deletion (Email Comments) Updated 07 November 2011) but I'm not seeing an answer there. I have seen the M43 video (Understanding Global Javascript Variables and the 'Window' Namespace) which is why I thought to use the Window namespace but it does not go far enough to answer my question, it seems :)
There are many pieces to this, it seems, but nothing comprehensive that I have found to help me understand the what-seems-to-me-to-be-simple method(s) to be able to pass a couple of variables from panel to panel! Any help would be appreciated.
Comment