answered
2016-03-21 15:25:35 +0800
caiofilipemr 5 ● 2 I tried to do like was in the fiddle, if I understood correctly the Clients.evalJavaScript("jq('$btn').next().find('input').click();");
will click in my btn and trigger the onUpload, so I put this code in my .zul: <button id="btn" upload="true" visible="false"/>
and this in my .java:
public void myValidationFunction() { //Which is triggered after a button clicked, but I have
if (valid()) //to make some validations before upload the file
Clients.evalJavaScript("jq('$btn').next().find('input').click();");
}
public void onUpload$btn(UploadEvent event) {
System.out.println("test");
}
This doesn't work, maybe I did it wrong, but I think what cor3000 said makes sense. What do you think ?