Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

  • claudiobosticco
    replied
    Originally posted by Isomorphic View Post
    Hi!
    Sorry for the silence. This issue should be already resolved, but the thread didn't get updated - enableWhen and visibleWhen should now be behaving reliably in both 13.0 and 13.1 for Adaptive menu items (shown in buttons or adaptive-menu items)
    If you see any problems with this in the latest nightly build, please let us know

    Regards
    Isomorphic Software
    I'm testing it right now and seems to work, thank you very much!

    Regarding the enableIf, dynamicTitle and dynamicIcon, are they supposed to work only when the MenuItems aren't buttons?

    Leave a comment:


  • Isomorphic
    replied
    On the support, we do have a flag in your profile we can see, but we were also aware the renewal was in-process, so gave you some leeway!

    Leave a comment:


  • Isomorphic
    replied
    Hi!
    Sorry for the silence. This issue should be already resolved, but the thread didn't get updated - enableWhen and visibleWhen should now be behaving reliably in both 13.0 and 13.1 for Adaptive menu items (shown in buttons or adaptive-menu items)
    If you see any problems with this in the latest nightly build, please let us know

    Regards
    Isomorphic Software

    Leave a comment:


  • claudiobosticco
    replied
    Hello, any news on this issue?

    BTW, I just discovered that our support was elapsed :( ...isn't it possible to add a flag in the forum's user profile ?

    Leave a comment:


  • Isomorphic
    replied
    Apologies for the silence - we're on it this week and will update here when everything's addressed.

    Leave a comment:


  • claudiobosticco
    replied
    Hello, any news about this issue?

    Leave a comment:


  • Isomorphic
    replied
    Sorry for the delay on this one, and sorry that the hack we advised did not turn out to work. There are some tricky details here that we are working through, but we do intend to have it fixed up this week.

    Leave a comment:


  • claudiobosticco
    replied
    Hello, may I ask if you have a feedback on these issues? Maybe a suggestion regarding my tentative hack? Or may I expect to have visible/enableWhen feature working in a reasonable timeframe?

    Leave a comment:


  • claudiobosticco
    replied
    Originally posted by claudiobosticco View Post

    Actually I just noticed that, with my hack, sometimes at the first draw the ToolStripButtons are clipped and the menu is not present, it starts working only after a resize :confused:
    and this seems reproducible every time with this test case:

    Code:
    // variable-length name label and button control
    isc.Label.create({
        ID: "nameLabel",
        width: 1,
        wrap: false,
        refreshTitle: function (longName) {
            var name = longName ? "Alejandro O'Reilly" : "Lucy Lu";
            this.setContents("<b>Candidate: " + name + "</b>");
        }
    });
    
    isc.AdaptiveMenu.create({
        ID: "adaptiveMenu",
        inlineMenuItemProperties: {
            initWidget: function () {
                let menuItem = this.creator.items.find("title", this.title);
                let whenRulesCanvasHelper = isc.Canvas.create({
                    parentCanvas: this.creator,
                    left: -200,
                    top: -200,
                    enableWhen: menuItem.enableWhen ? isc.clone(menuItem.enableWhen) : null,
                    visibleWhen: menuItem.visibleWhen ? isc.clone(menuItem.visibleWhen) : null
                });
                this.Super("initWidget", arguments);
                this.observe(whenRulesCanvasHelper, "visibilityChanged", "if (observed.isVisible()) {observer.show();} else {observer.hide();}");
                this.observe(whenRulesCanvasHelper, "setDisabled", "observer.setDisabled(observed.isDisabled());");
            }
        },
        defaultLayoutAlign: "center",
        height: 30,
        items: [
            {title: "Contact", click: "isc.say(this.title)"},
            {
                title: "Hire Now", click: "isc.say(this.title)",
                enableWhen: {
                    _constructor: "AdvancedCriteria", operator: "and", criteria: [
                        {fieldName: "exampleForm.values.username", operator: "notEqual", value: "bob"}
                    ]
                }
            },
            {title: "View Résumé", click: "isc.say(this.title)"},
            {
                title: "Edit",
                showRollOver: false,
                embeddedComponent: isc.HStack.create({
                    snapTo: "TR",
                    height: "100%",
                    width: 190,
                    membersMargin: 3,
                    layoutMarginBottom: 5,
                    defaultLayoutAlign: "center",
                    members: [
                        isc.IButton.create({title: "Cut", autoFit: true, click: "isc.say(this.title)"}),
                        isc.IButton.create({title: "Copy", autoFit: true, click: "isc.say(this.title)"}),
                        isc.IButton.create({title: "Paste", autoFit: true, click: "isc.say(this.title)"})
                    ]
                }),
                embeddedComponentFields: ["key"]
            }
        ],
        menuProperties: {
            width: 350
        }
    });
    
    
    // parent Layouts
    isc.ToolStrip.create({
        width: 250,
        membersMargin: 5,
        layoutLeftMargin: 10,
        ID: "toolStrip",
        showResizeBar: true, height: 40,
        members: [nameLabel, "separator", adaptiveMenu]
    });
    
    isc.HLayout.create({
        height: 40,
        width: "100%",
        hPolicy: "none",
        members: [toolStrip]
    });
    
    isc.DynamicForm.create({
        ID: "exampleForm",
        top: 50,
        width: 300,
        fields: [
            {
                name: "username",
                title: "Username",
                type: "text",
                width: "*",
                required: true,
                defaultValue: "bob"
            }
        ]
    });
    the result is:

    Click image for larger version

Name:	2024-07-26 21.52.32.jpg
Views:	129
Size:	14.2 KB
ID:	273079

    Leave a comment:


  • claudiobosticco
    replied
    Originally posted by claudiobosticco View Post
    On the last point, without an ETA from you, I started implementing a workaround and would like your opinion on it:

    [cut]

    Actually it seems to work.
    Actually I just noticed that, with my hack, sometimes at the first draw the ToolStripButtons are clipped and the menu is not present, it starts working only after a resize :confused:

    Leave a comment:


  • claudiobosticco
    replied
    Originally posted by claudiobosticco View Post
    But unfortunately, it seems that the enableWhen on the menuItems isn't always working.
    I've reproduced it in the latest 13.1 showcase with this test case:

    Code:
    // variable-length name label and button control
    isc.Label.create({
        ID: "nameLabel",
        width: 1,
        wrap: false,
        refreshTitle: function (longName) {
            var name = longName ? "Alejandro O'Reilly" : "Lucy Lu";
            this.setContents("<b>Candidate: " + name + "</b>");
        }
    });
    
    isc.AdaptiveMenu.create({
        ID: "adaptiveMenu",
        defaultLayoutAlign: "center",
        height: 30,
        items: [
            {title: "Contact", click: "isc.say(this.title)"},
            {
                title: "Hire Now", click: "isc.say(this.title)",
                enableWhen: {
                    _constructor: "AdvancedCriteria", operator: "and", criteria: [
                        {fieldName: "exampleForm.values.username", operator: "notEqual", value: "bob"}
                    ]
                }
            },
            {title: "View Résumé", click: "isc.say(this.title)"},
            {
                title: "Edit",
                showRollOver: false,
                embeddedComponent: isc.HStack.create({
                    snapTo: "TR",
                    height: "100%",
                    width: 190,
                    membersMargin: 3,
                    layoutMarginBottom: 5,
                    defaultLayoutAlign: "center",
                    members: [
                        isc.IButton.create({title: "Cut", autoFit: true, click: "isc.say(this.title)"}),
                        isc.IButton.create({title: "Copy", autoFit: true, click: "isc.say(this.title)"}),
                        isc.IButton.create({title: "Paste", autoFit: true, click: "isc.say(this.title)"})
                    ]
                }),
                embeddedComponentFields: ["key"]
            }
        ],
        menuProperties: {
            width: 350
        }
    });
    
    
    // parent Layouts
    isc.ToolStrip.create({
        width: 375,
        membersMargin: 5,
        layoutLeftMargin: 10,
        ID: "toolStrip",
        showResizeBar: true, height: 40,
        members: [nameLabel, "separator", adaptiveMenu]
    });
    
    isc.HLayout.create({
        height: 40,
        width: "100%",
        hPolicy: "none",
        members: [toolStrip]
    });
    
    isc.DynamicForm.create({
        ID: "exampleForm",
        top: 50,
        width: 300,
        fields: [
            {
                name: "username",
                title: "Username",
                type: "text",
                width: "*",
                required: true,
                defaultValue: "bob"
            }
        ]
    });
    as I said it doesn't happen every time, it took me quite an amount of "try it" and switching back to the js tab, say 20 tries.

    I didn't see warnings in the dev console (let me know what log category could eventually help debugging) and it doesn't seem to depend on precisely where I release the resize bar, anyway this was happening with spacious density:

    Click image for larger version  Name:	2024-07-26 21.28.29.jpg Views:	0 Size:	21.6 KB ID:	273076

    Leave a comment:


  • claudiobosticco
    replied
    Hi Isomorphic , let me start by saying that even though I had seen the AdaptiveMenu in examples a long time ago, I had never tried it seriously until now.
    I regret not doing so earlier because I find it to be a truly useful component.
    Also, especially with Shiva, I like having a ToolStrip with one or two IButtons always visible and prominent, while the less prominent adapt to the available space.

    It seems logical to have a subclass of MenuItem since now one might assume that everything in MenuItem should work.

    Regarding the current implementation:
    • The code in post #1 seems to work for me, so for the click handler, I can manage with it for now.
    • enableIf is not important as long as enableWhen works.
    • dynamicTitle/Icon are not essential for me if visibleWhen works.
    • enableWhen and visibleWhen are essential.

    On the last point, without an ETA from you, I started implementing a workaround and would like your opinion on it:

    Code:
            inlineMenuItemProperties: {
                initWidget: function () {
                    let menuItem = this.creator.items.find("title", this.title);
                    let whenRulesCanvasHelper = isc.Canvas.create({
                        parentCanvas: this.creator,
                        left: -200,
                        top: -200,
                        enableWhen: menuItem.enableWhen ? isc.clone(menuItem.enableWhen) : null,
                        visibleWhen: menuItem.visibleWhen ? isc.clone(menuItem.visibleWhen) : null
                    });
                    this.Super("initWidget", arguments);
                    this.observe(whenRulesCanvasHelper, "visibilityChanged", "if (observed.isVisible()) {observer.show();} else {observer.hide();}");
                    this.observe(whenRulesCanvasHelper, "setDisabled", "observer.setDisabled(observed.isDisabled());");
                }
            }
    Actually it seems to work.

    But unfortunately, it seems that the enableWhen on the menuItems isn't always working. This happens also without my hack in place; it just made it more obvious while testing. Sometimes, randomly, when I have some menuItems enabled and some disabled, if I reduce the space so that some disabled buttons become menus, sometimes the menuItems that should be disabled will become enabled. This doesn't seem to happen if they're already menuItems at draw.

    Leave a comment:


  • Isomorphic
    replied
    Hi Claudio, you're right, the AdaptiveMenu component doesn't fully handle the situation that an adaptiveMenu.item may be rendered as either a Button or as a true MenuItem.

    We're looking into this, but the approach we're probably going to take is to create an AdaptiveMenItem sub-type of MenuItem, in which we point out that some APIs from MenuItem do not apply, but provide other means -most likely by making enableWhen / visibleWhen work, and then providing alternate means to access the AdaptiveMenu from an item.

    In the meantime, as a temporary hack, it should work to use the AutoChild system and directly call things like show/hide etc on the items when they are buttons.

    Leave a comment:


  • claudiobosticco
    replied
    Hello, just chiming in to ask if you see those problems, in particular the dynamicTitle/Icon issue, and the visible/enableWhen if rendered as ToolStripButtons, as they're pretty important for me.

    Leave a comment:


  • claudiobosticco
    replied
    Originally posted by claudiobosticco View Post
    Instead, I don't expect differences for visible/enableWhen, right?
    unfortunately, those works only when the items are actually rendered as menuItems, not when they are ToolStripButtons

    Leave a comment:

Working...
X