From: Lane S. <la...@op...> - 2003-07-28 20:56:07
|
try rewriting it like a real programmer: if () { } else { } and see what you get. -Lane Marc Palmer wrote: > > Guys I just noticed something funny in some HTML output from WM: > > <SELECT class="fieldentry" NAME="_dob_day"> <OPTION > VALUE="- None-" > -None- > <OPTION VALUE="1" > 1 > <OPTION VALUE="2" > 2 > <OPTION VALUE="3" > 3 > <OPTION VALUE="4" > 4 > <OPTION VALUE="5" > 5 > <OPTION VALUE="6" > 6 > <OPTION VALUE="7" > 7 > <OPTION VALUE="8" > 8 > <OPTION VALUE="9" > 9 > <OPTION VALUE="10" > 10 > <OPTION VALUE="11" > 11 > <OPTION VALUE="12" > 12 > <OPTION VALUE="13" > 13 > <OPTION VALUE="14" > 14 > <OPTION VALUE="15" > 15 > <OPTION VALUE="16" > 16 > <OPTION VALUE="17" > 17 > <OPTION VALUE="18" > 18 > <OPTION VALUE="19" > 19 > <OPTION VALUE="20" > 20 > <OPTION VALUE="21" > 21 > <OPTION VALUE="22" > 22 > <OPTION VALUE="23" > 23 > <OPTION VALUE="24" > 24 > <OPTION VALUE="25" > 25 > <OPTION VALUE="26" SELECTED> 26 > <OPTION VALUE="27" > 27 > <OPTION VALUE="28" > 28 > <OPTION VALUE="29" > 29 > <OPTION VALUE="30" > 30 > <OPTION VALUE="31" > 31 > </SELECT> > > The bit that is "funny" is option 26. Why does it have an extra space? > > The code that proced it is: > > #macro intFieldChoice($action, $sch, $fieldValue, $showNoneItem) > <SELECT class="choiceField" > NAME="$OuterVars.Ignition.getFormFieldName($fieldValue.FormFieldName)"> > #if ($showNoneItem) > <OPTION> -Choose- > #end > #foreach $choice in $fieldValue.MetaData > #if ($choice.Value == $fieldValue.Value) > #set $isChecked = "SELECTED" > #else > #set $isChecked = "" > #end > <OPTION VALUE="$choice.Value" $isChecked> $choice.Label > #end > </SELECT> > #showRequired( $fieldValue) > #end > > ...and I can't see how an extra space gets in there just when the > option is SELECTED. > > Does anybody else think that this might be an obscure whitespace issue? > > The only thing I can think of is that the line that assigns "SELECTED" > is the first part of the #if clause. > > If people think this is not supposed to happen, then I will try to > isolate it and add to the WS unit tests. > > Marc -- Lane Sharman Learn About Conga, All Java GUI Builder: http://opendoors.com/conga |