1. #1
    Ext User
    Join Date
    Dec 2008
    Posts
    7
    Vote Rating
    0
    hypermo is on a distinguished road

      0  

    Default ComboBox Select

    ComboBox Select


    Hi,

    i searched the forums, read the posts, tried the solutions suggested, but nothing seems to
    work so this is the reason for this repost.

    This is regarding the ComboBox selection issues in Adobe AIR,


    The combo box renders ok, but i can't click any of the items, it wont select anything.
    the code works fine in a regular browser.
    Did i miss anything in the code below? or overlooked some detail?

    however i tried everything and can't seem to get it to work.


    Thanks
    mo


    Aptana 1.2.4
    Adobe AIR 1.5
    EXTJS 2.2

    Code:
    <html>
        <head>
            <title>Two security sandboxes sample</title>
            <script type="text/javascript" src="lib/air/AIRAliases.js">
            </script>
            <link rel="stylesheet" type="text/css" href="lib/ext/resources/css/ext-all.css" />
            <script type="text/javascript" src="lib/ext/adapter/ext/ext-base.js">
            </script>
            <script type="text/javascript" src="lib/ext/ext-all-debug.js">
            </script>
            <script type="text/javascript">
                // AIR-related functions created by the developer
                
                var tplNavigation = new Ext.XTemplate('<tpl for="."><div class="x-combo-list-item">{name}</div></tpl>');
                
                // simple array store
                var store = new Ext.data.SimpleStore({
                    fields: ['url', 'name'],
                    data: [["Main.html", "Main"], ["page1.html", "Pagee 1"], ["page2.html", "Page 2"], ["page3.html", "Page 3"]]
                });
                
                
                
                
                function CreateCombo(){
                
                    var comboNavigation = new Ext.form.ComboBox({
                        store: store,
                        tpl: tplNavigation,
                        displayField: 'name',
                        valueField: 'url',
                        typeAhead: true,
                        triggerAction: 'all',
                        renderTo: 'divCombo',
                        allowBlank: false,
                        selectOnFocus: true,
                        forceSelection: true,
                        mode: 'local',
                        listeners: {
                            "select": function(){
                                alert('test');
                            }
                        }
                    
                    });
                    
                }
            </script>
        </head>
        <body onload="CreateCombo()">
            <div id="divCombo">
            </div>
        </body>
    </html>

  2. #2
    Ext User
    Join Date
    Nov 2007
    Posts
    102
    Vote Rating
    0
    RobSmith is on a distinguished road

      0  

    Default


    I copied your code and ran it successfully. Everthing works fine. The only thing, I let out was the renderTo config option. I had the same conditions here (Aptana, Adobe AIR, ExtJS 2.2). The combobox code is correct, so the problem must be somewhere else. You may try using the Ext.onReady event instead of body.onLoad.

  3. #3
    Ext User
    Join Date
    Dec 2008
    Posts
    7
    Vote Rating
    0
    hypermo is on a distinguished road

      0  

    Default


    Quote Originally Posted by RobSmith View Post
    I copied your code and ran it successfully. Everthing works fine. The only thing, I let out was the renderTo config option. I had the same conditions here (Aptana, Adobe AIR, ExtJS 2.2). The combobox code is correct, so the problem must be somewhere else. You may try using the Ext.onReady event instead of body.onLoad.

    Hi, thanks for looking at this and the help,

    was there any project settings that might have differed.

    choices in creating an application sandbox or not,
    which JS files to include, or whether you used my page as is, on some posts i saw an ext-air.js file as well.


    thanks
    mo

  4. #4
    Ext User
    Join Date
    Dec 2008
    Posts
    7
    Vote Rating
    0
    hypermo is on a distinguished road

      0  

    Thumbs up


    solved, all i missed was this line,

    try it out sometimes, remove it and see what happens to your combo box
    thanks for the help.


    <script type="text/javascript" src="ext-air/ext-air.js"></script>

Thread Participants: 1