index.zulzul<?page title="B60-ZK-1222" contentType="text/html;charset=UTF-8"?>
<zk>
<style>
<![CDATA[
.p-data {
padding-top:5px;
}
]]>
</style>
<panel title="Instruction" width="500px" border="normal">
<panelchildren>
<div>The listbox below has a header row, and two data rows.</div>
<separator/>
<div>When mousing over the first data row, you should see a tooltip loading for about 2 seconds.
Then, the tooltip should keep displaying until the mouse cursor is moved outside the first data row.</div>
<separator/>
<div>If you see the tooltip appearing and disappearing several times while it is loading, it is an error.</div>
</panelchildren>
</panel>
<separator />
<label tooltip="msg" value="Hover here to see the real label" />
<separator />
<separator />
<listbox width="500px">
<listhead>
<listheader label="Operation" width="200px" />
<listheader label="Contacts" sort="auto" />
</listhead>
<listitem tooltip="msg">
<listcell label=" Mouse hover - tooltip " />
<listcell>
<vlayout class="p-data">
<label value="Male" />
<label value="[email protected]" />
</vlayout>
</listcell>
</listitem>
<listitem popup="msg">
<listcell label="Click - popup" />
<listcell>
<vlayout class="p-data">
<label value="Female" />
<label value="[email protected]" />
</vlayout>
</listcell>
</listitem>
</listbox>
<popup id="msg" width="300px">
<vlayout>
This user is online now !
<toolbarbutton label="Mail him/her" />
</vlayout>
</popup>
<zscript>
<![CDATA[
msg.addEventListener("onOpen", new EventListener() {
public void onEvent(Event e) {
if (((OpenEvent) e).isOpen()) {
Thread.sleep(2000);
}
}
});
]]>
</zscript>
</zk>
TestComposer.javajavaimport org.zkoss.zk.ui.*;
import org.zkoss.zk.ui.event.*;
import org.zkoss.zk.ui.util.*;
import org.zkoss.zk.ui.ext.*;
import org.zkoss.zk.au.*;
import org.zkoss.zk.au.out.*;
import org.zkoss.zul.*;
public class TestComposer extends GenericForwardComposer{
public void doAfterCompose(Component comp) throws Exception {
super.doAfterCompose(comp);
}
public void onClick$btn(Event e) throws InterruptedException{
Messagebox.show("Hi btn");
}
}