Here is the OnScriptInit code to do that: I can also determine which menu item was selected by parsing $_SERVER and looking for parameter ‘sc_item_menu’. I can now determine in OnScriptInit whether the event was triggered by the menu or by a grid refresh. Perhaps I am a little bit closer to my goal. It seems that Scriptcase may be passing parameters through $_SESSION - and managing rules of GET/POST/SESSION internally. When I analyzed changes to the $GLOBALS array, $_GET was blank and $_POST had limited parameters. I do not know if there is a bug in Scriptcase. I believe that the concept that Giu and you proposed should work. If I set the input global variable to optional, no error message is displayed, but it still seems to pick up the last global input value from the other window (very odd). When the input global variable is reset, an error message is triggered about a missing global variable. That said, I am not having much success with this. Your clarification helped me understand Giu’s concept. The variables need to persist so that the grid pulls the correct data when refreshed. What I need is a way to define variables that are not local ($myvar) which are limited in scope to a Scriptcase event inside an application (mygrid), not global (), which are accessible to all applications in the project, not application-specific (attributes?), since mygrid is reused 40 times, but rather menu tab (iframe) specific, so that when a report is invoked from the menu application, variables are saved and accessible only to that instance of the application (menu tab/iframe). I can duplicate the grid application 40 times, and alter the SQL and grid title, but that creates a maintenance headache should the report need to change. If I open the report for area1, then open the report for area2 and then return to area1, if I perform any action that regenerates the grid, the WHERE clause picks up the last value of and, which in my example are actually the values for area2. This works without issue as long as I am viewing the most recent report that was opened. is used in the Grid Title and in the grid SQL - SELECT col1,col2,… In the menu application, I set the value of two global variables, and. Each report uses the same grid application(mygrid), with a different WHERE clause in the SQL to select the appropriate data. I have also tried the option $_SESSION and I get the error Array to string conversion.I have a project that uses a menu application as a front end to about 40 reports. When I try to use them in a query, for example, they stay as and give me continuous errors.I have also tried to convert them into global variables, but no result. The values seem to be received well in the application (they appear with echo $_GET in the application that receives them -the main menu-) but, from then on, I can’t use them in any other application. In different applications I need to use these values to fill in a form field or make queries. I get several values in the url that opens the application (for example: ).In this case, I get id, cc and nid. I’m quite new to programming, because I think it should be a not too complicated issue. I’ve checked the forum quite a bit and, although there are some related answers, I haven’t found anything that works for me in the applications I’m working on.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |