-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi All,
I am trying to test a ZK (5.0.6) application using JQuery client-side scripting.
It works fine until I try to test if a groupbox is open or closed. This is (simplified) my page:
<groupbox closable="true" open="false"> <caption image="myimage.png" label="mylabel"/> <listbox> ... content... </listbox> </groupbox>
I try to check if the listbox inside the groupbox is visible by using the ZK extensions to jq to locate the elements and then applying the :visible selector.
So my jq selector string is
@groupbox @listbox:visible
I tried looking inside the generated HTML using DOM Inspector and analysing the css that implements the hiding. I see some CSS overflow:hidden manipulations but my JS knowledge is not enough to understand them completely. Anyway, JQ selector :visible is said to work fine with such cases as it checks if "browser-reported offsetWidth or offsetHeight is greater than 0.
Any idea what is the problem ?
I want to suggest you to use ZK Widget API .
Here's the example.
<zk xmlns:w="client">
<groupbox closable="true" open="false">
<caption label="mylabel"/>
<div>
content
</div>
</groupbox>
<button label="click me to know the open state of groupbox." w:onClick="alert(zk.Widget.$(jq('@groupbox')[0]).isOpen())" />
</zk>
You could find ZK JS doc in ZK website.
http://www.zkoss.org/javadoc/latest/jsdoc/
Asked: 2012-01-16 13:24:36 +0800
Seen: 290 times
Last updated: Jan 17 '12