tlemar Posted October 15, 2015 Share Posted October 15, 2015 I am having a issue with a popup window that does not show up until I return to the main page. I implemented a script that loads the popup using PopupModal(0). I use the same script for each graph page. They all work correctly in design time, but in run time, several of the popups will not appear until you until I return to the main screen of my program. If I push the button to load the popup three times, I will get three instatnces of the popup when I return to the main page. I does not happen on every page but is consistent on which pages that it happens. I am using the most current build of 5.91. Function code Function Display_Graph_Range(string VarName, string GraphType) Try execute("component." + VarName + "_Graph.YAxisFrozen = 0") execute("component." + VarName + "_Graph.XAxisFrozen = 0") Private string XStartName = VarName + "_X_Start" Private StartTime = Systime() - 3 * 86400 Private string XEndName = VarName + "_X_End" Private EndTime = Systime() execute(XStartName + ".addValue(" + StartTime + ")") component.eb_Graph_X_Start.Contents = Evaluate(VarName + "_X_Start[0]") component.eb_Graph_X_Start.strSetChannel = VarName + "_X_Start" execute(XEndName + ".addValue(" + EndTime + ")") component.eb_Graph_X_End.Contents = Evaluate(VarName + "_X_End[0]") component.eb_Graph_X_End.strSetChannel = VarName + "_X_End" ?VarName ?GraphType Switch Case(GraphType == "X") page.Show_Popup_X_Range.PopupModal(0) Case(GraphType == "XY") component.eb_Graph_Y_Start.Contents = Evaluate(VarName + "_Y_Start[0]") component.eb_Graph_Y_Start.strSetChannel = VarName + "_Y_Start" component.eb_Graph_Y_End.Contents = Evaluate(VarName + "_Y_End[0]") component.eb_Graph_Y_End.strSetChannel = VarName + "_Y_End" page.Show_Popup_XY_Range.PopupModal(0) Case(GraphType == "XYY") component.txt_LeftAxis1.strText = evaluate("component." + VarName + "_Graph.LeftAxis1.strLabel") component.txt_RightAxis1.strText = evaluate("component." + VarName + "_Graph.RightAxis1.strLabel") component.eb_Graph_Y1_Start.Contents = Evaluate(VarName + "_Y_Start[0]") component.eb_Graph_Y1_Start.strSetChannel = VarName + "_Y_Start" component.eb_Graph_Y1_End.Contents = Evaluate(VarName + "_Y_End[0]") component.eb_Graph_Y1_End.strSetChannel = VarName + "_Y_End" component.eb_Graph_Y2_Start.Contents = Evaluate(VarName + "_Y2_Start[0]") component.eb_Graph_Y2_Start.strSetChannel = VarName + "_Y2_Start" component.eb_Graph_Y2_End.Contents = Evaluate(VarName + "_Y2_End[0]") component.eb_Graph_Y2_End.strSetChannel = VarName + "_Y2_End" page.Show_Popup_XYY_Range.PopupModal(0) Case(GraphType == "XYYY") component.txt_LeftAxis1.strText = evaluate("component." + VarName + "_Graph.LeftAxis1.strLabel") component.txt_RightAxis1.strText = evaluate("component." + VarName + "_Graph.RightAxis1.strLabel") component.txt_RightAxis2.strText = evaluate("component." + VarName + "_Graph.RightAxis2.strLabel") component.eb_Graph_Y1_Start.Contents = Evaluate(VarName + "_Y_Start[0]") component.eb_Graph_Y1_Start.strSetChannel = VarName + "_Y_Start" component.eb_Graph_Y1_End.Contents = Evaluate(VarName + "_Y_End[0]") component.eb_Graph_Y1_End.strSetChannel = VarName + "_Y_End" component.eb_Graph_Y2_Start.Contents = Evaluate(VarName + "_Y2_Start[0]") component.eb_Graph_Y2_Start.strSetChannel = VarName + "_Y2_Start" component.eb_Graph_Y2_End.Contents = Evaluate(VarName + "_Y2_End[0]") component.eb_Graph_Y2_End.strSetChannel = VarName + "_Y2_End" component.eb_Graph_Y3_Start.Contents = Evaluate(VarName + "_Y3_Start[0]") component.eb_Graph_Y3_Start.strSetChannel = VarName + "_Y3_Start" component.eb_Graph_Y3_End.Contents = Evaluate(VarName + "_Y3_End[0]") component.eb_Graph_Y3_End.strSetChannel = VarName + "_Y3_End" page.Show_Popup_XYYY_Range.PopupModal(0) EndCase Catch() ?strLastError LocalError.addValue("Display Graph Range => " + strLastError) EndCatch Calling Code Display_Graph_Range("GW", "XY") Link to comment Share on other sites More sharing options...
AzeoTech Posted October 16, 2015 Share Posted October 16, 2015 First let me ask: do you initialize the graphs on those pages by quickly going to that page once at startup? Second, can you create a simple app that demonstrates the issue? Link to comment Share on other sites More sharing options...
tlemar Posted October 16, 2015 Author Share Posted October 16, 2015 1. No I don't. Should I have a script that goes to each on startup? I have 8 to 10 distinct graphs in this application. 2. Not sure it would help. It seems to work fine during development. Just seems to happen once it is reading channels. I can send you the file privately if it will help. I use the same code on several sites. It works fine on a majority of them but I have notice this issue on several pages lately. Link to comment Share on other sites More sharing options...
AzeoTech Posted October 20, 2015 Share Posted October 20, 2015 1. you need it for web pages and capture(). I don't remember if you need it for popups. I think so. 2. I wonder if in development you are inadvertently going to these pages before popup so basically doing what I suggest in #1. When you go to runtime, the popup happens first. Make sure you are on the most current build. Its in the same location and has been recently updated. Link to comment Share on other sites More sharing options...
tlemar Posted October 28, 2015 Author Share Posted October 28, 2015 Can you tell me the best way to initialize these pages? Is there a specific order I should use? Link to comment Share on other sites More sharing options...
AzeoTech Posted October 28, 2015 Share Posted October 28, 2015 Just do this in your auto-start: page.strCurrentPage = "firstGraphPage" delay(0.1) page.strCurrentPage = "secondGraphPage" delay(0.1) // etc.. page.strCurrentPage = "mainPage" Link to comment Share on other sites More sharing options...
tlemar Posted November 12, 2015 Author Share Posted November 12, 2015 Tried your suggestion. No luck. I have a screen capture that depicts issues. It is to big to attach. Please provide an email address and I will forward it to you. Link to comment Share on other sites More sharing options...
AzeoTech Posted November 12, 2015 Share Posted November 12, 2015 Use the email you've used before. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.