Results 1 to 7 of 7

Thread: MessageBox in tab throws error it tabs are changed

  1. #1
    Sencha User metalinspired's Avatar
    Join Date
    Apr 2012
    Posts
    98
    Answers
    4

    Default MessageBox in tab throws error it tabs are changed

    Hi,

    I'm building an application which extensively uses tabs. An user can have active windows in any of created tabs and they hide and show, as expected, when tabs are changed. However, if I add a MessageBox to one of the tabs, lets say, as confirmation dialog for deleting an record and then change to a different tab and back to the tab with MessageBox in it I get "Cannot read property 'cls' of undefined" error. I figure it gets thrown because changing back to tab with MessageBox will call MessageBox show() method which expects config object to be passed but in this case it doesn't.

  2. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,448
    Answers
    3997

    Default

    Ext.Msg is a global singelton so it shouldn't be added to a single tab. If you want different ones per tab then you need to create your own instead of using the global
    Mitchell Simoens @LikelyMitch

    Check out my GitHub:
    https://github.com/mitchellsimoens

    Posts are my own, not any current, past or future employer's.

  3. #3
    Sencha Premium User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,256
    Answers
    759

    Default

    This was a known issue in 4.1.x, it should be resolved in 4.2.0.
    Twitter - @evantrimboli
    Former Sencha framework engineer, available for consulting.
    As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.

  4. #4
    Sencha User metalinspired's Avatar
    Join Date
    Apr 2012
    Posts
    98
    Answers
    4

    Default

    Quote Originally Posted by mitchellsimoens View Post
    Ext.Msg is a global singelton so it shouldn't be added to a single tab. If you want different ones per tab then you need to create your own instead of using the global
    I figured that is the case but isn't that limiting the use of MessageBox?
    Also evant's statement is contradictory to yours.

  5. #5
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,448
    Answers
    3997

    Default

    You can create your own Ext.window.MessageBox instance but if you are using Ext.Msg then it's a singleton. There are often 2 answers: what technically works and what is suggested.
    Mitchell Simoens @LikelyMitch

    Check out my GitHub:
    https://github.com/mitchellsimoens

    Posts are my own, not any current, past or future employer's.

  6. #6
    Sencha User metalinspired's Avatar
    Join Date
    Apr 2012
    Posts
    98
    Answers
    4

    Default

    I did create an instance of Ext.window.MessageBox.
    If I pass configuration object inside Ext.create() statement when creating MessageBox instance it will throw an error as soon as show() is called, and if I create it without configuration but pass it inside show() it will work but will throw an error upon returning to tab that MessageBox was added to.

  7. #7
    Sencha User metalinspired's Avatar
    Join Date
    Apr 2012
    Posts
    98
    Answers
    4

    Default

    Sorry to bump the thread but I really need help with this.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •