0

Customize ZK's JavaScript Code

asked 2014-10-02 15:41:32 +0800

takach gravatar image takach
30 2

updated 2014-10-03 13:44:59 +0800

Hi,

As described at http://books.zkoss.org/wiki/ZK%20Developer's%20Reference/Customization/Handle%20AU%20Request%20Resend , I tried to use my own implementation, but it does not have any effect.

In fact, I am facing with an Error that is not easily reproducable and I try to fix it there. So I tried to overwrite some other method that is called very often, like this:

zAu.ajaxSendNow = function (reqInf) {
   console.log("------------------- ajaxSendNow");
   zk.log("------------------- ajaxSendNow");
   // then the same implementation as in zk.jar
}

but I have never seen the messages to apper. When I put these logging code directly into au.js in zk.jar, I can see the messages both in the browser console and the ZK's log-div on the page.

I have found no instructions, where to define the customized JavaScript code. I have put it into my menu.zul that is included in all of my pages:

        <?xml version="1.0" encoding="ISO-8859-1"?>
    <z:zk xmlns:z="http://www.zkoss.org/2005/zul" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://www.zkoss.org/2005/zul http://www.zkoss.org/2005/zul/zul.xsd ">

    <script defer="true"><![CDATA[
    console.log("+++++++++++++++++++++++++++++" + zAu.startProcessing);
    console.dir(zAu);
    console.dir(zk);

    zAu.startProcessing = function (timeout) {
    console.log("1111111111111111111111111111111111");
        zk.log(">>>>>>>>>>>>>>>>>>>>>>>> startProcessing");
        zk.processing = true;
        setTimeout(jq.isReady ? showprgb: showprgbInit, timeout > 0 ? timeout: 0);
    }  
    ]]></script>
 <z:vlayout apply="bflexx.zk.menu.MenuController" style="border:normal;width:100%;">
...

Is that so correct? Why doesn't it work?

My ZK Version is 6.5.4.

delete flag offensive retag edit
Be the first one to answer this question!
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
1 follower

RSS

Stats

Asked: 2014-10-02 15:41:32 +0800

Seen: 23 times

Last updated: Oct 03 '14

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