From db101ab7e20c7810b4250a773c5157b4ebc605bc Mon Sep 17 00:00:00 2001 From: helge Date: Wed, 5 Oct 2005 14:11:13 +0000 Subject: [PATCH] changed handling of 'disabled' binding git-svn-id: http://svn.opengroupware.org/SOPE/trunk@1158 e4a50df8-12e2-0310-a44c-efbce7f8a7e3 --- sope-appserver/NGObjWeb/ChangeLog | 6 ++++++ .../NGObjWeb/DynamicElements/WORadioButtonList.m | 16 +++++++++++----- sope-appserver/NGObjWeb/Version | 2 +- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/sope-appserver/NGObjWeb/ChangeLog b/sope-appserver/NGObjWeb/ChangeLog index e9547aba..4ae72567 100644 --- a/sope-appserver/NGObjWeb/ChangeLog +++ b/sope-appserver/NGObjWeb/ChangeLog @@ -1,5 +1,11 @@ 2005-10-05 Helge Hess + * DynamicElements/WORadioButtonList.m: changed handling of 'disabled' + during -takeValuesFromRequest:. Now the index/item bindings are + pushed, and then the 'disabled' binding is checked prior setting the + 'selection' to the item (the item will not get selected if its + disabled). (v4.5.206) + * 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 diff --git a/sope-appserver/NGObjWeb/DynamicElements/WORadioButtonList.m b/sope-appserver/NGObjWeb/DynamicElements/WORadioButtonList.m index ffacf539..63f78216 100644 --- a/sope-appserver/NGObjWeb/DynamicElements/WORadioButtonList.m +++ b/sope-appserver/NGObjWeb/DynamicElements/WORadioButtonList.m @@ -78,22 +78,28 @@ NSArray *array; id formValue; - if ([self->disabled boolValueInComponent:sComponent]) - return; - formValue = [_rq formValueForKey:OWFormElementName(self, _ctx)]; if (formValue == nil) return; idx = [formValue unsignedIntValue]; array = [self->list valueInComponent:sComponent]; - + + /* setup item/index */ + if ([self->index isValueSettable]) [self->index setUnsignedIntValue:idx inComponent:sComponent]; if ([self->item isValueSettable]) [self->item setValue:[array objectAtIndex:idx] inComponent:sComponent]; - + + /* now check whether the item is disabled/allowed as the selection */ + + if ([self->disabled boolValueInComponent:sComponent]) + return; + + /* set selection if possible */ + if ([self->selection isValueSettable]) { [self->selection setValue:[array objectAtIndex:idx] inComponent:sComponent]; diff --git a/sope-appserver/NGObjWeb/Version b/sope-appserver/NGObjWeb/Version index 9efa18fa..67c4ebe6 100644 --- a/sope-appserver/NGObjWeb/Version +++ b/sope-appserver/NGObjWeb/Version @@ -1,6 +1,6 @@ # version file -SUBMINOR_VERSION:=205 +SUBMINOR_VERSION:=206 # v4.5.122 requires libNGExtensions v4.5.153 # v4.5.91 requires libNGExtensions v4.5.134 -- 2.39.5