-
FEATURED COMPONENTS
First time here? Check out the FAQ!
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
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.
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.
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.
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.
Asked: 2011-08-26 04:46:32 +0800
Seen: 467 times
Last updated: Sep 14 '11