Announcement

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

    Smartclient 10.1 - Behavior of ToolBarItem changed

    Hi there,
    it seems that in smartclient 10.1 the behavior of the toolbar has been changed.
    If an element is not visible it was possibel to change an attribute (for example title) of the element.
    In Smartclient 10.1 (latest nightly) this is not possible it seems that the title can only be set if the parent is visible.
    Is this expected behaviour? We think it should be possible to change the attribute even if it isn't visible.

    To find the changes between 10.0 and 10.1 is some hard work for us in our >300 views, because we have to check every view, if we show the toolbar before every title-change.
    Could you please activate the old behaviour?


    In Smartclient 10.0 Click image for larger version

Name:	Animation 27.gif
Views:	78
Size:	172.4 KB
ID:	234202


    In Smartclient 10.1 Click image for larger version

Name:	Animation 28.gif
Views:	55
Size:	316.9 KB
ID:	234203


    Code for reproduction:
    Code:
    isc.Button.create({
        "ID" : "a",
        "click" : function () {
            toolbarButton.setTitle("changed");
        },
        "title" : "Set Title",
    });
    isc.Button.create({
        "ID" : "b",
        left : 100,
        "click" : function () {
            myToolbar.show();
        },
        "title" : "show toolbar"
    });
    isc.DynamicForm.create({
        "ID" : "form",
        "width" : "100%",
        top : 50,
    
        "numCols" : 2,
        "values" : {
            "formField" : "this is a form"
        },
        "fields" :
        [{
                "ID" : "formField",
                "name" : "formField",
                "showTitle" : false
            }, {
                "ID" : "myToolbar",
                "name" : "myToolbar",
                "type" : "toolbar",
                "width" : 200,
                "visible" : false,
                "buttons" :
                [{
                        "ID" : "toolbarButton",
                        "click" : function (p1, p2) {},
                        "name" : "toolbarButton",
                        "type" : "button",
                    }
                ]
            }
        ]
    });
    Bet Regards
    Last edited by SimonF; 15 Jan 2016, 07:39.

    #2
    Hi,
    Do you have anything new about this or maybe this post was missed?

    Best regards

    Comment


      #3
      Hi Simon,
      Not missed! This is queued for investigation but we don't yet have anything to share with you.

      We'll follow up as soon as we have any relevant information.

      Thanks
      Isomorphic Software

      Comment


        #4
        Toolbar makes a small performance improvement by not creating buttons until initial draw().

        We've added an attribute to builds dated January 22 and later - Toolbar.createButtonsOnInit, default null - you can set this to true to fix your issue, by having buttons created immediately in initWidget().

        Comment


          #5
          Hi there,
          I'm not quite sure, if I haven't understand the solution completely, but with the code below (where I have set createButtonsOnInit to true in the toolbar) I'm still getting the same error.
          Is this really fixed or have I misunderstood the solution? Click image for larger version

