1. #1
    Ext User
    Join Date
    Jan 2008
    Posts
    47
    Vote Rating
    0
    webdings is on a distinguished road

      0  

    Default this.el has no properties error message

    this.el has no properties error message


    I want to use ExtJS to check the form variant, and the form id within my frontend page is regform, like that....
    JSP code
    Code:
    ........
    	<script type="text/javascript" src="../extbase/checkform.js"></script>
    ........
          <form method="post" action="" id="regform">
          <table width="400"  border="0" cellpadding="0" cellspacing="0" class="formLook">
            <tr class="formbar">
              <td>Administrator Login </td>
            </tr>
            <tr>
              <td><table width="100%"  border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td width="100">&nbsp;</td>
                    <td>&nbsp;</td>
                  </tr>
                  <tr>
                    <td width="100"><div align="right">Login Name:</div></td>
                    <td><input name="adminName" type="text" id="adminName"></td>
                  </tr>
                  <tr>
                    <td width="100"><div align="right">Password:</div></td>
                    <td><input name="password" type="password" id="password"></td>
                  </tr>
                  <tr>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                  </tr>
                  <tr>
                    <td width="100">&nbsp;</td>
                    <td><div id="regbutton"></div></td>
                  </tr>
                  <tr>
                    <td width="100">&nbsp;</td>
                    <td>&nbsp;</td>
                  </tr>
              </table></td>
            </tr>
          </table>
          </form>
    checkform.js
    Code:
    	var fm2 = new Ext.form.BasicForm('regform');    
    	fm2.add(new Ext.form.TextField({
    		allowBlank: false,
    		blankText:'Login Name could not empty'
    	}).applyTo('adminName'));
    	fm2.add(new Ext.form.TextField({
    		allowBlank: false,
    		blankText:'Password could not empty'
    	}).applyTo(Ext.get('password')));
    				
    	Ext.get('regform').un("submit", fm2.onSubmit, fm2);
                  var regButton = new Ext.Button('regbutton', {
                  text: 'Login', 
                          handler: function(){
                            if (fm2.isValid()) {
                              Ext.Msg.show({
                               title:'Confirmation',
                               modal : false,
                               msg: 'All data are right?',
                               buttons: Ext.Msg.OKCANCEL,
                               fn:  function(btn, text){
                                    if (btn == 'ok'){
                                        fm2.submit({
                                            url: 'Register.htm',
                                            params: {
                                            oper: 'submit'
                                            },
                                            msgethod: 'POST',
                                            waitMsg:'Please wait....'
                                            });
                                    } 
                                },
                               animEl: 'regbutton'
                            }).getDialog().moveTo(200, 100);
                            } else {
                                Ext.Msg.show({
                               title:'System Message',
                               msg: 'Please fill in all field',
                               modal : false,
                               buttons: Ext.Msg.OK
                                }).getDialog().moveTo(200, 100);
                            }
                          } 
                    });
                    fm2.on({
                        beforeaction: function(form, action){
                            regButton.disable();
                        },
                        actioncomplete: function(form, action){            
                            if(action.type == 'submit'){
                                regButton.enable();
                              }        
                            if(action.result.success){
                            Cookies.set('Allcard_userName', Ext.get('CustomerName').dom.value);
                            Ext.Msg.show({
                               title:'Success',
                               msg: 'Login Success',
                               modal : false,
                               fn: showResult,
                               buttons: Ext.Msg.OK
                            }).getDialog().moveTo(200, 100);    
                            }
                            else{
                            Ext.Msg.show({
                               title:'Alert',
                               msg: 'Login Fail',
                               modal : false,
                               buttons: Ext.Msg.OK
                            }).getDialog().moveTo(200, 100);
                            }            
                        },
                        actionfailed: function(form, action){
                            regButton.enable();
                        }
    	});
    Those code are reference from another web site, but buttons cannot show, also an error message show in firebugs panel as below.....
    Code:
    this.el has no properties
    BasicForm("regform")ext-all.js (line 133)
    BasicForm("regform", undefined)ext-all.js (line 133)
    [Break on this error] Ext.form.BasicForm=function(B,A){Ext.apply(this,A);this.items=new Ext.util.Mixed...
    I'd search information about the error message within ExtJS forum..... but just can found something about "bugs", can someone help me......? Thank you!
    I LOVE EXTJS

  2. #2
    Ext User
    Join Date
    Jan 2008
    Posts
    47
    Vote Rating
    0
    webdings is on a distinguished road

      0  

    Default


    Someone help me? I'd stack at here for few days..........
    I LOVE EXTJS

  3. #3

  4. #4
    Ext User
    Join Date
    Jan 2008
    Posts
    39
    Vote Rating
    0
    GTCulbreth is on a distinguished road

      0  

    Default


    I don't know if this is it but look at this line

    Ext.get('regform').un("submit", fm2.onSubmit, fm2);

    Should this be .on

  5. #5
    Ext User
    Join Date
    Aug 2007
    Posts
    24
    Vote Rating
    0
    dhanek is on a distinguished road

      0  

    Default


    Hi , In most cases this type of error is because of DIV or element, I guess.

    var fm2 = new Ext.form.BasicForm('regform');

    I think it is somethin wrong with 'regform'

  6. #6
    Ext User
    Join Date
    Jan 2008
    Posts
    47
    Vote Rating
    0
    webdings is on a distinguished road

      0  

    Default


    Thanks for all

    But I still cannot solve the problem, I'd ask the same question in a chinese blog, they reply me as something like....
    The return of add method, there is no applyTo method, put the applyTo into the textfield, then the problem will solve.....

    I don't know the actual meaning, would someone tell me? Here is the linking, may one need to know chinese little bit.....
    http://www.cnblogs.com/winsonet/arch...30/942530.html
    I LOVE EXTJS

  7. #7
    Ext User
    Join Date
    Jul 2007
    Location
    Florida
    Posts
    9,996
    Vote Rating
    5
    mjlecomte will become famous soon enough mjlecomte will become famous soon enough

      0  

    Default


    you reference ext-all instead of ext-all-debug.js

    The debug version is formatted better for debugging purposes while you are in development. Suggest you use that version so you can debug easier.

    You did not acknowledge if you read the FAQ on this topic.

    Also, what version of Ext are you using? If this is a new project you should be using Ext2, you posted in Ext1 forum.

    Check your version by going to firebug console and typing at the >>>
    Ext.version
    then hit enter

  8. #8
    Ext User
    Join Date
    Jan 2008
    Posts
    47
    Vote Rating
    0
    webdings is on a distinguished road

      0  

    Default


    yup, I think I really post at wrong Version forum............... sorry at all
    I LOVE EXTJS