[Httpunit-commit] CVS: httpunit/src/com/meterware/httpunit FormControl.java,1.10,1.11
Brought to you by:
russgold
|
From: Russell G. <rus...@us...> - 2002-05-14 18:38:57
|
Update of /cvsroot/httpunit/httpunit/src/com/meterware/httpunit
In directory usw-pr-cvs1:/tmp/cvs-serv13154/src/com/meterware/httpunit
Modified Files:
FormControl.java
Log Message:
Allowed sized selects to have no selected value
Index: FormControl.java
===================================================================
RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/FormControl.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- FormControl.java 8 Apr 2002 18:40:23 -0000 1.10
+++ FormControl.java 14 May 2002 18:38:54 -0000 1.11
@@ -656,6 +656,7 @@
class SelectionFormControl extends FormControl {
private final boolean _multiSelect;
+ private final boolean _listBox;
private final String[] _optionValues;
private final String[] _displayedOptions;
@@ -669,6 +670,7 @@
if (!node.getNodeName().equalsIgnoreCase( "select" )) throw new RuntimeException( "Not a select element" );
_multiSelect = NodeUtils.isNodeAttributePresent( node, "multiple" );
+ _listBox = _multiSelect || NodeUtils.isNodeAttributePresent( node, "size" );
_optionValues = getInitialOptionValues( node );
_displayedOptions = getInitialDisplayedOptions( node );
@@ -724,7 +726,7 @@
}
}
- if (!_multiSelect) {
+ if (!_listBox) {
if (numMatches == 0) throw new IllegalParameterValueException( getName(), (String) values.get(0), getOptionValues() );
}
@@ -765,7 +767,7 @@
}
}
- if (!isMultiValued() && noneSelected && isSelected.length > 0) {
+ if (!_listBox && noneSelected && isSelected.length > 0) {
isSelected[0] = true;
}
return isSelected;
|