Name:	Animation 32.gif
Views:	63
Size:	212.2 KB
ID:	234487


          Code:
          isc.Button.create({
          "ID" : "a",
          "click" : function () {
          toolbarButton.setTitle("changed");
          },
          "title" : "Set Title",
          });
          isc.Button.create({
          "ID" : "b",
          left : 100,
          "click" : function () {
          myToolbar.show();
          },
          "title" : "show toolbar"
          });
          isc.DynamicForm.create({
          "ID" : "form",
          "width" : "100%",
          top : 50,
          
          "numCols" : 2,
          "values" : {
          "formField" : "this is a form"
          },
          "fields" :
          [{
          "ID" : "formField",
          "name" : "formField",
          "showTitle" : false
          }, {
          "ID" : "myToolbar",
          "name" : "myToolbar",
          "type" : "toolbar",
          "createButtonsOnInit" : true,
          "width" : 200,
          "visible" : false,
          "buttons" :
          [{
          "ID" : "toolbarButton",
          "click" : function (p1, p2) {},
          "name" : "toolbarButton",
          "type" : "button",
          }
          ]
          }
          ]
          });
          Regards

          Comment


            #6
            Any update?

            Comment


              #7
              Did you upgrade to the latest?

              Your sample code works as expected for us against the latest framework code - we see no errors and clicking the "Set Title" button does indeed update the other button's title without it having tobe shown first.
              Last edited by Isomorphic; 1 Feb 2016, 12:43.

              Comment


                #8
                Hi there,

                yes I have upgraded and tested again with the latest downloadable version ("v10.1p_2016-01-31/Pro Deployment").
                The same error occurs with Chrome Version 48.0.2564.97 m and Firefox 44.0.
                In the example below you can see I have set createButtonsOnInit in the toolbar to true.

                In Chrome there is this error:
                Code:
                *09:16:25.120:MUP1:WARN:Log:ReferenceError: toolbarButton is not defined
                Stack from error.stack:
                    click(<no args: exited>) on [Button ID:a] @ 2016-01-15-hidden.html:27:3
                    StatefulCanvas.handleActivate(<no args: exited>) on [Button ID:a] @ ISC_Foundation.js:230:108
                    StatefulCanvas.handleClick(<no args: exited>) on [Button ID:a] @ ISC_Foundation.js:231:13
                    [c]EventHandler.bubbleEvent(<no args: exited>) on [Class EventHandler] @ ISC_Core.js:1647:89
                    [c]EventHandler.handleClick(<no args: exited>) on [Class EventHandler] @ ISC_Core.js:1507:50
                    EventHandler._handleMouseUp(<no args: exited>) on [Class EventHandler] @ ISC_Core.js:1492:11
                    [c]EventHandler.handleMouseUp(<no args: exited>) on [Class EventHandler] @ ISC_Core.js:1483:57
                    [c]EventHandler.dispatch(_1=>[c]EventHandler.handleMouseUp(), _2=>[object MouseEvent]) on [Class EventHandler] @ ISC_Core.js:1721:108
                    HTMLDocument.eval(event=>[object MouseEvent]) @ [no file]:3:123
                
                ISC_Core.js:1721 Uncaught ReferenceError: toolbarButton is not defined
                In Firefox this one:
                Code:
                *09:17:10.890:MUP0:WARN:Log:ReferenceError: toolbarButton is not defined
                Stack from error.stack:
                    .click() @ 2016-01-15-hidden.html:27:3
                    StatefulCanvas.handleActivate()
                    StatefulCanvas.handleClick()
                    [c]EventHandler.bubbleEvent()
                    [c]EventHandler.handleClick()
                    EventHandler._handleMouseUp()
                    [c]EventHandler.handleMouseUp()
                    [c]EventHandler.dispatch()
                    anonymous()
                
                ISC_Core.js (Zeile 1076)
                
                ReferenceError: toolbarButton is not defined
                
                toolbarButton.setTitle("changed");


                This is the code I'm using to reproduce:
                Code:
                isc.Button.create({
                    "ID" : "a",
                    "click" : function () {
                        toolbarButton.setTitle("changed");
                    },
                    "title" : "Set Title",
                });
                isc.Button.create({
                    "ID" : "b",
                    left : 100,
                    "click" : function () {
                        myToolbar.show();
                    },
                    "title" : "show toolbar"
                });
                isc.DynamicForm.create({
                    "ID" : "form",
                    "width" : "100%",
                    top : 50,
                
                    "numCols" : 2,
                    "values" : {
                        "formField" : "this is a form"
                    },
                    "fields" :
                    [{
                            "ID" : "formField",
                            "name" : "formField",
                            "showTitle" : false
                        }, {
                            "ID" : "myToolbar",
                            "name" : "myToolbar",
                            "type" : "toolbar",
                            "createButtonsOnInit" : true,
                            "width" : 200,
                            "visible" : false,
                            "buttons" :
                            [{
                                    "ID" : "toolbarButton",
                                    "click" : function (p1, p2) {},
                                    "name" : "toolbarButton",
                                    "type" : "button",
                                }
                            ]
                        }
                    ]
                });

                Comment


                  #9
                  The new attribute exists on Toolbar, but this code sets it on a ToolbarItem - we've added passthrough createButtonsOnInit to ToolbarItem - please retest with tomorrow's build.

                  Comment


                    #10
                    Thanks,
                    It's fixed in the ToolbarItem that was given in the first post in the current version (SmartClient_v101p_2016-02-03_Pro).

                    Comment

                    Working...
                    X