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

sending method to client

raviteja
7 Feb 2012 04:47:57 GMT
7 Feb 2012 04:47:57 GMT

Hai Every one,

As i am new to zk i have one problem
i have one method which is written below and i have written this in method in Calendar Controller class which extends genericforward composer . Now I want to send it to the client.


private void execToolTipJScript(){
Script script = new Script();
String code = "setTimeout(function(){$('.z-calevent').each(function(){"+
"$('.z-calevent-resizer', this).remove();"+
"var timeSpan = $('.z-calevent-text', this).html();"+
"$('.z-calevent-header', this).html(timeSpan.substring(timeSpan.indexOf('<%#>')));"+
"var tooltip = $('.z-calevent-header', this).html() + ': ' + $('.z-calevent-text', this).html();"+
"$(this).attr('title', tooltip);"+
"});},100);";

script.setContent(code);
script.setPage(page);

}

jumperchen
14 Feb 2012 08:53:36 GMT
14 Feb 2012 08:53:36 GMT

You can use this method too. - Clients.evalJavaScript(String)

raviteja
15 Feb 2012 04:28:38 GMT
15 Feb 2012 04:28:38 GMT

Hi jumperchen,

thanks for sharing and can you explain me with the following method..............


private void execToolTipJScript(){
Script script = new Script();
String code = "setTimeout(function(){$('.z-calevent').each(function(){"+
"$('.z-calevent-resizer', this).remove();"+
"var timeSpan = $('.z-calevent-text', this).html();"+
"$('.z-calevent-header', this).html(timeSpan.substring(timeSpan.indexOf('<%#>')));"+
"var tooltip = $('.z-calevent-header', this).html() + ': ' + $('.z-calevent-text', this).html();"+
"$(this).attr('title', tooltip);"+
"});},100);";

script.setContent(code);
script.setPage(page);

}