-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi there,
I'd like to know whether there is some way to obtain the html generated for a given component, say a window, from the server side.
With kind regards
César Varona
Hi Varona,
You can try to send it to server side from client side, for example,
the fragment below will show the window's html in server console
<zk> <script type="text/javascript"> function getHtml(id) { var node = jq('#'+id)[0], div = document.createElement('div'), $tmp = jq('$tmp'), tmp = $tmp[0]; div.appendChild(node.cloneNode(true)); $tmp.focus(); tmp.value = div.innerHTML; $tmp.blur(); tmp.value = ''; } </script> <window id="win" title="test win" /> <textbox id="tmp" onChange="System.out.println(event.getValue());" visible="false" /> <button label="show window html in console"> <attribute name="onClick"> Clients.evalJavaScript("getHtml('"+win.getUuid()+"');"); </attribute> </button> </zk>
Regards,
ben
Asked: 2012-02-03 09:12:25 +0800
Seen: 157 times
Last updated: Feb 09 '12