0

Get html code from zul

asked 2012-11-20 16:48:39 +0800

Marky gravatar image Marky flag of Spain
284 7
http://www.no/havent-doma...

updated 2012-11-20 16:50:32 +0800

Its posible get the html code of .zul from .java?

Something like this:

<borderlayout>
   <north>
           <textbox value="actualValueInZul"></textbox>
     </north>
</borderlayout>  

Regards,

Mark.

delete flag offensive retag edit

5 Replies

Sort by ยป oldest newest

answered 2012-11-20 17:06:30 +0800

sjoshi gravatar image sjoshi flag of India
3493 1 8
http://zkframeworkhint.bl...

If you are talking about the Component than Yes you can get it See how you can get Intbox value through Java code. http://zkframeworkhint.blogspot.in/2012/09/how-to-get-intbox-value-from-inside.html

link publish delete flag offensive edit

answered 2012-11-20 17:31:34 +0800

Senthilchettyin gravatar image Senthilchettyin flag of India
2623 3 8
http://emrpms.blogspot.in...

Install firebug in firefox and then you can check the how ZK Engine creating the HTML Code

link publish delete flag offensive edit

answered 2012-11-21 08:06:22 +0800

Marky gravatar image Marky flag of Spain
284 7
http://www.no/havent-doma...

Sorry, I explain me better.
I want get all code of page in html, export this code and then reproduce it in other page. I think that if I can get it i will have a snapshot from page (with elements and their values).
I'm trying it because Its imposible get a snapshot from client side.
There are any way to do it?
Regards,
Mark

link publish delete flag offensive edit

answered 2012-11-21 08:47:11 +0800

khcyt gravatar image khcyt
216 1 1

Hello Marky,

this forum has a search function. :-)

Look here.

Kai

link publish delete flag offensive edit

answered 2012-11-21 09:17:01 +0800

Marky gravatar image Marky flag of Spain
284 7
http://www.no/havent-doma...

updated 2012-11-21 09:17:15 +0800

@khcyt
Thanks for link! I reproduce the code:

<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" ></window>
	<textbox id="tmp" onChange="System.out.println(event.getValue());" visible="false" ></textbox>
	<button label="show window html in console">
		<attribute name="onClick">
			Clients.evalJavaScript("getHtml('"+win.getUuid()+"');");
		</attribute>
	</button>
</zk>

But doesn't work for me. I expect clone the html page with values in inputs (<input id="in" style="..." value="something"/>), and this method only returns the html and zk structures.

Think in it as a snapshot. Get all code to clone a page doing copy/paste this string in a .zul page.
Anyway, if someone knows how get a snapshot from client side, will help me a lot.

Regards,
Mark

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: 2012-11-20 16:48:39 +0800

Seen: 107 times

Last updated: Nov 21 '12

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