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 7599681
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T22:43:23+00:00 2026-05-30T22:43:23+00:00

I have an extjs2 formpanel: var fsf = new Ext.FormPanel({ labelWidth: 75, // label

  • 0

I have an extjs2 formpanel:

   var fsf = new Ext.FormPanel({
        labelWidth: 75, // label settings here cascade unless overridden
        frame:true,
        id: 'formPanel',
        title: 'Simple Form with FieldSets',
        bodyStyle:'padding:5px 5px 0',
        width: 550,

        items: [{
            xtype:'fieldset',
            checkboxToggle:true,
            title: 'User Information',
            autoHeight:true,
            defaults: {width: 210},
            defaultType: 'textfield',
            collapsed: true,
            items :[{
                    fieldLabel: 'First Name',
                    name: 'first',
                    allowBlank:false
                },{
                    fieldLabel: 'Last Name',
                    name: 'last'
                },{
                    fieldLabel: 'Company',
                    name: 'company'
                }, {
                    fieldLabel: 'Email',
                    name: 'email',
                    vtype:'email'
                }
            ]
        },{
            xtype:'fieldset',
            title: 'Phone Number',
            collapsible: true,
            autoHeight:true,
            defaults: {width: 210},
            defaultType: 'textfield',
            items :[{
                    fieldLabel: 'Home',
                    name: 'home',
                    value: '(888) 555-1212'
                },{
                    fieldLabel: 'Business',
                    name: 'business'
                },{
                    fieldLabel: 'Mobile',
                    name: 'mobile'
                },{
                    fieldLabel: 'Fax',
                    name: 'fax'
                }
            ]
        }],

        buttons: [{
            text: 'Save',
            handler: function(){
                var form = Ext.getCmp('formPanel').getForm();
                if(form.isValid())
                    form.submit({
                        waitMsg:'Loading...',
                        url: 'RepeatSession.jsp',
                        success: function(form,action) {
                            //we have to close the window here!!
                        },
                        failure: function(form,action){
                            Ext.MessageBox.alert('Erro',action.result.data.msg);
                        }
                    });
            }
        },{
            text: 'Cancel'
        }]
    });

and a window:

 win = new Ext.Window(
            {
                layout: 'fit',
                width: 500,
                height: 300,
                modal: true,
                closeAction: 'hide',
                items: fsf
            });
     win.show();

As you can see, the form panel is inside the window as an item. I have to close the window after a successful form submission but I have no idea how to access the window object inside my success handler.

How can i hide the window after successful form submission?

  • 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-05-30T22:43:24+00:00Added an answer on May 30, 2026 at 10:43 pm

    Just save a reference to the window or one of its children before creating the form. For example you can use the button paremeter that the handler function gets passed:

            handler: function(button, e){
    

    […]

                        success: function(form,action) {
                            button.up('.window').close();
                        },
    

    Or, as you apparently already have the window in a variable (win), you can just use that to close the window:

    win.close();
    

    but that depends on the variable win being available inside the success function, which we cannot assume from the code you gave.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an ExtJS grid like so: var grid = new Ext.grid.GridPanel({ ... });
I have a GridPanel in EXTJS4 with JSONstore. Like this: var storeGridSpe = Ext.create('Ext.data.JsonStore',{
following extjs3 problem: i have an json store: dbStore = new Ext.data.JsonStore({ url: '/?[action]=getFormData',
I have a ExtJS grid with the following: // Initialize the state manager Ext.state.Manager.setProvider(new
I have an extjs component in its raw object type, for example: var x
ExtJS has Ext.each() function, but is there a map() also hidden somewhere? I have
How do you implement a multiselect combobox as part of a Ext.FormPanel using ExtJs?
Inside my extjs FormPanel , I have several editor grids. I don't know what
I'm using ExtJS 3. I have a formPanel with many cloned fields and I
I am using ExtJS 3 here. I would like to populate a formpanel from

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.