PDA

View Full Version : Help !!!!



captainm1uk
3 Dec 2007, 3:55 AM
Hi I have some script to populate 2 fields and get an error saying "AppUI is undefined" and haven't a clue - can somebody please help



Ext.onReady.createCallback(AppUI.init, AppUI, true));
Ext.onReady(
function() {
function mySelectionFunction(combo, record, index) {
var emailField = Ext.get('emailField');
var deptMgrField = Ext.get('DeptManager');
emailField.dom.value = record.get('email');
deptMgrField.dom.value = record.get('firstname') + ' ' +
record.get('lastname');
}
var cf = new JCW.Form.ComboBox(
'DeptManager',
'//myLastName', //the computed field is names.nsf
{ tpl: [ '<div class="search-item">','<span>{LastName}</span><br/>{FirstName}','</div>'], forceSelection : true}
);
cf.comboField.on('select', mySelectionFunction);
});

jratcliff
3 Dec 2007, 7:10 AM
On your first line you have:


Ext.onReady.createCallback(AppUI.init, AppUI, true));

But where is "AppUI" defined? I don't see it in your code snippet.

captainm1uk
3 Dec 2007, 7:28 AM
That is what I don't understand. Zakaroonikov game this code and what it is supposed to do is do a live search to the address book and when you press a name, it populates the email field with their email address aswell as populating the DeptManager field with the name you have just selected

jratcliff
3 Dec 2007, 8:20 AM
Ok then. We'll just have to see what Zakaroonikov says since I'm not familiar with this code..

Zakaroonikov
3 Dec 2007, 1:11 PM
That is what I don't understand. Zakaroonikov game this code and what it is supposed to do is do a live search to the address book and when you press a name, it populates the email field with their email address aswell as populating the DeptManager field with the name you have just selected

I just added some extra code to what you gave me. Comment out the problematic line and see if that fixes it.



Ext.onReady.createCallback(AppUI.init, AppUI, true));

captainm1uk
3 Dec 2007, 1:26 PM
Hi Zak

Thanks for that but doing this I get the error I spoke to you before regarding the comboField ...cf.comboField....