CPRuleEditor: Since commit 2b52f7d, CPRuleEditor's delegate method -ruleEditor:displayValueForCriterion:inRow: is more restricive: you must return the same view object for a specific criterion in a given row.

In CPRuleEditorCibTest, the delegate has been updated to follow this rule, it also fixes a bug where the predicate was not correctly handling custom control values.
This commit is contained in:
cacaodev committed 2011-12-13 09:49:35 +01:00
1 parent 80f5ab09f3
commit c327956537
1 file changed
+9 -2
@@ -84,8 +84,15 @@ var CPRuleEditorCustomControlClass = @"CPRuleEditorCustomControlClass";
if (custom_control_class != nil)
{
var custom_class = CPClassFromString(custom_control_class);
return [[custom_class alloc] initWithFrame:CGRectMake(0, 0, 100, 18)];
var control = [criterion objectForKey:("control_"+row)];
if (control == nil)
{
var custom_class = CPClassFromString(custom_control_class);
control = [[custom_class alloc] initWithFrame:CGRectMake(0, 0, 100, 18)];
[criterion setObject:control forKey:("control_"+row)];
}
return control;
}
return [criterion objectForKey:@"valeur"];