I've notice a strange behaviour I've notice a strange behaviour in one of my CGI callouts using FormApi.
I’ve build a callout button that calls a CGI to choose one date from a calendar. The problem is that when one date is chosen and the
opener.top.datacapture.refreshForm(); function is called we get a javascript error “Object doesn’t support this property or method”. I’ve also notice that this error is thrown only if no selection has been made from a single selection combo with size greater than 1.
In mozilla the javascript error is:
Error: uncaught exception: [Exception... "Index or size is negative or greater than the allowed amount" code:
"1" nsresult: "0x80530001 (NS_ERROR_DOM_INDEX_SIZE_ERR)"
location: "http://interwoven /iw/webdesk/templating/dc_item.js Line: 1897"]
This is the code:
if ( formElement.type == "select-one" )
{
var selectedIndex = formElement.selectedIndex;
var options = formElement.options;
alert(selectedIndex);
var selectedOption = options[ selectedIndex ];
var value = selectedOption.value;
this.setOptionValue( value, true );
}
I’ve found out that every single selection combo (with no selected value) in the datacapture has a selectedIndex = 0, but if it is a single selection combo with size greater than 1 it has a selectedIndex = -1, throwing a javascript error like shown.
I could workaround this problem simply by using a size=0 combo instead of a size=10, however I wanted to know if you think there is another solution or patch to solve this.
Thanks.