-
FEATURED COMPONENTS
First time here? Check out the FAQ!
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
Hi Madruga,
It is a good suggest, We will write a blog for introduce this.
I will answer in this thread after I finish.
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
Asked: 2010-10-29 08:35:08 +0800
Seen: 320 times
Last updated: Nov 05 '10