-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi,
I have quite a few zul forms powered by generic forward composers. I've been trying to make these forms fully serializable in order to achieve high availability. Quite to my surprise every composer's didActivate method gets invoked not just once, but many times. Exactly one for every listener defined as public void onXXX$... in the controller. By debugging I've seen that, within this piece of AbstractComponent's code:
if (_auxinf != null && _auxinf.listeners != null)
for (Iterator<List<EventListenerInfo>> it = CollectionsX.comodifiableIterator(_auxinf.listeners.values());
it.hasNext();)
for (EventListenerInfo li: it.next())
didActivate(li.listener);
every li.listener amounts to the controller instance itself.
I can of course very easily keep track of whether a certain didActivate invokation must be paid heed to by establishing a counter to be incremented in didPassivate and decremented in didActivate but, all the same, is it a bug or is it done on purpose (and in this case, which one)?
Regards
http://tracker.zkoss.org/browse/ZK-2701 has been fixed for 7.0.6, FL version available for testing here http://www.zkoss.org/download/freshly/ (or maven version 7.0.6.FL.20150804-Eval)
update: 7.0.6.1/7.0.6.1-Eval have been released in the mean time, containing the fix as well http://www.zkoss.org/download/zk?ee
Asked: 2015-04-08 11:24:24 +0800
Seen: 52 times
Last updated: Sep 01 '15
wrong valueException come in front of modal popup [closed]
Use parameters in a conditional @command
Problems with multiple press and onCtrlKey
MVVM @save on the fly [closed]
Unable to activate destroyed desktop
org.zkoss.zk.ui.UiException: java.lang.ClassNotFoundException
How to put a image or Letter over image on a specific XY Coordinate
sounds like a bug, in that case without a specific reason. In general listeners can be scattered among various objects, it should be sufficient to activate /passivate the listeners only once. Which ZK version are you using? then I can do some additional tests, and comparing it to the latest version.
cor3000 ( 2015-04-09 07:32:46 +0800 )edit6.5.3, as stated. I think I'll end up updating to zk7, but for the time being this is the version I must use. No idea if the same problem arises with versions > 6.5.3.
cvarona ( 2015-04-09 08:26:57 +0800 )editsorry didn't look in the title :P
cor3000 ( 2015-04-09 09:51:32 +0800 )editfor clarification I raised the issue http://tracker.zkoss.org/browse/ZK-2701
cor3000 ( 2015-04-10 09:02:29 +0800 )editVery nice, thanks a lot for sparing time to check out this
cvarona ( 2015-04-10 09:51:41 +0800 )edit