Hey yall I am trying to use the provided DataList from the components library and button to implement a menu option. I have it working flawlessly however if the user doesnt select an item and presses button it proceeds to present URL/undefined. I am trying to write a catch on the button submission so if datalist is unselected setFocus to DataList. I have written it out as follows:
_global.style.setStyle("themeColor", "haloOrange");
var arUrl:Array=["/pages/browsecategory.aspx?cat=1","/pages/browsecategory.aspx?cat=2", "/pages/browsecategory.aspx?cat=3"];
var provider:Array=[{label:"Selection 1",data:0}, {label:"Selection 2",data:1}, {label:"Selection 3",data:2}];
choice.mcList.dataProvider=provider;
var obj:Object={};
obj.click=function(eo:Object)
{
var count:Number=choice.mcList.selectedItem.data;
getURL(arUrl[count],"_self");
trace("count="+arUrl[count]);
}
but.mcSubmit.addEventListener("click",obj); {
if (obj = false) {
setFocus.Object;
}
}
Insight is appreciated. MT.
Thanks in advance