1

Zk create custom event for COmbo box?

asked 2017-04-04 09:46:47 +0800

psingh gravatar image psingh flag of India
963 8

HI,

I want to create a custom event for COmbo box. Can anyone tell how do i proceed to add new event and its event listener to combo box?

delete flag offensive retag edit

2 Answers

Sort by ยป oldest newest most voted
0

answered 2017-04-06 02:00:42 +0800

cor3000 gravatar image cor3000
6280 2 7

Hi,

adding a 'custom' event listener is done like any 'regular' event listener (in the zul file or using Component.addEventListener(...) or in a SelectorComposer no difference there).

You can also trigger the event in regular ways, e.g. using event forwarding (as shown in this zkfiddle).

You can also call Events.postEvent("onMyCustomEvent", ...) (see: https://www.zkoss.org/wiki/ZKDeveloper'sReference/EventHandling/EventFiring)

And there are ways to send an event from the client side to the server directly.

I'd like to go into more detail but unfortunately your question is a bit vague... Please be more precise about what your custom event should do and how it should be triggered.

Robert

link publish delete flag offensive edit

Comments

But Robert I want to do it via client side. Do you have any ides related to it?

psingh ( 2017-04-06 06:00:19 +0800 )edit
0

answered 2017-04-06 06:29:03 +0800

cor3000 gravatar image cor3000
6280 2 7

yes... All you need is an instance of the client side widget and then fire the event as needed.

Here another ZK Fiddle

Client side event firing is described here in detail: https://www.zkoss.org/wiki/ZKClient-sideReference/Communication/AURequests/Client-sideFiring

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

Follow
2 followers

RSS

Stats

Asked: 2017-04-04 09:46:47 +0800

Seen: 37 times

Last updated: Apr 06 '17

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