Forums

Find answers, ask questions, and connect with our
community all around the world.

Home Forum Omnis General Forum Closing an additional library closes the main window

  • Closing an additional library closes the main window

    Posted by Deleted User on March 18, 2024 at 1:13 pm

    Hi – In the fat client, this code below closes the window containing the button that triggered the event. The window resides in a different library from MYLIB. How do I close a (additional) library without closing the resources from the current window?

    Andreas Pfeiffer replied 3 months, 3 weeks ago 2 Members · 7 Replies
  • 7 Replies
  • Andreas Pfeiffer

    Administrator
    March 18, 2024 at 1:22 pm

    Hi Robert,

    This could be because the window instance that you are talking about is probably running inside the task instance of the library that you close. Although the window class may sit in another library the instance can live in a task of another library. This is all about who has opened the window instance. If the instance that opened that window is also part of the task instance the new instance will be in the same task instance. Etc.

    You can find out if you check what the current task instance is using $ctask().$name (note the parentheses). That gives you the name of the current task instance.

    If you want to make sure to open the window instance in another task instance you would need to open the window instance either directly from the $construct of that task or from another instance (menu etc.) that was opened from that $construct.

    I hope that makes sense.

    Best,

    Andreas

    • Deleted User

      Deleted User
      March 21, 2024 at 9:57 am

      Thanks Andreas! I have got that working now.

      As a follow up, I have another question – please help. When I have a item reference pointing to some object, the debugger knows the path of the item from $root (as in the attached picture). Is there a way to get this notation “address” in a string variable from the reference? The reason I want this is for dealing with a library upgrade with a lot of errors on JSON export and I am making an automated report of the errors and warnings.

  • Andreas Pfeiffer

    Administrator
    March 21, 2024 at 10:02 am

    Hi Robert,

    Yes. Try to add “().$fullname”

    Note, the parentheses.

    For example: calculate myTextVar as $cinst().$fullname

    Best,

    Andreas

    • Deleted User

      Deleted User
      March 21, 2024 at 10:53 am

      Hmmm, it works for $cinst but my lieblings item reference only manages to give “unnamed_value”. Any idea?

      • Deleted User

        Deleted User
        March 21, 2024 at 11:53 am

        Sure – I am running exporter.lbs on the library broken.lbs. The notation line that is producing ‘unnamed_value’ is exporter.exportTool.__updateDisplay.8

        Thank you!

  • Andreas Pfeiffer

    Administrator
    March 21, 2024 at 11:04 am

    Hi Robert,

    can you upload a sample lib that shows the problem?

    Best,

    Andreas

  • Andreas Pfeiffer

    Administrator
    March 21, 2024 at 2:59 pm

    Robert,

    would you let me know what steps are required to reproduce this problem? Do I need to open both libraries? When I run the Export Library button it simply closes the library.

    Best,

    Andreas

Log in to reply.