DoSelectInputTestHelper helper = new DoSelectInputTestHelper();
XFSelectAttributes atts = helper.buildSelectAttributes();
Styles styles = atts.getStyles();
MutablePropertyValues propertyValues = styles.getPropertyValues();
if(!multiSelect) {
for(int i=0; i<selectedOtions.length; i++) {
if(selectedOtions[i]) {
atts.setInitial("Value" + (i+1));
break;
}
}
}
atts.setMultiple(multiSelect);
//atts.setTabindex(tabIndex);
// add some options
helper.addOption(atts, "Caption1", "Prompt1", "Value1",
selectedOtions[0]);
helper.addOption(atts, "Caption2", "Prompt2", "Value2",
selectedOtions[1]);
SelectOptionGroup group = null;
String caption, prompt;
int count = 0;
do {
caption = "Group" + (count + 1);
prompt = "Prompt" + (count + 1);
if(0 == count) {
group = helper.addOptionGroup(atts, caption, prompt);;
} else {
group = helper.addOptionGroup(group, caption, prompt);
}
} while(++count < optGroupCount);
helper.addOption(group, "Caption3", "Prompt3", "Value3",
selectedOtions[2]);
//protocol.addStyleMapping(atts, style);
TestDOMOutputBuffer buffer = new TestDOMOutputBuffer();
propertyValues.setComputedValue(
StylePropertyDetails.MCS_SELECTION_LIST_STYLE,
MCSSelectionListStyleKeywords.CONTROLS);
propertyValues.setComputedValue(
StylePropertyDetails.MCS_SELECTION_LIST_OPTION_LAYOUT,
rightAlignCaption ? MCSSelectionListOptionLayoutKeywords.CONTROL_FIRST
: MCSSelectionListOptionLayoutKeywords.CAPTION_FIRST);
propertyValues.setComputedValue(
StylePropertyDetails.MCS_MENU_ORIENTATION,
vertical ? MCSMenuOrientationKeywords.VERTICAL
: MCSMenuOrientationKeywords.HORIZONTAL);
TestMarinerPageContext testPageContext =