Results 1 to 2 of 2

Thread: Get value from ext.window

  1. #1
    Sencha User
    Join Date
    Dec 2010
    Vote Rating

    Default Get value from ext.window

    I am trying to retrieve the textfield 'remail' value using
    var pass = Ext.getCmp('win').getForm().findField('remail').getValue();

    But I get a error 'Ext.getCmp(...)' is null or not an object
    Please help me out.

    Here is my entire code.
    Thanks & regards

    <script language="javascript">
    Ext.onReady(function() {
    var myBtnresetHandler = function(btn) {
    var pass = Ext.getCmp('win').getForm().findField('remail').getValue();
    document.getElementById("hdnpassword").value = pass;;
    var win;
    var button = Ext.get('show-btn');

    button.on('click', function() {
    // create the window on the first click and reuse on subsequent clicks
    if (!win) {
    win = new Ext.Window({
    id: 'forgotPasswrdWin',
    title: 'Password Reset',
    closable: true,
    closeAction: 'hide',
    width: 490,
    autoHeight: true,
    bodyStyle: 'background-color:#FFF;padding:20px',
    items: [{
    xtype: 'panel',
    layout: 'table',
    unstyled: true,
    style: 'background-color:#FFF;',
    layoutConfig: {
    columns: 2
    defaults: {
    unstyled: true,
    padding: 5
    items: [{
    layout: 'form',
    anchor: '100%',
    items: [{
    fieldLabel: 'Email Address',
    id: 'remail',
    name: 'remail',
    xtype: 'textfield',
    width: 200
    }, {
    items: [{
    xtype: 'button',
    text: 'Reset Password',
    id: 'recover-btn',
    style: 'margin-top:-5px',
    handler: myBtnresetHandler


    <tr><td ><a class="linkHeaders" id="show-btn" herf="">Forgot your password?</a></td></tr>

  2. #2
    Ext JS Premium Member syscobra's Avatar
    Join Date
    Nov 2007
    Vote Rating


    I think you missed the Ext.getCmp point, you have to pass the id of the window... the call should be:

    Ext.getCmp('forgotPasswrdWin').getForm() ...

    If it doesn't work maybe is because you have a lot of panels in there so you should do something like:

    You have a var in memory called win so you can access that one too:


    Also, as you used an static id for the textfield you can ge4t the value from it too...

    Please take a look at Docs and read the options you have to pass to the functions...

    Also, you can see some screencasts from our friend Jay Garcia about the Problems of using Ext.getCmp()...

    You can get a good book to learn too. There are plenty of them out there. Online you can find Ext in Action from our friend Jay Garcia here:
    Javier Rincón aka SysCobra

Similar Threads

  1. Window hide then close vs window close... Problems re-opening the window.
    By zhegwood in forum Ext 3.x: Help & Discussion
    Replies: 7
    Last Post: 11 Jan 2010, 5:42 PM
  2. [FIXED] Window.setAutoHide() closes window on window moving
    By sorrro in forum Ext GWT: Bugs (2.x)
    Replies: 1
    Last Post: 6 Oct 2009, 6:50 AM
  3. [OPEN] [CLOSED] Window that opens child Window - Field loses focus immediately
    By jonjanisch in forum Ext GWT: Bugs (2.x)
    Replies: 3
    Last Post: 10 Sep 2009, 9:10 AM
  4. Modal window mask width problem - shows Hz scrollbar in parent window
    By satishp in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 27 May 2009, 11:46 PM
  5. Replies: 5
    Last Post: 23 Jul 2008, 8:49 AM

Posting Permissions

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