]> err.no Git - sope/blobdiff - sope-appserver/NGObjWeb/DynamicElements/WOBrowser.m
fixed OGo bug #894
[sope] / sope-appserver / NGObjWeb / DynamicElements / WOBrowser.m
index 93a7435e40f320c6f79ebbaba049ce1cd7d8446d..508989d5e02e86cdce9f14e82e29dabc506f9cdb 100644 (file)
 @protected
   WOAssociation *list;
   WOAssociation *item;
-  WOAssociation *selection;
+  WOAssociation *selection;         // => use 'selections'!
   WOAssociation *string;            // WO4 => use 'displayString'!
   WOAssociation *noSelectionString; // WO4
   
   // non-WO:
   WOAssociation *singleSelection; // selection contains an item, not an array
+  
+  // WO 4.5
   WOAssociation *multiple; // multiple selections allowed
   WOAssociation *size;
 
-  // TODO: WO 4.5: selectedValues, escapeHTML, selections
+  // TODO: WO 4.5: selectedValues, escapeHTML
 }
 
 @end /* WOBrowser */
@@ -65,7 +67,6 @@
   if ((self = [super initWithName:_name associations:_config template:_c])) {
     self->list              = OWGetProperty(_config, @"list");
     self->item              = OWGetProperty(_config, @"item");
-    self->selection         = OWGetProperty(_config, @"selection");
     self->singleSelection   = OWGetProperty(_config, @"singleSelection");
     self->multiple          = OWGetProperty(_config, @"multiple");
     self->size              = OWGetProperty(_config, @"size");
              @"are set, use only one! ('string' is deprecated!)"];
     }
     
+    if ((self->selection = OWGetProperty(_config, @"selections")) == nil) {
+      if ((self->selection = OWGetProperty(_config, @"selection")) == nil) {
+       [self debugWithFormat:
+               @"Note: using deprecated 'selection' binding, "
+               @"use 'selections' instead."];
+      }
+    }
+    else if (OWGetProperty(_config, @"selection") != nil) {
+      [self debugWithFormat:@"WARNING: 'selections' AND 'selection' bindings "
+             @"are set, use only one! ('selection' is deprecated!)"];
+    }
+    
     // compatiblity
     if (self->noSelectionString == nil)
       self->noSelectionString = OWGetProperty(_config, @"nilString");