[quote=326154:@Andre Kuiper]
Personaly i more and more get the feeling that Xojo web is totally without support![/quote]
Subverting how the framework works is unsupported
[quote=326154:@Andre Kuiper]
Personaly i more and more get the feeling that Xojo web is totally without support![/quote]
Subverting how the framework works is unsupported
[quote=326154:@Andre Kuiper]It’s not my intention to snatch in to Xojo framework but there isn’t another way AFAIK to get some gain in performance. In fact by making the controlwrapper available Xojo promotes the use of javascript including reacting on mouseevents. The poor performance of XOJO webapps and lacking controls force you to use it.
[/quote]
Andre, I feel your reply is misinformed. I keep telling you to use LOCAL mouse events, instead of hooking the whole page events.
You don’t HAVE to use listeners.
@Norman Palardy: Noone is talking about subverting, just a simple question is done to know a legal way to use a very basic command of javascript to use mouseevents and especially to reset event behaviour to the original behaviour. I had expected a bit supporting instructions from Greg, but obviously as i experienced before that’s not available for me.
@Michel Bujardet: Sorry i gave you the impression i didn’t understand what you proposed, i see your suggestion as a good possibility but i haven’t had a chance to experiment with it. But be assured i will certainly try it and your suggestions are more appreciated than i am able to express (my English is not half as good as yours). This kind of information i would have expected from Greg instead of his bitching.
[quote=326168:@Andre Kuiper]@Norman Palardy: Noone is talking about subverting, just a simple question is done to know a legal way to use a very basic command of javascript to use mouseevents and especially to reset event behaviour to the original behaviour. I had expected a bit supporting instructions from Greg, but obviously as i experienced before that’s not available for me.
[/quote]
Its not available to ANYONE - this is not JUST you
What you’re trying to do breaks the framework
Thats why what you’re doing IS unsupported
Hence Greg’s and my response to not do this
We have said repeatedly over the years that modifying the behavior of the built in controls is not supported. We can’t predict how anyone’s hacks will adversely affect its behavior. On top of that, we do change the structure and underlying behavior of our controls from time to time and there’s no way to know how your hacks will be affected there either.
As far as the WebSDK goes, yes we do expect you to use JavaScript there… on your own controls.
Andre, when I started experimenting in JavaScript a while ago, I did stumble upon misinformed tutorials which seemed to completely ignore local events, and systematically use listeners. IMHO this is just as bad as using global variables all over. I quickly hit the wall and did just like you do, broke the framework.
Then I looked at the way the framework is built by downloading framework.js. It is a good study.
You could use listeners, at the condition to forward the event to the framework. But that is kind of messy.
I have not used listeners for some like 3 or 4 years. I systematically use local events, and have not had any trouble since.
Typically, here is how I add mousedown to a local control :
me.executeJavaScript("document.getElementById('"+me.controlID"+"').setAttribute('onmousedown', 'myFunction()');")
As you see, refactoring is minimal.
As i said before, it is a websdk control and it is mine, but adding an addeventlistener for mousedown has side effects on how e.g. a listbox acts upon a mousedown.
MIchel you are an angel, allways trying to help!
Many, MANY THANKS !!!
I will try it tomorrow, my energylevel at the moment is below zero.
@Michel Bujardet , sorry to be so late back to the party ( i have been sick and am still slowly recovering), but i have given your solution a small try and it works exactly as i wanted. It was just as you said, in most books about JS the ‘SetAttribute’ and the ‘GetAttribute’ are hardly mentioned and not explained.
I am very glad you put me ontrack again.
Thanks for all your efforts to help me.
You’re welcome Andre. Glad to hear you are feeling better