I have a generic service which returns an array of JSON objects. when I try to map the array pointer $ to the list component, it will not map (lst name does not change green)
My Javascript:
pre
Appery.areas = Appery.createClass(null, {
Code: Select all
init : function(requestOptions) {
this.__requestOptions = $.extend({}, requestOptions);
console.log("request options: ",this.__requestOptions);
},
process : function(settings) {
settings.beforeSend(settings);
if (this.__requestOptions.echo) {
settings.success(this.__requestOptions.echo);
} else {
console.log('Default implementation is used. Please define your own.');
var areas = [
"AB (Aberdeen)",
"AL (St. Albans)",
"B (Birmingham)",
"BA (Bath)",
"BB (Blackburn)",
"BD (Bradford)",
"BH (Bournemouth)",
"BL (Bolton)",
"BN (Brighton)",
"BR (Bromley)",
"BS (Bristol)",
"CA (Carlisle)",
"CB (Cambridge)",
"CF (Cardiff)",
"CH (Chester)",
"CM (Chelmsford)",
"CO (Colchester)",
"CR (Croydon)",
"CT (Canterbury)",
"CV (Coventry)",
"CW (Crewe)",
"DA (Dartford)",
"DD (Dundee)",
"DE (Derby)",
"DH (Durham)",
"DG (Dumfries)",
"DL (Darlington)",
"DN (Doncaster)",
"DT (Dorchester)",
"DY (Dudley)",
"E (East London)",
"EC (East Central London)",
"EH (Edinburgh)",
"EN (Enfield)",
"EX (Exeter)",
"FK (Falkirk)",
"FY (Blackpool)",
"G (Glasgow)",
"GL (Gloucester)",
"GU (Guildford)",
"HA (Harrow)",
"HD (Huddersfield)",
"HG (Harrogate)",
"HP (Hemel Hempstead)",
"HR (Hereford)",
"HU (Hull)",
"HX (Halifax)",
"IG (Ilford)",
"IP (Ipswich)",
"IV (Inverness)",
"KA (Kilmarnock)",
"KT (Kingston upon Thames)",
"KY (Kirkcaldy)",
"GU (Guildford)",
"L (Liverpool)",
"LA (Lancaster)",
"LD (Llandrindod)",
"LE (Leicester)",
"LL (Wales postcodes)",
"LN (Lincoln)",
"LS (Leeds)",
"LU (Luton)",
"M (Manchester)",
"ME (Medway)",
"ML (Motherwell)",
"MK (Milton Keynes)",
"N (North London)",
"NE (Newcastle)",
"NG (Nottingham)",
"NN (Northampton)",
"NP (Newport)",
"NR (Norwich)",
"NW (North West London)",
"OL (Oldham)",
"OX (Oxford)",
"PA (Paisley)",
"PE (Peterborough)",
"PH (Perth)",
"PL (Plymouth)",
"PO (Portsmouth)",
"PR (Preston)",
"RG (Reading)",
"RH (Redhill)",
"RM (Romford)",
"S (Sheffield)",
"SA (Swansea)",
"SE (South East London)",
"SG (Stevenage)",
"SK (Stockport)",
"SL (Slough)",
"SM (Sutton)",
"SN (Swindon)",
"SO (Southampton)",
"SP (Salisbury)",
"SR (Sunderland)",
"SS (Southend on Sea)",
"ST (Stoke-on-Trent)",
"SW (South West London)",
"SY (Shrewsbury)",
"TA (Taunton)",
"TD (Galasheils)",
"TF (Telford)",
"TN (Tonbridge)",
"TQ (Torquay)",
"TR (Truro)",
"TS (Cleveland)",
"TW (Twickenham)",
"UB (Southall)",
"WA (Warrington)",
"W (West London)",
"WC (West Central London)",
"WD (Watford)",
"WF (Wakefield)",
"WN (Wigan)",
"WR (Worcester)",
"WS (Walsall)",
"WV (Wolverhampton)",
"YO (York)"
];
var responseData = "";
//lines separated by a comma
for (var i = 0; i < areas.length - 1; i++) {
responsedata += '{"area" : "' + area[i] + '"},';
}
//last line no comma
responseData += '{"area" : "' + area[areas.length -1] + '"}';
settings.success([
responseData
]);
}
settings.complete('success');
}
});/pre
Service Response definition:
My Mappings:
(By the way this is the third time I have tried to post this question but it keeps entering a black hole)