0

Visual Effect for Listbox(Comet)

asked 2009-01-08 17:31:51 +0800

issamlaabidi gravatar image issamlaabidi
217 2

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.

delete flag offensive retag edit

6 Replies

Sort by ยป oldest newest

answered 2009-01-09 01:14:31 +0800

hideokidd gravatar image hideokidd
750 1 2

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.

link publish delete flag offensive edit

answered 2009-01-09 08:01:14 +0800

issamlaabidi gravatar image issamlaabidi
217 2

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?

link publish delete flag offensive edit

answered 2009-01-09 08:32:52 +0800

evpole gravatar image evpole
481 2

updated 2009-01-09 08:33:11 +0800

you could get the information in small talk(just serarch comet or serverpush),or you could get it in zk demo.

link publish delete flag offensive edit

answered 2009-01-09 08:52:12 +0800

hideokidd gravatar image hideokidd
750 1 2

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.

link publish delete flag offensive edit

answered 2009-01-09 13:32:06 +0800

issamlaabidi gravatar image issamlaabidi
217 2

updated 2009-01-09 13:41:06 +0800

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>

link publish delete flag offensive edit

answered 2009-01-09 13:35:25 +0800

issamlaabidi gravatar image issamlaabidi
217 2

updated 2009-01-09 13:36:04 +0800

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

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: 2009-01-08 17:31:51 +0800

Seen: 182 times

Last updated: Jan 09 '09

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