0

How to stop event-send while using csa

asked 2009-01-20 07:23:31 +0800

evpole gravatar image evpole
481 2

updated 2009-01-20 07:28:57 +0800

I use CSA to check the input. if users let the input blank,program stop submit.
i have a composer to receive the onClick event for button "search".I was able to notify user,but how to stop the onClick event sending to server?



<textbox id="keywords"/><label id="keyhelp" label="please fill the kewwords" visible="false" />
<button label="search" id="search" action="onclick:if(#{keywords}.value=='')action.show(#{keyhelp}); "/>


Thanks for advise.

delete flag offensive retag edit

2 Replies

Sort by ยป oldest newest

answered 2009-01-20 10:35:25 +0800

hideokidd gravatar image hideokidd
750 1 2

updated 2009-01-20 10:48:47 +0800

Well, it's really a trade-off,
CSA can help developers handle events on client side, because it makes javascript code which is processed on client side.

But if you want to make that with composer......there are two cases:

1.The definition of onClick event is within composer (java class), thus it is very hard to avoid server handling event, because composer is triggered by ZK event, which will be served on server side.

2.The definition of onclick event is located on zul page, well, it's exact a client side action, server does nothing and client won't sent event to server, because the 'onclick' event in javascript is not 'onClick' in ZK. The former is defined by HTML. 'onclick' event is processed on client side but 'onClick' on server side. The sample code you provided is a better solution to your question.

link publish delete flag offensive edit

answered 2009-01-21 02:09:29 +0800

evpole gravatar image evpole
481 2

Thanks for response.
yes, it's really hard to avoid server handing in client.

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-20 07:23:31 +0800

Seen: 137 times

Last updated: Jan 21 '09

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