Revision history [back]

click to hide/show revision 1
initial version

asked 2012-12-18 08:08:05 +0800

unitcell gravatar image unitcell

how to fire javascript on view-model end ?

Hi all,

Referent ZK Demo effect login [a href="http://www.zkoss.org/zkdemo/effects/login_effect"][/a].

<zscript><![CDATA[
        void loginCheck () {
            if ((name.getValue().equals("zk") && pwd.getValue().equals("zk"))) {
                mesg.setValue("OK");
                Clients.evalJavaScript("zk.Widget.$('$loginWin').setMinimized(true)");
                initBtn.getParent().appendChild(new Label("Login Success !! Welcome to ZK Demo!"));
            } else {
                mesg.setValue("User Name or Password Invalid!");
                Clients.evalJavaScript("loginFaild()");
            }; 
        }
        ]]></zscript>

I wanna change loginCheck() on view to view-model end.

if loginCheck() on view-model return fail(false), how do I got something from view-model to fire this code :

Clients.evalJavaScript("loginFaild()") on view end ?

Thanx.

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