1. #1
    Ext JS Premium Member
    Join Date
    Feb 2010
    Posts
    14
    Vote Rating
    1
    mhaddy is on a distinguished road

      0  

    Default Hidden form field

    Hidden form field


    If a form field is hidden

    Code:
    {
      xtype:'hidden',
       name:'UserID'
    }
    
    an exception is thrown:
    maxLength is not defined

    at
    Code:
    function f1(out,values,parent,xindex,xcount) {
    
     try { with(values) {
    
      return(maxLength !== undefined)
    
     }} catch(e) {}
    
    }

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    33,684
    Vote Rating
    435
    mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of

      0  

    Default


    When do you get the error? Just displaying is fine for me:

    Code:
    Ext.create('Ext.form.Panel', {
        renderTo : Ext.getBody(),
        width    : 400,
        height   : 400,
        title    : 'Test',
        items    : [
            {
                xtype : 'hidden',  //should use the more standard hiddenfield
                name  : 'text'
            }
        ]
    });
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    http://www.JSONPLint.com - Source to lint your JSONP!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Ext JS Premium Member
    Join Date
    Feb 2010
    Posts
    14
    Vote Rating
    1
    mhaddy is on a distinguished road

      0  

    Default hiddend form field

    hiddend form field


    Interesting. Your panel worked for me also. It seems to fail when wrapped in a window:

    Code:
    
    var dlPassChangeWin = Ext.create('Ext.window.Window', {
    
        width: 400,
    
        height: 400,
    
        title: 'Test',
    
        items: [
    
            {
                xtype: 'hidden',  //should use the more standard hiddenfield
                 name: 'text'
    
            }
    
        ]
    
    });
    
    dlPassChangeWin.show();
    
    

  4. #4
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    33,684
    Vote Rating
    435
    mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of

      0  

    Default


    And you are using 4.1 beta 1? I'm not getting any error using that code.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    http://www.JSONPLint.com - Source to lint your JSONP!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!

    When posting code, please use BBCode's CODE tags.

  5. #5
    Ext JS Premium Member
    Join Date
    Feb 2010
    Posts
    14
    Vote Rating
    1
    mhaddy is on a distinguished road

      0  

    Default


    Uhhg. I am. Unfortunately, all my forms are contained in windows and all that have hidden fields are throwing this error. I will try to isolate this outside my application.

  6. #6
    Ext JS Premium Member
    Join Date
    Feb 2010
    Posts
    14
    Vote Rating
    1
    mhaddy is on a distinguished road

      0  

    Default


    I have no problem getting this exception outside my application using the code above.

    Let me ask you this...
    The error is wrapped in a try/catch block. The settings I am using is to break on all exceptions (caught or not).

    Are you breaking only on uncaught exceptions or are you just not getting it at all?

  7. #7
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,458
    Vote Rating
    20
    Animal is a jewel in the rough Animal is a jewel in the rough Animal is a jewel in the rough

      0  

    Default


    It's a caught exception when testing the definedness of an optional value. Not a bug.

  8. #8
    Ext JS Premium Member
    Join Date
    Feb 2010
    Posts
    14
    Vote Rating
    1
    mhaddy is on a distinguished road

      0  

    Default


    Throwing an exception to test the definedness of an optional value sounds crazy to me - but I guess that is a topic better discussed elseware.

    Thanks for the info.