0

ZK Editor not finding my classes

asked 2009-02-18 22:58:56 +0800

sreed gravatar image sreed
195 1 3 5

My application runs ok in Tomcat but the ZK Editor cannot find my classes and marks them as unresolved. I started this project as a Dynamic Web Project and I am creating my new class files in the default package in the Java Resources (src) folder. Something is screwed up with the way I've got the project configured but I'm stumped. This isn't the same problem as the build directory issue I posted about last week but I suspect it's related somehow. Any help would be appreciated.
Thanks,
Scott

delete flag offensive retag edit

6 Replies

Sort by ยป oldest newest

answered 2009-02-19 03:45:55 +0800

dennis gravatar image dennis
3679 1 6
http://www.javaworld.com....

Do you mean the class in default package(empty package) can't be referred in zul editor?
could try to make the class with a package(eg. com.my) to see it works or not.
and please post you zul file here to help us figure the problem.

link publish delete flag offensive edit

answered 2009-02-19 04:11:07 +0800

sreed gravatar image sreed
195 1 3 5

updated 2009-02-19 04:17:39 +0800

Thanks for the help, Dennis. Moving the files out of the default package fixed the problem!

Here's a java class in the default package:
----------------
import org.zkoss.zul.Window;
public class TestWindow extends Window
{
public TestWindow(){}
}
------------------------

Here's a zuml file that uses TestWindow. In the Zul Editor, there is an error on line 3, "TestWindow cannot be resolved to a type". But it runs just fine, so Tomcat has no problem resolving TestWindow.
------------------------
<?page title="Title" contentType="text/html;charset=UTF-8"?>
<zk>
<window id="cwin" use="TestWindow" title="Test Title">
Hello!
</window>
</zk>
------------------------

If I move TestWindow into a non-default package it works, e.g:
----------------
package test;
import org.zkoss.zul.Window;
public class TestWindow extends Window
{
public TestWindow(){}
}
------------------------
------------------------
<?page title="Title" contentType="text/html;charset=UTF-8"?>
<zk>
<window id="cwin" use="test.TestWindow" title="Test Title">
Hello!
</window>
</zk>
------------------------
Now the Zul Editor stops complaining and can resolve test.TestWindow! Can anyone explain this?

link publish delete flag offensive edit

answered 2009-02-20 01:30:35 +0800

PeterKuo gravatar image PeterKuo
481 2

Because place java in default package is not suggested,
and zk studio simply delegate the class resolving task to eclipse.

link publish delete flag offensive edit

answered 2009-02-20 03:21:09 +0800

sreed gravatar image sreed
195 1 3 5

Thank you, Peter. I didn't see that in the docs.

link publish delete flag offensive edit

answered 2009-02-20 08:17:11 +0800

PeterKuo gravatar image PeterKuo
481 2

Sorry for the inconvience,
that's also why ZK tries to move all document into wiki.
So far, zk studio guide has not yet moved to wiki,
But I think next version will be wikilized.

link publish delete flag offensive edit

answered 2009-02-20 09:18:54 +0800

dennis gravatar image dennis
3679 1 6
http://www.javaworld.com....

a class without pacakge(namesapce) will cause many issues in java. this is common java issue.
I think you can search why by googleing.

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: 2009-02-18 22:58:56 +0800

Seen: 934 times

Last updated: Feb 20 '09

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