+2005-10-05 Helge Hess <helge.hess@skyrix.com>
+
+ * DynamicElements/WOSubmitButton.m: disable KVC push for 'value'
+ binding in -takeValuesFromRequest:inContext:. This is usually not
+ required but results in issue #1568 on OSX. The old behaviour can
+ be reenabled by settin ghte WOSubmitButtonEnableValueSync default to
+ YES (v4.5.205)
+
2005-10-03 Helge Hess <helge.hess@opengroupware.org>
* WODisplayGroup.m: added -qualifyDataSourceAndReturnDisplayCount
WOSimpleHTTPParserHeavyDebugEnabled = NO;
WOSimpleHTTPParserMaxUploadSizeInKB = 262144;
WOStatsStylesheetName = "WOStats.xsl";
+ WOSubmitButtonEnableValueSync = NO;
WOUseRelativeURLs = YES;
WOUseGlobalCookiePath = YES;
WOValueAssociationsCacheSize = 200;
@implementation WOSubmitButton
+static BOOL WOSubmitButtonEnableValueSync = NO;
+
+ (int)version {
return 2;
}
++ (void)initialize {
+ NSUserDefaults *ud = [NSUserDefaults standardUserDefaults];
+
+ WOSubmitButtonEnableValueSync =
+ [ud boolForKey:@"WOSubmitButtonEnableValueSync"];
+}
- (id)initWithName:(NSString *)_name
associations:(NSDictionary *)_config
return;
}
- if ((formValue = [_rq formValueForKey:OWFormElementName(self, _ctx)])) {
- //NSLog(@"%@: value=%@ ..", [self elementID], formValue);
+ if ((formValue = [_rq formValueForKey:OWFormElementName(self, _ctx)])!=nil) {
+ // [self debugWithFormat:@"%@: value=%@ ..", [self elementID], formValue];
- if ([self->value isValueSettable]) {
- [self->value setStringValue:formValue
- inComponent:[_ctx component]];
+ if (WOSubmitButtonEnableValueSync) {
+ /*
+ We need this because some associations (eg
+ WOKeyPathAssociationSystemKVC) report "isValueSettable" as YES,
+ but raise an exception afterwards.
+
+ This section is disabled per default since its usually not required.
+
+ See OGo bug #1568 for details.
+ */
+ if ([self->value isValueSettable])
+ [self->value setStringValue:formValue inComponent:[_ctx component]];
}
+
if ((self->action != nil) || (self->pageName != nil))
[_ctx addActiveFormElement:self];
}