0

problem with fileupload

asked 2010-03-15 09:08:41 +0800

sybas gravatar image sybas
6

hello, i have a problem with the fileupload component. i have taken the source code from the zk live demo but when i start the programm i get an error.

the source code:

<zk>
<button label="Upload" upload="true">
<attribute name="onUpload">{
org.zkoss.util.media.Media media = event.getMedia();
if (media instanceof org.zkoss.image.Image) {
org.zkoss.zul.Image image = new org.zkoss.zul.Image();
image.setContent(media);
image.setParent(pics);
} else {
Messagebox.show("Not an image: "+media, "Error", Messagebox.OK, Messagebox.ERROR);
break; //not to show too many errors
}
}</attribute>
</button>
<vbox id="pics" />
</zk>


The error msg:
org.zkoss.zk.ui.metainfo.PropertyNotFoundException: Method setUpload not found for class org.zkoss.zul.Button

thank you for your help.

delete flag offensive retag edit

2 Replies

Sort by ยป oldest newest

answered 2010-03-15 10:26:56 +0800

YamilBracho gravatar image YamilBracho
1722 2

Whick version of ZK are you using ? ZK Demo is based in ZK 5...

link publish delete flag offensive edit

answered 2010-03-15 12:19:28 +0800

sybas gravatar image sybas
6

i am using the latest Zk Studio, i thought it uses zk 5, but now i have seen it uses zk 3.6.
I have importet zk 5 and now it works. thank you

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2010-03-15 09:08:41 +0800

Seen: 657 times

Last updated: Mar 15 '10

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More