+2005-11-13 Helge Hess <helge.hess@opengroupware.org>
+
+ * DynamicElements/WORadioButton.m: added some comments and a warning
+ about issues wrt request handling (v4.5.211)
+
+2005-11-01 Helge Hess <helge.hess@opengroupware.org>
+
+ * WOSession.m ([WOSession -takeValuesFromRequest:inContext:]): changed
+ handling of -takeValues in combination with directaction components
+ (v4.5.210)
+
2005-10-16 Jean-Alexis Montignies <ja@sente.ch>
* DynamicElements/WOSwitchComponent.m: properly consume element-id
// TODO: this seems to have issues
formValue = [_req formValueForKey:OWFormElementName(self, _ctx)];
-
- if (self->checked) {
+
+#warning FIXME, radio button form handling
+
+ if (self->checked != nil) {
// TODO: check needs element-ids?
if ([self->checked isValueSettable]) {
+ // TODO: this only checks element-IDs! In case a value is assigned, it
+ // must check the value
[self->checked setBoolValue:[formValue isEqual:[_ctx elementID]]
inComponent:sComponent];
}
}
+ /*
+ TODO
+
+ This needs to check the value and compare it with the value of the form,
+ otherwise all radio elements will push the value, multiple times because
+ radio buttons always have the same name!
+
+ Note that the actual result is usually OK, because all elements push the
+ _same_ value, the one from the form, not their own.
+ */
if ([self->selection isValueSettable])
[self->selection setValue:formValue inComponent:sComponent];
}
# version file
-SUBMINOR_VERSION:=209
+SUBMINOR_VERSION:=211
# v4.5.122 requires libNGExtensions v4.5.153
# v4.5.91 requires libNGExtensions v4.5.134
else {
WOComponent *page;
- if ((page = [_ctx page])) {
+ if ((page = [_ctx page]) != nil) {
WOContext_enterComponent(_ctx, page, nil);
[page takeValuesFromRequest:_req inContext:_ctx];
WOContext_leaveComponent(_ctx, page);
senderID = [_ctx senderID];
- if ([senderID length] == 0)
+ if ([senderID length] == 0) {
/* no element URL is available */
+ WOComponent *page;
+
+ if ((page = [_ctx page]) != nil) {
+ /*
+ But we do have a page set in the context. This usually means that the
+ -takeValues got triggered by the WODirectActionRequestHandler in
+ combination with a WOComponent being the DirectAction object.
+ */
+ NSTimeInterval st = 0.0;
+
+ WOContext_enterComponent(_ctx, page, nil);
+
+ if (profileComponents)
+ st = [[NSDateClass date] timeIntervalSince1970];
+
+ [page takeValuesFromRequest:_request inContext:_ctx];
+
+ if (profileComponents) {
+ NSTimeInterval diff;
+
+ diff = [[NSDateClass date] timeIntervalSince1970] - st;
+ printf("prof[%s %s]: %0.3fs\n",
+ [[(WOComponent *)page name] cString], sel_get_name(_cmd), diff);
+ }
+
+ WOContext_leaveComponent(_ctx, page);
+ }
+
return;
+ }
if ([[_request method] isEqualToString:@"GET"]) {
NSRange r;
r = [[_request uri] rangeOfString:@"?"];
- if (r.length == 0)
+ if (r.length == 0) {
/* no form content to apply */
+ // TODO: we should run the takeValues nevertheless to clear values?
return;
+ }
}
if ((reqCtxId = [_ctx currentElementID]) == nil)
{
WOComponent *page;
- if ((page = [_ctx page])) {
+ if ((page = [_ctx page]) != nil) {
NSTimeInterval st = 0.0;
WOContext_enterComponent(_ctx, page, nil);