-
FEATURED COMPONENTS
First time here? Check out the FAQ!
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?
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
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
Asked: 2017-04-04 09:46:47 +0800
Seen: 37 times
Last updated: Apr 06 '17