Results 1 to 4 of 4

Thread: [SOLVED]FormPanel Combo not populated

  1. #1
    Sencha Premium User
    Join Date
    Jun 2008
    Location
    Belgium
    Posts
    265

    Default [SOLVED]FormPanel Combo not populated

    Hi!
    Does any body see what is wrong with my code? The ComboBox is not populated.
    My response is a well formed XML, No firebux errors.
    Is it due to the card layout?


    Code:
    var ds_cbopeningcommittee = new Ext.data.Store({
        proxy: new Ext.data.HttpProxy({
            url: 'cfm/2010/conference/get_omc_list.cfm',
            method: 'GET'
        }),
        reader: new Ext.data.XmlReader({
            record: 'item'
        }, ['ALIAS', 'FULLNAME'])
    });
    cb_openingcommittee_conf = new Ext.form.ComboBox({
        id: 'cb_openingcommittee_conf',
        store: ds_cbopeningcommittee,
        displayField: 'FULLNAME',
        valueField: 'ALIAS',
        fieldLabel: 'Opening Committee member',
        typeAhead: true,
        triggerAction: 'all',
        emptyText: 'Select a Opening Committee member...',
        selectOnFocus: true,
        allowBlank: false,
        editable: false,
        mode: 'local',
        hiddenName: 'frmopencommember_conf',
        listWidth: 220,
        width: 220
    })
    var fp_screening_conf = new Ext.FormPanel({
        id: 'fp_screening_conf',
        title: 'Screening Conference 2k9',
        frame: true,
        layout: 'form',
        labelWidth: 200,
        labelAlign: 'left',
        labelSeparator: ' ',
        autoScroll: true,
        autoWidth: true,
        autoHeight: true,
        items: [{
            layout: 'table',
            layoutConfig: {
                columns: 1
            },
            title: 'Conference Information',
            items: [{
                layout: 'form',
                labelSeparator: ' ',
                width: 550,
                items: [{
                    xtype: 'numberfield',
                    fieldLabel: 'Adonis',
                    id: 'frmadonis_conf',
                    name: 'frmadonis_conf',
                    allowBlank: false,
                    readOnly: true,
                    minLength: 6,
                    maxLength: 7,
                    width: 60
                }, cb_openingcommittee_conf]
            }]
        }]
    });
    Ext.namespace('eahc.grantevaluation');
    Ext.override(Ext.form.Field, {setFieldLabel: function(text){Ext.fly(this.el.dom.parentNode.previousSibling).update(text);}});
    Ext.onReady(function(){
        Ext.QuickTips.init();
    ....
       var p_bodycenter = new Ext.Panel({id: 'p_bodycenter',layout:'card',region : 'center',loadMask: true,border: false,frame: true,loadMask: true,autoScroll: true});
    ...
    			if (n.id == 'screeningform') {				
    				p_bodycenter.getLayout().setActiveItem('fp_screening_conf');
    				ds_cbopeningcommittee.load();
    			}
    ....
    	p_bodycenter.add(fp_screening_conf);
    	var vp_bodyviewport = new Ext.Viewport({id : 'VP_BodyViewPort',layout : 'border',frame:true,border : true,items:[p_bodyright,p_bodycenter],renderTo:'container'});
    	p_bodycenter.getLayout().setActiveItem('fp_login');

  2. #2
    Sencha Premium User
    Join Date
    Jun 2008
    Location
    Belgium
    Posts
    265

    Default

    I tried this code after the ds_cbopeningcommittee.load()
    Code:
    alert(ds_cbopeningcommittee.getCount());
    It return 0 ...
    But I have record in my XML ...

  3. #3
    Sencha Premium User
    Join Date
    Jun 2008
    Location
    Belgium
    Posts
    265

    Default

    I try alert(ds_cbopeningcommittee.getCount()); after the ds_cbopeningcommittee.load();
    It return 0

    here is the beginning of my XML
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <ROOT>
    				
    					<item>
    						<recordcount>11</recordcount>
    						
    							<ALIAS><![CDATA[ADMSCREEN]]></ALIAS>
    						
    							<FULLNAME><![CDATA[ADMSCREEN ADMSCREEN]]></FULLNAME>
    						
    					</item>
    ...

  4. #4
    Sencha Premium User
    Join Date
    Jun 2008
    Location
    Belgium
    Posts
    265

    Thumbs up

    I change to this
    Code:
    var ds_cbopeningcommittee = new Ext.data.XmlStore({
    	autoDestroy:true,
    	url:'cfm/2010/conference/get_omc_list.cfm',
    	record:'item',
    	totalRecords:'recordcount',
    	fields:['ALIAS', 'FULLNAME']
    });
    cb_openingcommittee_conf = new Ext.form.ComboBox({
        id: 'cb_openingcommittee_conf',
        store: ds_cbopeningcommittee,
        displayField: 'FULLNAME',
        valueField: 'ALIAS',
        fieldLabel: 'Opening Committee member',    
        emptyText: 'Select a Opening Committee member...',
    	hiddenName: 'frmopencommember_conf',
        typeAhead: true,triggerAction: 'all',selectOnFocus: true,allowBlank: false,editable: false,mode: 'local',    
        listWidth: 220, width: 220
    });
    and

    Code:
    	<cffunction name="get_omc_list" returntype="xml" output="false">
    		<cfquery datasource="#application.DSN_CFPBO#" name="queryGetOmcList">
    			SELECT lastname || ' '||firstname FULLNAME, UNIKID ALIAS
    			FROM app_grant09.app_staff
    			where visibility = 1 and function = 'SCREEN'
    			order by lastname
    		</cfquery>
    		<cfset t = application.cfc_generic.convert_xml(queryGetOmcList)>
    		<cfreturn t>
    	</cffunction>
    In the CFFUNCTION the ALIAS was Alias ...
    and forced the content type
    Code:
    <cfcontent type="text/xml;charset=utf-8">

Posting Permissions

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