diff --git a/GSWeb.framework/GSWPopUpButton.m b/GSWeb.framework/GSWPopUpButton.m index 9325280..01ba38b 100644 --- a/GSWeb.framework/GSWPopUpButton.m +++ b/GSWeb.framework/GSWPopUpButton.m @@ -144,6 +144,22 @@ static char rcsId[] = "$Id$"; }; //==================================================================== + +/* + + On WO it looks like that: + + + + */ + @implementation GSWPopUpButton (GSWPopUpButtonA) //#define ENABLE_OPTGROUP @@ -165,6 +181,8 @@ static char rcsId[] = "$Id$"; id escapeHTMLValue=nil; int i=0; BOOL inOptGroup=NO; + NSString * popupName=nil; + #ifndef ENABLE_OPTGROUP BOOL optGroupLabel=NO; #endif @@ -177,8 +195,13 @@ static char rcsId[] = "$Id$"; request=[context request]; isFromClientComponent=[request isFromClientComponent]; component=[context component]; - [super appendToResponse:response - inContext:context]; + popupName=[self nameInContext:context]; + + //[super appendToResponse:response + // inContext:context]; + [response _appendContentAsciiString:@"",popupName]]; + NSDebugMLLog(@"gswdync",@"_list=%@",_list); if (_list) { @@ -191,6 +214,9 @@ static char rcsId[] = "$Id$"; [listValue class]); countValue=[listValue count]; }; + + // NSLog(@"listValue=%@",listValue); + NSDebugMLLog(@"gswdync",@"_count=%@",_count); if (_count) { @@ -214,6 +240,7 @@ static char rcsId[] = "$Id$"; selectedValueValue=[_selectedValue valueInComponent:component]; NSDebugMLLog(@"gswdync",@"selectedValue=%@",_selectedValue); NSDebugMLLog(@"gswdync",@"selectedValueValue=%@",selectedValueValue); + if (_escapeHTML) { escapeHTMLValue=[_escapeHTML valueInComponent:component]; @@ -271,31 +298,40 @@ static char rcsId[] = "$Id$"; [response _appendContentAsciiString:@"\n']; }; displayStringValue=nil; @@ -461,114 +498,79 @@ static char rcsId[] = "$Id$"; formValues=[request formValuesForKey:name]; NSDebugMLLog(@"gswdync",@"formValues=%@",formValues); if (formValues && [formValues count]>0) + { + BOOL isEqual=NO; + formValue=[formValues objectAtIndex:0]; + //NSLog(@"GSWPopUpButton formValue=%@",formValue); + NSDebugMLLog(@"gswdync",@"formValue=%@",formValue); + if (_list) { - BOOL isEqual=NO; - formValue=[formValues objectAtIndex:0]; - NSDebugMLLog(@"gswdync",@"formValue=%@",formValue); + listValue=[_list valueInComponent:component]; + NSAssert3(!listValue || [listValue respondsToSelector:@selector(count)], + @"The list (%@) (%@ of class:%@) doesn't respond to 'count'", + _list, + listValue, + [listValue class]); + countValue=[listValue count]; + } + if (_count) + { + id tmpCountValue=[_count valueInComponent:component]; + int tmpCount=0; + NSAssert3(!tmpCountValue || [tmpCountValue respondsToSelector:@selector(intValue)], + @"The 'count' (%@) value %@ (of class:%@) doesn't respond to 'intValue'", + _count, + tmpCountValue, + [tmpCountValue class]); + tmpCount=[tmpCountValue intValue]; + NSDebugMLog(@"tmpCount=%d",tmpCount); if (_list) + countValue=min(tmpCount,countValue); + else + countValue=tmpCount; + } + + for(i=0;!found && i