0

Fileupload raises an ui exception both in ie and ff under zk.3.5.2

asked 2008-12-11 08:39:14 +0800

cvarona gravatar image cvarona
554 1 6

Hi,

If set up a fileupload on the onClick trigger of a button in one of the forms in my application. When I click in the 'Examine' button a popup window appears to inform me that

Invalid ID: z_ma_l3!iframe. Cause: reserved words not allowed: [arg, page, session, event, spaceOwner, desktop, self]
11-dic-2008 9:34:53 org.zkoss.zk.ui.impl.UiEngineImpl handleError:1107

The whole trace reads

Invalid ID: z_ma_l3!iframe. Cause: reserved words not allowed: [arg, page, session, event, spaceOwner, desktop, self]
11-dic-2008 9:34:53 org.zkoss.zk.ui.impl.UiEngineImpl handleError:1107
GRAVE: >>org.zkoss.zk.ui.UiException: Invalid ID: z_ma_l3!iframe. Cause: reserved words not allowed: [arg, page, session
, event, spaceOwner, desktop, self]
>> at org.zkoss.zk.ui.AbstractComponent.setId(AbstractComponent.java:612)
>> at sun.reflect.GeneratedMethodAccessor27.invoke(Unknown Source)
>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>> at java.lang.reflect.Method.invoke(Method.java:597)
>> at org.zkoss.zk.ui.metainfo.Property.assign0(Property.java:260)
>> at org.zkoss.zk.ui.metainfo.Property.assign(Property.java:175)
>> at org.zkoss.zk.ui.metainfo.ComponentInfo.applyProperties(ComponentInfo.java:733)
>> at org.zkoss.zk.ui.impl.AbstractUiFactory.newComponent(AbstractUiFactory.java:95)
>>...

At first I thought it could be due to some error in my form or script, but I tried to copy the following from the online demo (which of course works perfectly) and insert it into my form:

<button label="Upload">
		<attribute name="onClick">{
			Object media = Fileupload.get();
			if (media instanceof org.zkoss.util.media.Media[]) {
				org.zkoss.util.media.Media[] medias = (org.zkoss.util.media.Media [])media;
				for (int i = 0; i < medias.length; i++) {
					Image image = new Image();
					image.setContent(medias<i >);
					image.setParent(pics);
				}
			} else if (media != null)
				Messagebox.show("Not an image: "+media, "Error", Messagebox.OK, Messagebox.ERROR);
		}</attribute>
	</button>

The result was the same. If I switch back to zk3.5.1 everything works fine.

I guess the reason for this must lie on the differences between my environment and that of the server running the demo. I'm using the maven jetty plugin 6.1.11 and have the following zk.xml configuration:

<zk>
    <listener>
        <description>ThreadLocal Synchronization Listener</description>
        <listener-class>org.zkoss.zkplus.util.ThreadLocalListener</listener-class>
    </listener>
    <preference>
        <name>ThreadLocal</name>
        <value>org.springframework.security.context.ThreadLocalSecurityContextHolderStrategy=contextHolder</value>
    </preference>
</zk>

With kind regards

César Varona

delete flag offensive retag edit

5 Replies

Sort by » oldest newest

answered 2008-12-11 09:18:02 +0800

windperson gravatar image windperson
415 1

Hi cvarona,
please download ZK 3.5.2 again, it should be OK.

link publish delete flag offensive edit

answered 2008-12-11 22:29:58 +0800

SMut gravatar image SMut
6

Hi cvarona,

when I deployed my initial setup of the ZK 3.5.1 demo i ran into the same errors. I sent a bugreport via email to the developers, cause the demo at zkoss showed the same error. Download the 3.5.2-bin file for development and remove the old files and everything will work.
(Unfortunately my database-connection with hSLQdb does not...)

Steffen

link publish delete flag offensive edit

answered 2008-12-12 09:14:27 +0800

cvarona gravatar image cvarona
554 1 6

Hi,

I downloaded the zk3.5.2 release anew and everything worked fine. Thanks!

César Varona

link publish delete flag offensive edit

answered 2008-12-12 09:41:42 +0800

hkn gravatar image hkn
246 3

Hello !

I just downloaded 3.5.2 and updated my WEB-INF/lib.
All files are dated 12/08/2008 so I am sure to have all files really updated.
I cleaned my "Module Work Directory" (tomcat 6.0.10).

A simple

        zul.....
        <button id="upload" label="upload" image="/img/attachment.gif"/>


        controller.....

	public void onClick$upload(Event ev) {
		System.out.println("upload event");
		byte[] buffer = new byte[0];
		try {
		Media media[] = Fileupload.get("Please select up to 3 files to upload.", "Upload", 3, true);
         .....

traps with the following exception:

12.12.2008 10:31:37 org.zkoss.zk.ui.metainfo.Property assign:177
SCHWERWIEGEND: Failed to assign [id=${self.parent.uuid}!iframe] to <Iframe z_vp_421>
Invalid ID: z_vp_221!iframe. Cause: reserved words not allowed: [arg, page, session, event, spaceOwner, desktop, self]
12.12.2008 10:31:37 org.zkoss.zk.ui.impl.UiEngineImpl handleError:1107
SCHWERWIEGEND: >>org.zkoss.zk.ui.UiException: Invalid ID: z_vp_221!iframe. Cause: reserved words not allowed: [arg, page, session, event, spaceOwner, desktop, self]
>>	at org.zkoss.zk.ui.AbstractComponent.setId(AbstractComponent.java:612)
>>	at sun.reflect.GeneratedMethodAccessor31.invoke(Unknown Source)
>>	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>	at java.lang.reflect.Method.invoke(Method.java:597)
>>	at org.zkoss.zk.ui.metainfo.Property.assign0(Property.java:260)
>>	at org.zkoss.zk.ui.metainfo.Property.assign(Property.java:175)
>>	at org.zkoss.zk.ui.metainfo.ComponentInfo.applyProperties(ComponentInfo.java:733)
>>	at org.zkoss.zk.ui.impl.AbstractUiFactory.newComponent(AbstractUiFactory.java:95)
>>...

none of my ids/vars are named arg, page, session, event, spaceOwner, desktop, self.


Please Help!

Thanks in advance

/Horst

link publish delete flag offensive edit

answered 2008-12-12 10:04:31 +0800

lovetide gravatar image lovetide
169 1 7

ZK3.5.2 had updated, the newest version was realese at 2008-12-09 01:50

2008-12-09 01:50 24,397,824 zk-bin-3.5.2.zip

md5sum of zk-bin-3.5.2.zip:
785bd782ccdc534f9504c5429c07a837 *zk-bin-3.5.2.zip

so, you need download it again.

link publish delete flag offensive edit

answered 2008-12-12 10:13:59 +0800

hkn gravatar image hkn
246 3

Yes ! you are right ! I just tried and now it works !

The strange thing is that my first download of 3.5.2 was today an hour ago and is dated 12/08/2008!
The second a few minutes ago is 12/09/2008.

I think I do not have to understand this!

Thanks !
/Horst

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: 2008-12-11 08:39:14 +0800

Seen: 533 times

Last updated: Dec 12 '08

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