Hi all:
I am a new newbie of smartclient. I have a problem about the onChange event handling select component, as I know, 'change' property is invalidate in smartClient, instead of the 'onChange' property in js for select component. but when i reselect a same option, the change event can not trigger, in ordinary js code. I can customer onChange function as follow:
But in the smartClient, I don't know how to get the first option item. the following is my code in smartCient framework:
Any help appreciate !
I am a new newbie of smartclient. I have a problem about the onChange event handling select component, as I know, 'change' property is invalidate in smartClient, instead of the 'onChange' property in js for select component. but when i reselect a same option, the change event can not trigger, in ordinary js code. I can customer onChange function as follow:
Code:
<select name=sel onchange="reselectOption(this.options[this.options.selectedIndex].value)">
<option value="">
<option value="1">Item 1
<option value="2">Item 2
<option value="3">Item 3
</select>
<script>
function reselectOption(s)
{
txt.value +=s;
//after reselect, let the first option item is selected, then it can change.
document.all.sel.options[0].selected=true;
}
</script>
<textarea id=txt />
Code:
isc.DynamicForm.create({
ID:"CaseMainForm",
width:"100%",
numCols:2,
colWidths:["15%", "85%"],
autoFocus:false,
fields:[
{
name:"compare1",
title:"Compare1",
type:"select",
valueMap :["Batch","Webservice","xDesign","xRevise","xResponse","Other(Exist)","Other"],
defaultValue:"",
wrapTitle:false,
showIf:"FormServerConfig.getValue('serverType') == 'EE'",
redrawOnChange:true,
required:true,
width:330,
change:function(viewer,item,value){
// I set the first option item here, but it can't work :(
compare1.valueMap[0].selected=true;
}
}
]
})
Comment