Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8228857
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T16:36:14+00:00 2026-06-07T16:36:14+00:00

I have on my page header a preference link which open a modal window

  • 0

I have on my page header a preference link which open a modal window (it’s for modifying user preferences like name or password).

On cancel button I close this window, but when I tried to reopened it I have this JS error :

el.addCls.apply(el, arguments);

Is I use the good way to close this window or is the problem is elsewhere ?

Here is my code :

// My window definition
Ext.define('jnotes.window.UserPreferences', {
    extend: 'Ext.window.Window',
    layout: 'fit',
    modal: true,
    renderTo: Ext.getBody(),
    title: "<s:text name='user.preferences' />",
    items: new Ext.form.Panel({
        bodyPadding: 5,
        waitMsgTarget: true,
        method: 'POST',

        fieldDefaults: {
            labelAlign: 'right',
            labelWidth: 85,
            msgTarget: 'side'
        },
        defaultType: 'textfield',
        items: [{
            ... // my fields
        }],
        buttons: [{
            text: "<s:text name='action.save'/>",
            handler: function() {
                this.up('form').fireEvent('validate');
            },
        }, {
            text: "<s:text name='action.cancel'/>",
            handler: function() {
                this.up('form').fireEvent('cancel');
            }
        }]
    })
});

var preferencesWindow = null;

// Open my window
function displayPreferences() {
    preferencesWindow = Ext.create('jnotes.window.UserPreferences');
    var form = preferencesWindow.down('form');
    form.addListener('validate', this.saveUser, this);
    form.addListener('cancel', function() {
        preferencesWindow.close();
        preferencesWindow = null;
    }, this);
    form.load({
        ... // Loading data
    });
    preferencesWindow.show();
};
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T16:36:17+00:00Added an answer on June 7, 2026 at 4:36 pm

    The way you’ve defined your class, the form is created and shared across all instances of the class. When you destroy the window the first time, the form gets destroyed along with it and that’s the end of it.

    Instead, you should either:
    a) Specify a form configuration object:

    items: {
        xtype: 'form',
        // ....
    }
    

    b) Specify the form in the initComponent method so it’s bound to that instance:

    Ext.define('MyFoo', {
        initComponent: function(){
            this.items = new Ext.form.Panel(...);
            this.callParent();
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following jQuery code: $(body.page-calendar-practices-2012-05 #content-header h1#title) which works fine. I can
Have a look at the test-case When you open the link, pagebeforeshow for page
I have a page with header,content and footer. Issue i'm facing with the page
I have a master page with Header, Menu, Content and Footer panes in my
Imagine I have a navigation bar in my page header, with a number of
we have a Tiles layout page having Header, Menu, Body and Footer. In this
I have a page that consists of a header div for navigation, a content
In the header of my page I have a conditional statement to check if
I have my index.php page and just afrer my header i want to include
I have a file called header.php that I am including on every page on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.