0

Zk 3.5.2 to 5.0.1

asked 2010-10-07 08:49:43 +0800

Mychal gravatar image Mychal
151 3

I tried 5.0.1 version and i have some pb :

my jsp include a zul unit which is have his own controller

In 3.5.2, no pb to show the entire page, but in 5.0.1 no object is visible.

if i take a look on source code of the html page, i can see some script generated by v5.0.1 but no HTML code.

For exemple :

<script>
...
zkb('zul.grid.Grid', 'z_9d_3','',{.....});
zke();
....
</script>


Any idea ?

thanks.

ps: sorry for my poor english

delete flag offensive retag edit

5 Replies

Sort by ยป oldest newest

answered 2010-10-07 10:27:11 +0800

Mychal gravatar image Mychal
151 3

more informations :

in zul file, we have attributes "use" to link our controller...in 3.5.2 that works fine.

I tried to modify units with afterCompose implementation, but still no object visible...

link publish delete flag offensive edit

answered 2010-10-08 16:22:05 +0800

SimonPai gravatar image SimonPai
1696 1

Hi Mychal,

As of ZK 5 the DOM elements are generated via javascript, so you won't see anything in page source. You can inspect DOM elements with an element inspector (FireBug, Chrome element inspector, etc).

You can also check if you had given size (width, height) to container components like window or borderlayout. In ZK 5 some components will have zero size if their width or height is not given, hence become invisible.

Regards,
Simon

link publish delete flag offensive edit

answered 2010-10-12 11:38:26 +0800

Mychal gravatar image Mychal
151 3

ok Thank you, i will make some tries.

I need to find time for that ^^

link publish delete flag offensive edit

answered 2010-10-14 03:19:27 +0800

Mychal gravatar image Mychal
151 3

updated 2010-10-14 04:56:52 +0800

So,

i'm back under 3.6.4 this time.

Here my code :

Zul Unit

<?xml version="1.0" encoding="UTF-8"?>
<window id="loadfromcsv" title="Load list from CSV file" width="400px" closable="true" apply="com.myController">

<separator/>
    <div>
        <label id="titleLabel"/>
        <textbox id="pathTextbox"/>
        <button id="browseButton"/>
    </div>
    <div align="center">
        <button id="okButton" label="OK"/>
        <button id="backButton"/>
    </div>
<separator/>
</window>

controller.java

package com.myController;

import org.zkoss.zk.ui.event.Event;
import org.zkoss.zk.ui.util.GenericForwardComposer;
import org.zkoss.zul.Button;
import org.zkoss.zul.Label;
import org.zkoss.zul.Textbox;
import org.zkoss.zul.Window;

public class LoadFromCSVController extends GenericForwardComposer {
    private Window loadfromcsv;
    private Label titleLabel;
    private Textbox pathTextbox;
    private Button browseButton;
    private Button okButton;
    private Button backButton;
    
    public LoadFromCSVController(){
        super();
    }
    
    public void onCreate$loadfromcsv(Event event) throws Exception {
        loadfromcsv.doModal();
    }
    
    public void onCreate$titleLabel(Event event){
        titleLabel.setValue("Test");
    }
}

and the dynamic call of my zul unit

public void displayFromCSVFile() throws Exception {
        try {
            LoadFromCSVController win = (LoadFromCSVController) Executions.getCurrent().createComponents("loadFromCSV.zul", null, null);
        } catch (Exception ex) {
            Messagebox.show(ex.getMessage(), "", Messagebox.OK, Messagebox.ERROR);
        }
    }


I follow exemple on smalltalk, but i have an exception.... the only message from exception is "org.zkoss.zul.Window".

After closing the exception, my window is visible.


Any idea about this problem ????

Thanks.

(Edit] I have a ClassCastException : org.zkoss.zul.Window for that => LoadFromCSVController win = (LoadFromCSVController) Executions.getCurrent().createComponents("loadFromCSV.zul", null, null);

link publish delete flag offensive edit

answered 2010-10-15 02:35:28 +0800

terrytornado gravatar image terrytornado flag of Germany
9393 3 7 16
http://www.oxitec.de/

updated 2010-10-15 02:35:52 +0800

     public void displayFromCSVFile() throws Exception {
        try {
            Window win = (Window) Executions.getCurrent().createComponents("loadFromCSV.zul", null, null);
        } catch (Exception ex) {
            Messagebox.show(ex.getMessage(), "", Messagebox.OK, Messagebox.ERROR);
        }
    }

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-10-07 08:49:43 +0800

Seen: 254 times

Last updated: Oct 15 '10

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