-
FEATURED COMPONENTS
First time here? Check out the FAQ!
How do I modify/ extend a zk button to look like a facebook notification (with numbers in top ) to say per example how many messages you received.
not sure how to start extending the button or using jquery.
Thanks in advance for your help.
I think that in ZK 6.0.1
you can do it with Clients.showNotification()
like presented here: http://books.zkoss.org/wiki/ZK Developer's Reference/UI Patterns/Useful Java Utilities
Trator,
thanks for the suggestion, I tried to use Clients.showNotification() but when I have 2 notification does not work well they overlap each other
see http://zkfiddle.org/sample/l5ehfc/6-ShowNotification-message if you run it , you will see what I mean.
I wanted to use the "top_right" position to overlap the "3" over the right side of the button but I was not able to do it.
Maybe if I could modify the size of the notification popup so it shows only 3 , also I want to be close when the user clicks the button (notification reference).
If you have an example or any help would be highly appreciated.
package jl5ehfc$v3;import 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{
Button btn;
Button btn1;
public void doAfterCompose(Component comp) throws Exception {
super.doAfterCompose(comp);
Clients.showNotification("23", "info", btn, "middle_right", -1);
Clients.showNotification("15", "info", btn1, "middle_left", -1);
}public void onClick$btn(Event e) throws InterruptedException{
Clients.showNotification("5", "error", btn, "before_center", -1);
}
}
<zk>
<window border="normal" title="hello" apply="jl5ehfc$v3.TestComposer">
<div>show notifications!</div>
<button id="btn" style="float:right" label="Notifications" />
<button id="btn1" style="float:right" label="Updates" />
</window>
</zk>
Asked: 2012-06-29 21:59:24 +0800
Seen: 228 times
Last updated: Jul 12 '12