Zk does not keep pace with fast synchronization

asked 2013-01-17 03:01:55 +0800

clementtrung gravatar image clementtrung

Hi all,

I'm using farbtastic jquery color picker on my project and one thing I've noticed is that when I use the drag and drop functionnality to choose a color (see demo here http://acko.net/blog/farbtastic-jquery-color-picker-plug-in/) the input element is updated so many times (perhaps too fast too) that ZK does not keep pace with the updates and in the end it simply does not give me the last picked color in my composer when I'm calling Textbox.getValue().
On the other hand, if you don't use the drag and drop functionnality but directly click on the panel to choose a color, the problem doesn't arise.

My first thinking was to call Clients.evalJavaScript() to directly retrieve the input element value but this method does not return the result of the evaluation... What other solutions can I use to get the last updated value of my input element on the client side ? If you have better ideas,feel free to answer too :)

Thanks for the help.

delete flag offensive retag edit

2 Answers

Sort by ยป oldest newest most voted

answered 2013-01-17 09:10:57 +0800

clementtrung gravatar image clementtrung

Hi Jimmy Shiau,

I finally found a solution to my problem. In my zul file, I attached this piece of javascript code to force a last refresh :

zAu.send(new zk.Event(
'onChange', {value:$(selected).attr("value")}, {toServer: true}

Thx for your answer.

link publish delete flag offensive edit

answered 2013-01-17 07:01:40 +0800

jimmyshiau gravatar image jimmyshiau
4921 5
http://www.zkoss.org/ ZK Team

Hi clementtrung,
Can you post your sample code?

link publish delete flag offensive edit
Your answer
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




Asked: 2013-01-17 03:01:55 +0800

Seen: 35 times

Last updated: Jan 17 '13

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