function FoodListValidator(errorTitle, errorMessage) {
	this.errorTitle = errorTitle;
	this.errorMessage = errorMessage;
}

FoodListValidator.prototype = new TrValidator();

FoodListValidator.prototype.validate = function(value, label, converter) {
	console.log('FoodListValidator.validate("' + value + '", "' + label + '", "' + converter + '")');
	if(value != null) {
		console.log('Value is not null.');
    	var expr = /^[A-Za-z]*$/
    	console.log('Expression: ' + expr);
    	for(var i = 0; i < value.foodlist.length; i++) {
    		console.log('Food: "' + value.foodlist[i] + '".');
    		if(! expr.test(value.foodlist[i])) {
    			console.log('"' + value.foodlist[i] + '" is not valid.');
    			var msg = TrFastMessageFormatUtils.format(this.errorMessage, value.foodlist[i]);
    			console.log(msg);
    			var fmsg = new TrFacesMessage(this.errorTitle, msg, TrFacesMessage.SEVERITY_ERROR);
    			throw new TrValidatorException(fmsg);
    		}
    		console.log('"' + value.foodlist[i] + '" is valid.');
    	}
    }
}
