2

Expand/Collpase window on button click

asked 2012-10-17 04:48:54 +0800

psingh gravatar image psingh flag of India
963 8

Hi, I want to expand & collapse windows & hbox on image button click.
Can anybody tell how to do it?

delete flag offensive retag edit

6 Replies

Sort by ยป oldest newest

answered 2012-10-19 06:14:43 +0800

psingh gravatar image psingh flag of India
963 8

@Richard: Can you give any example of this function?

link publish delete flag offensive edit

answered 2012-10-17 22:56:58 +0800

twiegand gravatar image twiegand
1807 3

psingh,

Maybe something like the following:

<zk xmlns:w="http://www.zkoss.org/2005/zk/client" >
	<window>
		<hbox id="hbox1" width="500px" height="500px" style="border: 3px solid red;">
			...
			Stuff goes in here
			...
		</hbox>
		<space height="25px"/>
		<button label="Click Me">
			<attribute w:name="onClick">
				jq(this.$f('hbox1')).slideToggle(500);
			</attribute>
		</button>
	</window>
</zk>

Maybe that will give you an idea...

Todd

link publish delete flag offensive edit

answered 2012-10-18 04:34:11 +0800

psingh gravatar image psingh flag of India
963 8

@twiegand : Thanks for your reply. I have to do same thing but without using zscipt.

link publish delete flag offensive edit

answered 2012-10-18 13:40:41 +0800

Steva77 gravatar image Steva77 flag of Italy
1014 3
http://www.research.softe...

Well, then I think you need to have a Composer listening to the event coming from the botton and process it accordingly, see http://books.zkoss.org/wiki/ZK_Developer's_Reference/MVC/Controller/Composer.
Hope it helps
S

link publish delete flag offensive edit

answered 2012-10-19 04:14:41 +0800

RichardL gravatar image RichardL
768 4

You can use Clients.evalJavascript function in your Java class.

link publish delete flag offensive edit

answered 2012-10-19 08:18:50 +0800

terrytornado gravatar image terrytornado flag of Germany
9393 3 7 16
http://www.oxitec.de/

updated 2012-10-19 08:19:11 +0800

a little bit of code:

zul file

<?page id="ZKLoginDialog" title=" Login "?>
<?link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" ?>
<?link rel="icon" type="image/gif" href="/animated_favicon1.gif" ?>
<?taglib uri="http://www.zkoss.org/dsp/web/core" prefix="c"?>

<zk xmlns="http://www.zkoss.org/2005/zul" xmlns:h="http://www.w3.org/1999/xhtml"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:w="http://www.zkoss.org/2005/zk/client"
	xsi:schemaLocation="http://www.zkoss.org/2005/zul http://www.zkoss.org/2005/zul/zul.xsd">


	<window id="loginwin" border="none" width="475px" apply="org.opentruuls.base.webui.login.ZkLoginDialogCtrl">

		<script type="text/javascript">

			<![CDATA[ function submit() { document.f.submit(); } ]]>

               </script>

  // Rest of zul components here

	</window>
</zk>

Java Controller

	/**
	 * when the "login" button is clicked. <br>
	 * 
	 * @throws IOException
	 */
	public void onClick$btnLogin() throws IOException {

   . . .

	Clients.evalJavaScript("submit()"); // do submit
	}

best
Stephan

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-10-17 04:48:54 +0800

Seen: 158 times

Last updated: Oct 19 '12

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