PDA

View Full Version : [SOLVED]FormPanel Combo not populated



maquejp
1 Dec 2009, 6:27 AM
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?




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');

maquejp
1 Dec 2009, 7:01 AM
I tried this code after the ds_cbopeningcommittee.load()

alert(ds_cbopeningcommittee.getCount());
It return 0 ...
But I have record in my XML ...

maquejp
1 Dec 2009, 7:03 AM
I try alert(ds_cbopeningcommittee.getCount()); after the ds_cbopeningcommittee.load();
It return 0

here is the beginning of my XML

<?xml version="1.0" encoding="UTF-8"?>
<ROOT>

<item>
<recordcount>11</recordcount>

<ALIAS><![CDATA[ADMSCREEN]]></ALIAS>

<FULLNAME><![CDATA[ADMSCREEN ADMSCREEN]]></FULLNAME>

</item>
...

maquejp
1 Dec 2009, 7:16 AM
I change to this

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


<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

<cfcontent type="text/xml;charset=utf-8">