Problem With Popup


Recommended Posts

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

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

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

  • 2 weeks later...

Archived

This topic is now archived and is closed to further replies.