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

  • SEARCH
  • Home
  • 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 7757691
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T13:09:36+00:00 2026-06-01T13:09:36+00:00

I have two dropdowns in extjs,based on the first dropdwon,the second dropdown populates.This is

  • 0

I have two dropdowns in extjs,based on the first dropdwon,the second dropdown populates.This is working fine and i am able to pass the values to springMVC,but problem comes when i have to hide/unhide the textfields based on the second dropdown,hiding/unhiding works fine,but i am unable to pass the parametrs to SpringMVC.
Here is my .js files.
Could anybody tell where i have to correct,

Ext.Loader.setConfig({
enabled: true
});
Ext.require(['*']);

var country = Ext.create('Ext.data.Store', {
fields: ['abbr', 'name'],
data: [{
    "abbr": "USA",
    "name": "USA"
}, {
    "abbr": "UK",
    "name": "UK"
},


]
});

var states = Ext.create('Ext.data.Store', {
fields: ['id', 'abbr', 'name'],
data: [{
    "id": "New York",
    "abbr": "USA",
    "name": "New York"
}, {
    "id": "New Jersey",
    "abbr": "USA",
    "name": "New Jersey"
}, {
    "id": "London",
    "abbr": "UK",
    "name": "London"
}, {
    "id": "Hampshire",
    "abbr": "UK",
    "name": "Hampshire"
}]
});
Ext.define('App.view.countryPanel', {
extend: 'Ext.form.Panel',
alias: 'widget.CountryPanel',
id: 'countrypanel',


title: 'Country',
frame: true,
width: 400,
fieldDefaults: {
    labelWidth: 200
},
bodyPadding: '15 16 10',

height: 200,
id: 'countrypanel',

method: 'POST',




items: [



{
    xtype: 'combo',
    id: 'con',
    name: 'con',
    fieldLabel: 'Country',
    displayField: 'name',

    emptyText: 'Select a Country',
    valueField: 'abbr',
    store: country,
    listeners: {
        'select': {
            fn: function (combo, value) {

                var comboState = Ext.getCmp('statelist');
                comboState.bindStore(states);
                comboState.clearValue();
                comboState.store.filter('abbr', combo.getValue());

                states = Ext.create('Ext.data.Store', {
                    fields: ['id', 'abbr', 'name'],
                    data: [{
                        "id": "New York",
                        "abbr": "USA",
                        "name": "New York"
                    }, {
                        "id": "New Jersey",
                        "abbr": "USA",
                        "name": "New Jersey"
                    }, {
                        "id": "London",
                        "abbr": "UK",
                        "name": "London"
                    }, {
                        "id": "Hampshire",
                        "abbr": "UK",
                        "name": "Hampshire"
                    }]
                });



            }
        }
    }
}, {
    xtype: 'combo',
    id: 'statelist',
    name: 'statelist',
    fieldLabel: 'Stated',
    displayField: 'name',
    emptyText: 'Select states',
    valueField: 'id',
    store: states,
    listeners: {
        'select': {
            fn: function (combo, value) {
                var sample = combo.getValue();




                if (sample == 'London') {


                    Ext.getCmp('Tower').getEl().show();


                } else {

                    Ext.getCmp('Tower').getEl().hide();
                    Ext.getCmp('Liberty').getEl().show();

                }


                var comboState = Ext.getCmp('statelist');
                comboState.bindStore(states);
                comboState.clearValue();
                comboState.store.filter('abbr', combo.getValue());



            }
        }
    }
}, {
    xtype: 'textfield',
    id: 'Tower',
    name: 'Tower',
    fieldLabel: 'ClockTower',
    hidden: true,

    allowBlank: false

}, {
    xtype: 'textfield',
    id: 'Liberty',
    name: 'Liberty',
    fieldLabel: 'Liberty',
    hidden: true,
    minWidth: 20,
    allowBlank: false

}],
buttonAlign: 'center',
buttons: [

{
    text: 'Submit',
    handler: function () {

        var sspanel = Ext.getCmp('countrypanel');
        var form = sspanel.getForm();


        form.submit({


            url: 'country.htm',


            success: function (form, action) {


                Ext.Msg.alert('Success');




            },

            failure: function (form, action) {

                Ext.Msg.alert('failure');
            }



        });


    }

},

{

    text: 'Reset',
    handler: function () {
        var sspanel = Ext.getCmp('countrypanel');
        var form = sspanel.getForm();
        form.reset();
    }
}

]

});
  • 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-01T13:09:37+00:00Added an answer on June 1, 2026 at 1:09 pm

    Try to use the hideMode config option for text fields:

    {
        xtype: 'textfield',
        id: 'Liberty',
        name: 'Liberty',
        fieldLabel: 'Liberty',
        hidden: true,
        hideMode: 'visibility', // you may also use 'offsets' 
        minWidth: 20,
        allowBlank: false
    }
    

    In this case the fields’ values will be passed as parameters.

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

Sidebar

Related Questions

I have two dropdowns in html. Both dropdowns are getting data mysql first dropdown
I have two dropdowns and I want the second dropdown to get populated on
Am I doing this correctly? I have two dropdowns. The first is populated on
I have two dropdowns. I want to populate the second dropdown on selection of
I have created a populated dropdown list in HTML. When the two dropdowns have
i have two dropdown list. first drop down:1 enter code here <form:select path=custName id=custName>
I have two dropdowns in my form. The first one Queries for a set
I have two dropdowns. When a user selects a value from the first one
I have two related dropdowns. When the user selects an option from the first
This problem only occurs in Internet Explorer 8 & 9 I have two dropdowns

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.