Is there a way to remove a callback function from plugins.file.showFileOpenDialog() call? It works with an empty callback function but would be more efficient without one:
function uploadVCardDialog(){
var vCardFile = plugins.file.showFileOpenDialog(1, null, false, null, uploadCallBack, i18n.getI18NMessage('bob.ps_vcard_upload'))[0];
return parseVCard(vCardFile);
}
function uploadCallBack(_file){}
If I place null instead of uploadCallBack I get error.
I tried numerous times, as soon as I substitute call to empty “function uploadCallBack(_file){}” with “null” it stops working. This is in smart clients. The code is in the top message. Remove “uploadCallBack” from “showFileOpenDialog” and it stops working.
i guess you are getting an exception in the log/console right?
Because you are in single select (that 3th argument which is false) but you do in the end [0] but a single select only return directly the file…
no need for an array index lookup there.
If you are giving a callback you should really use the return value because thats should be handled in the calback
$file = plugins.file.showFileOpenDialog(1, null, false, new Array("XLS and XLSX", "xls", "xlsx"));
I get no errors, when I hover the showFileOpenDialog I see this
Shows a file open dialog. Filters can be applied on what type of files can be selected. (Web Enabled, you must set the callback method for this to work)
so I think in smartclient the callback null is not needed (I never use it in smartclient)…