Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.

Popping form in and out of a panel - Windows Server 2016 issue

Hi all.
I've been running into an issue with some of our code that is working on Windows 2012 but doesn't seem to be working properly on Windows 2016.

What we have is a screen with a few panels on it which we load an OI form into each. There are setting that affect how many panels are seen on this screen, but it can be up to 3 panels separated with SRP.Splitters.

We added a button on our screen to "pop out" one of those panels (use RemoveForm with destroy set to 0 to remove the form added originally via setform) and make that screen maximized. When the user is finished, they close that maximized screen and we intercept the close to instead put that form back into the panel using setform again.

This has been working fine on Windows Server 2012, but when we used it on Windows Server 2016 we are having the panel act unlike we were seeing before. The panel doesn't want to update as changes are made anymore. In that if the sliders are moved, the resizing causes background colours and controls. I have attached a file of the panel in question before popping out and being re-inserted, and one after.
Before:

After:


I have tried a number of things to try and get the panel to refresh properly including firing size events, redraw on and off for the panel and the window, completely recreating my form before using setform and a number of other small things.

Is there anything else people can think of to try to solve this?

Comments

  • This looks like something we are going to have recreate in our lab. Are these instances of Windows both running as physical machines or in a terminal server of some type?
  • our Windows Server 2012 and Windows Server 2016 instances are running as HyperV virtual servers and we have 2 virtual servers per 1 physical server ratio.
  • @bhaughn, sorry no suggestions for resolving your issue. I just popped in to say


  • So far, I am unable to recreate this in our lab. I tested on Server 2016 that has been fully updated with SRP Controls 4.1.2. If you would like me to investigate more deeply, I am going to need one of two things:

    1. A copy of your OI system with steps to recreate.
    2. An RDK of a SYSPROG form that has no dependencies on your application that recreates the issue.

    If you are open to one of these options, email me at kfournier@srpcs.com.
  • If it helps, we did find a solution.
    We changed 3 things:
    1 - we stopped setting redraw of the control or window to 0 and back to 1 after putting the control back
    2 - we changed the FitWidth command from true to false
    3 - We changed the splitter bar logic resize on our main window to resize the control manually rather than letting the control handle it itself.

    These solved our issue.

    I appreciate the offer to help, but it seems changing these three things solved our issue so we're just going to move on to whatever is next.

    Thanks!
  • I'm glad you found a solution. I'll use this information to play with it just to see what I can see. Thanks.
  • @bhaughn what did you use to create the graphs?
  • Hi @BarryStevens. We used a 3rd party software package to create interactive charts using things like xml and json called fusion charts.
    https://www.fusioncharts.com/charts

    We've been using this suite for making small charts on our html O4W pages and within our DirectLine pages and started using it for more with analytics on our home page.
  • @bhaughn how did you get it to show in an OI form. Can it be printed in a report (say) OIPI.
  • @AusMarkB are you using graphs in any of your work?
  • @BarryStevens not really no. Though I would if I found the right tool with the smallest learning curve. :)
    I had intended to ask the same question you did but just hadn't got around to it yet. Probably because I would get unnecessarily distracted following it up.

    fusioncharts you say? Hhhmmm thanks @bhaughn
  • @AusMarkB you could also contact Richard Bright (Rev NZ), he was doing something with google charts in OI.
  • I'm guessing these are being loaded via the browser control?
  • we are loading them into the panels as dot net browser controls.
  • >>as dot net browser controls

    and how do you do that?
  • DotNetCtrl = @Window:".OLE_WB"
    dotNetHandle = StartDotNet(DotNetCtrl)
    dotNetDir = CheckDotNet("4.0"):"\"

    dlls = ""
    dlls<-1> = dotNetDir:"System.Windows.Forms.dll"
    rslt = Set_Property.net(dotNetHandle, "AssemblyName", dlls)
    If Get_Status(errs) Then
    Gosub handleError
    End

    * Create the control
    ourClass = "System.Windows.Forms.WebBrowser"
    hndlIE = create_class.net(DotNetHandle, ourClass)
    If Get_Status(errs) Then
    Gosub handleError
    End

    *retval = Set_property.net(hndlIE, "IsWebBrowserContextMenuEnabled", "False")
    retval = Set_property.net(hndlIE, "IsWebBrowserContextMenuEnabled", "True")
    retval = Set_property.net(hndlIE, "WebBrowserShortcutsEnabled", "False")
    retval = Set_property.net(hndlIE, "ScriptErrorsSuppressed", "True")

    * Save handle
    Call Set_Property(DotNetCtrl,'@HNDLIE',hndlIE)
    Call Set_Property(DotNetCtrl,'@HNDLDOTNET',dotNetHandle)


    ourClass = "System.Uri"
    hndlUri = create_class.net(dotNetHandle, ourClass, 0, "about:blank", "System.String")
    If Get_Status(errs) Then
    Gosub handleError
    End

    retval = send_message.net(hndlIE, "Navigate", hndlUri, "RevDotNet", 0)
    loop
    rs = Get_property.net(hndlIE, "ReadyState",0)
    while ( rs _NEC READYSTATE_COMPLETE$ )
    call yield()
    repeat

    Free_class.net(hndlUri)




    We then load our html into it after that
  • @bhaughn is there an advantage to using the .NET browser control versus the default one that OI uses?
  • The standard OI one was crashing for us seemingly randomly and we could never track down the reason. We switched to dotnet to test and have since never crashed our browser control randomly. We certainly can find ways to break it, but at least we know why.
  • It's a pretty cool work-around. I was just curious (hoping actually) if this version of the browser control was friendlier toward HTML5/JS web forms. That is, more like Chromium and less like IE. I take it this is still IE under the hood.
  • It is. The IE object (non-dotnet) I think is a version of IE8 by default. Or at least was for a long time. The dotnet object was easier to use a more recent version. It is not quite a chromium version though, so if you're developing in OI10, I would be more inclined to suggest using the web browser built in there if you're just putting it together. Our screens have been around for a while and thus not using a different plugin yet. We might in the future when we convert to OI10 though.
Sign In or Register to comment.