0

Events.echoEvent data missing

asked 2011-08-26 04:46:32 +0800

Bobzk gravatar image Bobzk
444 1 8

updated 2011-08-26 04:49:50 +0800

I have the following code in a menu controller :

Events.echoEvent('onBuild', mycomp, self.searchfor)

in a different controller I have the onBuild method and I have the following code :

real_event = Events.getRealOrigin(event)
searchfor = real_event.getData()

under normal circumstances this works fine but on random occasions (less than 0.1% of the time) when the onBuild event is triggered the data returned by real-event.getData() is NULL.

So the onBuild event is not being lost but the data associated with it is being lost.

Could this be a bug? Could it be anything to do with garbage collection?

This is ZK 5.0.6

delete flag offensive retag edit

8 Replies

Sort by ยป oldest newest

answered 2011-08-31 22:28:51 +0800

matthewgo gravatar image matthewgo
375

Hi

Can u provide fragment of your code to reproduce the issue?

link publish delete flag offensive edit

answered 2011-09-05 05:16:06 +0800

Bobzk gravatar image Bobzk
444 1 8

Hi matthewgo,

The problem with a fragment is we use only Jython (not as zscript - see my smalltalks) and you will probably say it's a Jython problem. I don't think it is Jython as Jython uses standard java garbage collection.

What I'll try and do is give you some pseudo code as to how it works :-

ZUL

Borderlayout
left window
window id="menuwin" apply="menucontroller"
button id="mybutton" value="click to search"
right window
window id="viewwin" apply="viewcontroller"

MENUCONTROLLER

onClick mybutton
mycomp = Path.getComponent('/viewwin')
Events.echoEvent('onBuild', mycomp, self.searchfor)
Clients.showBusy("Please Wait ...")

VIEWCONTROLLER

onBuild_viewwin
real_event = Events.getRealOrigin(event)
searchfor = real_event.getData()
if searchfor is None:
print "No searchfor passed to onBuild."
print "event", repr(event)
print "realevent", repr(real_event)
Clients.clearBusy()
return()

As you can see from the pseudo code, I get around the problem at the moment by resetting the showbusy and ignoring the event - allowing the user to press the button again.

As I said in the original post it only happens very rarely - I'm trying to debug it and get you more information.

Hope this helps.

link publish delete flag offensive edit

answered 2011-09-11 09:30:02 +0800

Bobzk gravatar image Bobzk
444 1 8

OK, done a bit more investigation and I have a feeling it is one of the robots and/or screen scrapers. Put a trace in to print out IP and Browser info when it happens but of course it has not happened since.

One strange thing (which got me thinking it was a bot) is when I use google translate or babel fish. The "Please wait ......" widow from Clients.showBusy("Please Wait ...") appears but that should only happen on a button press. The busy status never goes away.

Of course the busy status (with the screen behind shaded) won't go away if the busy window is appearing by mistake because the echoEent of course won't happen.

Anyone else seen the "busy please wait" appear (by mistake) on their webs when using the translation sites?

Can't say that this is a high priority problem. Of course I'd like Google translate and babelfish to work but any problems with bots or screens scrapers don't worry me.

link publish delete flag offensive edit

answered 2011-09-13 02:17:25 +0800

matthewgo gravatar image matthewgo
375

Hi
Do you mean the error occurs when you use google translate to translate an ZK powered page?

link publish delete flag offensive edit

answered 2011-09-13 03:37:10 +0800

Bobzk gravatar image Bobzk
444 1 8

matthewgo,

the problem with missing event data DOES NOT occur with google translate. What does occur with google translate is that the little popup "Plase wait" from the statement :-

Clients.showBusy("Please Wait ...")

appears. Even though it should only show after an onCjhange event (data entered into a comno box) is generated.

Because this happens it just gives me the idea that my original problem (missing data) may also be a bot/scrapper problem, so that is what I am looking at now but have not found anything.

Sorry if I confused you.

link publish delete flag offensive edit

answered 2011-09-13 04:04:01 +0800

Bobzk gravatar image Bobzk
444 1 8

matthewgo,

ignore the "Please wait" problem - I have spotted a code error.

link publish delete flag offensive edit

answered 2011-09-13 21:09:19 +0800

matthewgo gravatar image matthewgo
375

Hi
Can u try to use zkfiddle to reproduce the issue?

link publish delete flag offensive edit

answered 2011-09-14 04:50:13 +0800

Bobzk gravatar image Bobzk
444 1 8

Hi matthewgo,

Looks interesting (and possible) but look, it happens very rarely. I have a work around. I'm also trying to trace more information when it happens, maybe better for you to wait for me to come up with more information. It doesn't look as if anyone else gets the problem. Equally it may well be to do with the way I raise the event in one window/controller and handle it in another window/controller.

I'll get back to you if and when I get more information.

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: 2011-08-26 04:46:32 +0800

Seen: 467 times

Last updated: Sep 14 '11

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