此代码(链接到操场:http ://tinyurl.com/6ed9dyv )
var label = new qx.ui.basic.Label('<input type="file" id="files" name="files[]"/>').set({width: 250, rich:true, wrap:true});
var doc = this.getRoot();
doc.setLayout(new qx.ui.layout.VBox(10));
doc.add(label);
var button1 = new qx.ui.form.Button("Test");
doc.add(button1);
button1.addListener("execute", function(e) {
var obj = document.getElementById('files');
if (obj)
alert(obj.files.length);
});
对我不起作用。obj.files 始终未定义。奇怪的是,当我切换到另一个选项卡然后回到包含此代码的选项卡时,它确实在具有多个选项卡的应用程序中工作。