Forums

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

Home Forum Omnis General Forum Popup Menu toolbar button to Window Communication

  • Popup Menu toolbar button to Window Communication

    Posted by Henk Noppe on November 1, 2019 at 8:54 am

    Dear Omnis people,
    I tried to post this on the Omnis Dev list, but somehow it is not coming through therefore I post it here.
    Past days I was working on some issues concerning popup lists in Omnis Studio. One problem I countered is that if I use a toolbar component Popup List which opens later on in the code a new Popup List with the commmand Popup menu from list … at the new Popup list has the items of the first menu and at the bottom the items of the new Popuplist, eg
    Toolbar popuplist has
    Toolbar popup item 1
    Toolbar popup item 2
    Lets say that the first item opens in some conditions a new popup list with some items, like:
    New popupList item 1
    New popupList item 2
    What I get to see is:
    Toolbar popup item 1
    Toolbar popup item 2
    New popupList item 1
    New popupList item 2
    And that is not quite the desired behaviour I want. Because I can reproduce this on Omnis Studio 10.1, I reported it to Omnis Software. In the meantime I tried to think of a workaround. One of the workarounds I could think of is to change the first Popup List to a Popup Menu. And this brought some other things with it. I thought a Popup Menu is instanced as a child of the window/toolbar, but instead it is instanced under $root.$menus. This gives that $cwind.$someMethod is not working. To get around this I found $topwind, but that feels a bit flaky to me. Theoretically this can not go wrong, but I would like a more tight or more clear connection between the two. I made a demo library and published it to Github: https://github.com/frogli-omnis/ToolBarPopupMenu
    Does anyone if there a way how I can establish this other then a hard path $iwindows.windowName.$SomeMethod?
    Grtz Henk

    Mark Phillips replied 4 years, 8 months ago 2 Members · 5 Replies
  • 5 Replies
  • Mark Phillips

    Member
    November 1, 2019 at 4:13 pm

    I could not replicate your results, as I understand them. However, I did spend some time on the theory that you are seeing the results of a namespace collision. That is two or more instances with the same name. In my quick & dirty testing, I could not rename the window toolbar, nor the button object it contains. I was able to change the name of the toolbar in the Omnis window.
    So it appears there may be a fault in the $name.$assign method for the window toolbars group.

  • Henk Noppe

    Member
    November 1, 2019 at 6:54 pm

    Thanks for looking into this Mark,
    I made a small library which demonstrates this problem and published it to GitHub: https://github.com/frogli-omnis/ToolbarPopupList
    Let me know what you think of it.

  • Mark Phillips

    Member
    November 1, 2019 at 7:53 pm

    I ran the json import but it failed on an error at line 0 of library.json.
    Double clicking on the error list open the Find and Replace dialog to search for “T_report_parameters”. That is, I think, simply what is in the search buffer from another project. So I don’t know why the build fails.

  • Henk Noppe

    Member
    November 8, 2019 at 8:08 am

    Hi Mark,
    I just downloaded the repository in a different directory and I could import the library without any problems. I used Omnis Studio 8.1.7.1

  • Mark Phillips

    Member
    November 8, 2019 at 6:35 pm

    I removed the statement “extension”: false; from the library.json file and Omnis Studio v10.1 built a new library. With that I was able to replicate the behavior you describe. Interesting, in the wrong way. 🙂
    I cannot think of a workaround at the moment, but I will consider this further in the days ahead.

Log in to reply.