When load a page with script, the script runs immediately. You have to wait for the components to be parsed before loading data on them. The alternative way to solve this issue is to put your code in the 'onLoad' event hander.
$('#dialog').dialog({
href: ...,
onLoad: function(){
var data = {"ismain": "1"};
$("#test2").form('load', data);
}
});
about that , please take a look at
http://jsfiddle.net/j0qruz98/30/, if I add $.parser.parse("#test2") to parse components it makes combobox not working,
if I remove $.parser.parse("#test2") combobox is ok but switchbutton is not
http://jsfiddle.net/j0qruz98/31/ ,
I am so confused , force components to parser, but why combobox can not load the data?