+2006-08-31 Wolfgang Sourdeau <WSourdeau@Inverse.CA>
+
+ * DynamicElements/WOCheckBoxList.m: embed 'suffix' label binding in
+ a label tag enclosing the checkbox (v4.5.245)
+
2005-08-15 Sebastian Reitenbach <reitenbach@rapideye.de>
* WOWatchDogApplicationMain.m: include <unistd.h> instead of
/* add checkbox */
{
- NSString *n = nil;
+ NSString *n, *label;
- n = self->name
+ label = [self->suffix stringValueInComponent:sComponent];
+ if (![label isNotEmpty]) label = nil; /* remove null/empty strings */
+
+ n = self->name != nil
? [self->name stringValueInComponent:sComponent]
: OWFormElementName(self, _ctx);
-
+
+ if (label != nil)
+ WOResponse_AddCString(_response, "<label>");
+
WOResponse_AddCString(_response, "<input type=\"checkbox\" name=\"");
[_response appendContentHTMLAttributeValue:n];
WOResponse_AddCString(_response, "\" value=\"");
n = [self->value stringValueInComponent:sComponent];
WOResponse_AddHtmlString(_response, n);
}
- }
-
- if (self->suffix != nil) {
- NSString *ss;
- ss = [self->suffix stringValueInComponent:sComponent];
- WOResponse_AddString(_response, ss);
+ if (label != nil) {
+ WOResponse_AddString(_response, label);
+ WOResponse_AddCString(_response, "</label>");
+ }
}
+
[_ctx incrementLastElementIDComponent];
}
[_ctx deleteLastElementIDComponent]; // list index