0

Desired smalltalk: "Moving your Server Side Composer Logic to ZK Client Side Javascript"

asked 2010-10-29 08:35:08 +0800

madruga0315 gravatar image madruga0315 flag of Brazil
937 2 12

Hi *,

I have a .zul with a Composer, that have a few dateboxes, timeboxes, intboxes and buttons. And all of these components have onChange and onOK forwarded to Composer. All the components are related, I also have a few private variables on the Composer to save the state of the objects.

The problem is that the user interact a lot with all of those components before hitting the save button, the client complained that it's taking too much time do achieve this, because every interaction requires a server trip/processing, so it's slow.

The solution is to pass all the logic to client side, and in the server side only the save logic.

I have no idea on how to procede with this, how to structure JS, how to port my private variables to client side, etc.

I *really* believe that a lot of zk developers have this same problem, so anyone interested in a deep smaltal covering this, please just chime in with "yeah, I have this problem too"

Kind regards,
Madruga

delete flag offensive retag edit

2 Replies

Sort by » oldest newest

answered 2010-11-03 06:20:47 +0800

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

Hi Madruga,
It is a good suggest, We will write a blog for introduce this.
I will answer in this thread after I finish.

link publish delete flag offensive edit

answered 2010-11-05 13:22:59 +0800

madruga0315 gravatar image madruga0315 flag of Brazil
937 2 12

Hi Jimmy,

Great to hear that.
I'll just point out some of my difficulties/doubts on the process (It may be some Javascript newbie questions here, but hey, it´s ZK fold for spoiling me :) )

1. On server side I have a POJO used along with RowRenderer. Now on the client I access the widgets via id and navigate with next/prev/Sibling, firstChild, etc. No clue here if it's the best approach, or it's possible to implement the same POJO on client side. But i'ts a little error prone because if I add/remove/replace one column will become a headache to fix all client logic.
2. Data validation, if have some complex validation that it's not encapsulated on a Constraint. On the server I just throw WrongValueException, on client no clue how do achieve the same.
3. I18n, right now I have a few <label id="lblConstraint..." visible="false"/> to be able to access i18n labels on client side, also not sure how to proceed here
4. Basic I have a .js with lots of functions, so no state is maintained at client side, again, not sure if this is correct...

That's what I can get from the top of my head right now.

Kind regards and thank you very much!!!!
Madruga

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: 2010-10-29 08:35:08 +0800

Seen: 320 times

Last updated: Nov 05 '10

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