Web popupmenu and timer problem

I just tried. Apparently, it is not possible to access a session property from a Timer instance on a WebPage. But you can move your ButtonPressed property to a module, and then it works fine.

Michel, will a Module property be only available to the user like Session properties or is it global for all users to see?

Its global. But what do you want to achieve ?

If you want the property to be tied to the current user, use a WebPage property.

Thanks for your help with this. Each user will need their own property for this or the interface will not work, so I can’t use a Module property instead. I use the Session.ButtonPressed Boolean property for each user to say when they have clicked an image. This prevents double-clicks from running code twice. This Boolean gets reset to False every second to ensure that the interface always works - in some cases when other pages or dialogs are displayed, setting it to False within the same block of code is not always appropriate, and if I have missed resetting it to False in some code somewhere, the entire UI will stop working, so I need the timer to make sure this does not happen.

I know it sounds strange, but it works well and I am happy with it. The only thing wrong is this Firefox issue with the popup menus and the WebTImer.

[quote=128770:@Eric Gibbon]Thanks for your help with this. Each user will need their own property for this or the interface will not work, so I can’t use a Module property instead. I use the Session.ButtonPressed Boolean property for each user to say when they have clicked an image. This prevents double-clicks from running code twice. This Boolean gets reset to False every second to ensure that the interface always works - in some cases when other pages or dialogs are displayed, setting it to False within the same block of code is not always appropriate, and if I have missed resetting it to False in some code somewhere, the entire UI will stop working, so I need the timer to make sure this does not happen.

I know it sounds strange, but it works well and I am happy with it. The only thing wrong is this Firefox issue with the popup menus and the WebTImer.[/quote]

I understand. I did verify : a ButtonPressed WebPage property is set differently for each user. So your interface will work as before. Only, the switch to timer will eliminate the PopupMenu bug.

Michel, I don’t understand - if a server-side Timer can not access Session properties, how can it access individual WebPage properties for each user?

Because the instance is a control of the webpage, which properties are different for each user.

Was this ever fixed?

I am getting this same problem in 2015 (in 21st century)

[quote=198405:@shahid darbar]Was this ever fixed?

I am getting this same problem in 2015 (in 21st century)[/quote]

I see you have added to <https://xojo.com/issue/21710> today.

When an issue is fixed, it is mentioned twice : Fixed, then Fixed and verified. Until then, it just has been reviewed, which means Xojo staff has seen the report.

Have you tried using a server-side Timer ? Simply to set i as Integer, it should be no problem.

OK. I had kind of forgotten about this, so I downloaded the popupjump.xojo_binary_project I had attached to the feedback I filed last year.

It is based on the OP description, with a WebTimer and only dim i as integer in Action.

I replaced the WebTimer by a timer this way :

  • Go Insert/Class. Call it “myTimer”
  • Select the newly appeared myTimer class in the navigator and in the Inspector Super field, enter Timer
  • Drag an instance over the webpage
  • Select the webtimer Action event, and delete it
  • Select myTimer1 and paste the Action event

I ran the project without even removing the WebTimer that now has no event left. The drop down no longer jumps with the arrow keys.

I believe unless you absolutely need a client side timer, this workaround to initialize variables and properties should do just fine, pending a fix to the issue.

If a client side timer is absolutely necessary, look into JavaScript
SetInterval() http://www.w3schools.com/jsref/met_win_setinterval.asp for multiple,
and setTimeOut() for Single http://www.w3schools.com/jsref/met_win_settimeout.asp .

Michel,

I need to do stuff client side.
I had already seen your fix in the previous posts.

To be honest I had seen this issue go away after the first time we reported it.
But we have noticed it come back.

thanks for your post,
they are generally quite helpful .

[quote=198432:@shahid darbar]Michel,

I need to do stuff client side.
I had already seen your fix in the previous posts.

To be honest I had seen this issue go away after the first time we reported it.
But we have noticed it come back.

thanks for your post,
they are generally quite helpful .[/quote]

Thank you for the kind words. When you say client side, what is it you need done, if I may ask ?

I make containers visible invisible and other similar things.

I can do from a timer in session - which is a problem if the user has closed the window.

I can put checks to counter this - but I am not very pleased with this solution.

[quote=198468:@shahid darbar]I make containers visible invisible and other similar things.

I can do from a timer in session - which is a problem if the user has closed the window.

I can put checks to counter this - but I am not very pleased with this solution.[/quote]

Making containers visible/invisible would work in a Timer.

containers will become visible invisible but the timer will mess up the webpopupmenu which is the problem here.

I am talking about server-side Timer, not WebTimer which indeed makes the selection jump with arrow keys.

WebTimer is client side and in JavaScript, which is probably the cause for the issue, whereas Timer is in Xojo, identical to Desktop Timer, and just as benign as any other pure Xojo code as far as the browser is concerned.

I have solved many problems simply by leaving WebTimer to the side. Recently, it appeared Webtimer was incapable or going lower than 200 ms, for instance, which was required to solve a critical issue in initializing a WebPage.

I would rather first try using a server side timer on the WebPage than building a whole locomotive in Session.