Hi,
I've a problem with this block of code:
HTML:
Code:
<div id=sources>
	Source1: <select id='source1'></select><br/>
	Source2: <select id='source2'></select><br/>
</div>
JavaScript:
Code:
var s1 = document.getElementById('source1')
  , s2 = document.getElementById('source2');
  
var select_sources = function() {
		var sourceX = s1.value;
		var sourceY = s2.value;
	var constraints = {
		x: {
			optional: [{sourceId: sourceX}]
		},
		y: {
			optional: [{sourceId: sourceY}]
		}
	};
	init(constraints);
};

var init = function(sourceInfos) {
	for (var i = 0; i != sourceInfos.length; i++) {
		var sourceInfo = sourceInfos[i];
		var option = document.createElement("option");
			option.value = sourceInfo.id;
	}
}

s1.onchange = select_sources;
s2.onchange = select_sources;
Provided that the sources values are generated and appended automatically by the system.

The problem: when there are only one value for both data sources there's no method to fire the function.

Thank you,