ZK - Open Source Ajax Java FrameworkZK - Open Source Ajax Java Framework

Fail to render component when included in another

pdavie
27 May 2011 19:48:22 GMT
27 May 2011 19:48:22 GMT

Hi,
This is probably me being silly and not setting something right (I've looked at the settings but nothing seems to solve this). Anyway, the problem is this:

Whenever I include a ZUL file using <include src="whatever" /> in another file, if the component I include has an apply="some class" declaration, then ZK Studio always says it cannot render the object because it cannot find the class specified.

I find this really strange, because the ZUL Editor correctly highlights if the class is not in the class path when creating the file.

I hope it is just me not setting something, because otherwise, the only way to get The ZUL Editor to render the screen is by taking out the apply="" statement.

With a large system under development, this becomes a development and testing nightmare.

If anyone has a solution to this I would welcome it! :-D

Note: This problem has happened with every version of ZK Studio. I am currently using ZK 5.0.6 on Eclipse 3.6 on Linux.
Thanks in advance,
Peter

This post also references issues with includes, but not the same problem as I am having.

pdavie
15 Jun 2011 23:54:11 GMT
15 Jun 2011 23:54:11 GMT

I presume the silence on this thread is that I'm being really dumb about something. If so, please enlighten me! Thanks in advance.

fede
29 Jul 2011 04:22:24 GMT
29 Jul 2011 04:22:24 GMT

Hi there,
I have a similar problem although in my case the Visual Editor shows a 'Fail to render' error when I include a window that has a 'use' attribute in it.
Let's make a concrete example so that maybe someone can find a solution.
I have a test.zul file like this:

<?page title="Test Window" contentType="text/html;charset=UTF-8" ?>
<zk>
    <window id="testwin" use="controller.TestController">
        <label value="Hello!" />
        <include src="/test2.zul" />
    </window>
</zk>

The test2.zul looks like this:

<?page title="Test Window" contentType="text/html;charset=UTF-8" ?>
<zk>
    <window id="testwin2" use="controller.TestController">
        <label value="Hi!" />
    </window>
</zk>

And the TestController is just this:

package controller;
import org.zkoss.zul.Window;
public class TestController extends Window {
    public TestController() {
        super();
    }
}

As you can see in the inner window testwin2 there is a 'use' attribute which references a dummy controller which extends from zul's Window class.
This example works fine when deployed to a real Tomcat or whatever server. BUT, the file test.zul cannot be rendered by the ZUL Visual Editor showing a message 'Fail to render: java.lang.ClassNotFoundException: controller.TestController'
The test2.zul is displayed with no problem, and in fact, if I remove the 'use' attribute from the testwin2 window, then the test.zul outer window is displayed successfully.
So, I think this is probably a bug in the Visual Editor plug-in. Lets hope someone tries to reproduce it and fix it :-)