-
FEATURED COMPONENTS
First time here? Check out the FAQ!
hello I am new in ZK. it I s coll as a framework thanks. I use the part of comet that puts the server in push case so that I can get new messages from my database and for every new message i add it to a Liustbox. now i want to use effects so that i can attire the attention of my application user. As a first step I have used a fonction which change for a period the style of Listcell added but i have discover that is not good because there are many request to the server so I decided th use the javascript. In effet I want to use it through adding an action to my Listbox but I can not know how. For other elements as Label or Textbox i use for exemple onfucus on onblur but for the Listbox i didn't know what i have to use. Please other question how can i make my action go on automatiquelly every time i add a new Listcell. Thanks for your help.
Hi,
You can post your code here so that others could find out what's wrong.
According to your description I am not sure the answer,
but we can figure out errors quickly with your code.
By the way,
you can look up API to understand this component.
Thanks.
I am sorry but i don't have a problem with the code. i use the comet to push new messages for the client and i put them in a listbox. that is fine now i want to give a specific visual effect to my listbox so that for every new message i can notify to the client that there is a new messag how can i do that?
you could get the information in small talk(just serarch comet or serverpush),or you could get it in zk demo.
Hi,
sorry I misunderstood your description,
please try the ZK demo animation,
make a onCreate event for each new listitem,
in the event you can add this code to notify client
Clients.evalJavaScript("functionNameOfAnimation()");
the parameter is the function to do "visual effect".
Hope this can bring you something good.
Thanks.
i have found it myself in effect i have to make a javascript fonction so that it changes the style of my text here you are my exemple.
<?page id="testZul" title=" New ZUL Title" cacheable="false"
language="xul/html" zscriptLanguage="Java" contentType="text/html;charset=UTF-8"?>
<window id="win" border="normal" width="750px" visible="true"
closable="true" onClose="self.setVisible(false)">
<groupbox id="groupbox" mold="3d" width="280px" open="true"
height="250px">
<caption id="captionGroup"
style="font: bold ;text-decoration: underline;
;font-size: 40pt;font-weight: bold;"
label="New Alert Messages"
action="onmouseover:change(#{captionGroup})" />
</groupbox>
<script type="text/JavaScript">
<![CDATA[
function black(elem){
intrvl=0;
time=0;
elem.style.color = "navy";
};
function change(elem){
intrvl=0;
time=0;
elem.style.color = "red";
for(nTimes=0;time<18000;nTimes++){
intrvl += 500;
setTimeout(function(){setRed(elem)},intrvl);
intrvl += 1000;
setTimeout(function(){setBlack(elem)},intrvl);
time+=500;
}
};
function setRed(elem){
elem.style.color = "black";
elem.style.backgroundColor="white";
};
function setBlack(elem){
elem.style.color = "#CCCCCC";
elem.style.backgroundColor="navy";
};
]]>
</script>
</window>
so whene the server pushs a new message i add it to my Listbox and i use that zul to add visual effect so that the user is notified with the new messages. Thank you for this Framework
Asked: 2009-01-08 17:31:51 +0800
Seen: 182 times
Last updated: Jan 09 '09