Results 1 to 3 of 3

Thread: FormField / Element ID as msgTarget / MSIE

  1. #1
    Sencha Premium User
    Join Date
    Apr 2007
    Location
    Vienna, Austria
    Posts
    59

    Question FormField / Element ID as msgTarget / MSIE

    Hi,

    setting a form field's message target to an element ID seems to cause problems with MSIE:

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
                          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
        <head>
            <title>Ext JS Form Test 2</title>
            <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
            <style type="text/css" media="all">
                @import '../resources/css/ext-all.css';
                @import '../resources/css/xtheme-gray.css';
            </style>   
            <script type="text/javascript" src="../adapter/ext/ext-base.js"></script>
            <script type="text/javascript" src="../ext-all.js"></script>
            <script type="text/javascript">
    Ext.BLANK_IMAGE_URL = '../resources/images/default/s.gif';
    Ext.namespace('Ext.Example');
       
    Ext.Example.MsgTarget = function() {
    
        // private variables ------------------------------------------------------
        // private functions ------------------------------------------------------
        
    
        var buildFormPanel = function() {
        
            var simple = new Ext.FormPanel(
            	{
    		        labelWidth: 75, // label settings here cascade unless overridden
    		        frame:true,
    		        title: 'Simple Form',
    		        bodyStyle:'padding:5px 5px 0',
    		        width: 300,
    		        defaults: {width: 230},
                    
    		        items: [
    		        	{
    		                fieldLabel: 'First Name',
    		                xtype: 'textfield',
    		                name: 'first',
    						allowBlank: false,
    		                blankText: 'Please enter a first name',
    		                msgTarget: 'error-message'
    								                
    		            },
    		            {
    		                fieldLabel: 'Last Name',
    		                xtype: 'textfield',
    		                name: 'last',
    						allowBlank: false,
    		                blankText: 'Please enter a last name',
    		                msgTarget: 'error-message'
    		            },
    		            {
    		            	html: '<div id="error-message"></div>'
    		            }
    		        ]
    	    	}
    	    );    
    
            simple.render(Ext.get('main-form'));
        };
        
        // public interface -------------------------------------------------------
            
        return {
            /**  */
            init :  function() {
                Ext.QuickTips.init();
                buildFormPanel();
            }
    
        }
    }();
    
    Ext.EventManager.addListener(window, 'load', Ext.Example.MsgTarget.init);
            </script>
        </head>
        <body>
            <div id="main-form"></div>
        </body>
    </html>
    I think it's not MSIE's fault, but line 25517 in ext-all-debug.js

    Code:
    t.style.display = this.msgDisplay;
    I cannot find the property msgDisplay anywhere else in the code. Could this be a bug?

    Regards,
    Horst

  2. #2
    Sencha User
    Join Date
    Mar 2007
    Posts
    7,854

    Default

    It does look like something is missing there. Does it work if you add
    msgDisplay:'block' to the field config?

  3. #3
    Sencha Premium User
    Join Date
    Apr 2007
    Location
    Vienna, Austria
    Posts
    59

    Smile

    Hi,

    thanks for the quick reply!

    It does look like something is missing there. Does it work if you add
    msgDisplay:'block' to the field config?
    Yes it does. If I add msgDisplay like this

    Code:
    {
        fieldLabel: 'First Name',
        xtype: 'textfield',
        name: 'first',
    	allowBlank: false,
        blankText: 'Please enter a first name',
        msgTarget: 'error-message',
        msgDisplay: 'block' 
    },
    MSIE stops complaining.

    Does anyone know what this mysterious undocumented config option does? And of course now I also found additional posts mentioning this problem which I couldn't find before I posted. I still think it's a bug, though.

Posting Permissions

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