- This topic has 27 replies, 7 voices, and was last updated 11 years, 8 months ago by Unknown Author.
-
AuthorPosts
-
YannMemberHello,
a question, i’ve a simple button on a remote page calling by ajax whith a function onclick=”myfunction()”
examplefunction myfunction() { alert('Hello'); }
When i click on this button , my function is always called twice and I have two alerts 🙁
would you have an idea to force the execution once?
Thanks
Yann
support-michaelKeymaster0) what is your test environment that demonstrates this dbl click, e.g., Test Center 2.3.1, iphone/ios6, …?
1) Can you post a small project that demonstrates this issue?
YannMemberHello Wayne
i use Test Center 2.3.1, IOS 6 but if i compile my project on IOS i’ve the same problem.
Sometimes the function is called twice
i sent you by email an example, so i solved my problem by using<input type="button">
rather
<button></button>
Thanks
Yann
SonamGyatoMemberyeah ran into this problem also.
my “solution” was …
save the time when the callback is received.
if it’s within about 100 ms of the last call – disregard.
donijMemberOk……. it’s good someone else have this same experience.
I raised an issue titled “Duplicate entry for single List.append” in Getting Help – General. After a trace I discovered that the onclick event runs twice and that caused the double entry in the list. I use ver 2.3.1 also. The issue was there right from 2.3. When I hosted the app on a web server I don’t get the multiple click. The problem could be with Test center…… somewhere.
support-michaelKeymasterI investigate your example and did not observe dbl events, but as you indicated switching your dynamic html to use <button> instead of <input> may be the cure. Why does this occur is not clear yet. Planning to discuss this in more detail with dev team tomorrow.
YannMemberOk Wayne thanks you,
weird it does not happen every time, I am reassured that I am not alone.
Yann
donijMemberOk… I have changed mine too from <a> tag to <input type=”button”> and I now get a single click. Though what I needed is the <a> tag. Wayne-Octavio pls do the magic……help resolve the double click event for a single button click or <a> tag click. Clicking a list item does the double click too.
Thanks guys.
support-michaelKeymasterHelp me understand the context of your <a> usage. Is the redundant event firing happening in custom html that you have provided? For example @yanni is loading asynchronously loading a fragment of html and weaving it into the dom. His html fragement includes a button. How is your <a> implemented?
donijMemberYes wayne….. I build a list dynamically and inside each list item I have the <a> tag in a line like below
<a href=”#” class=”addtocart”> Add </a>
I made the replacement as in the colored part
<input class=”addtocart” type=”button” value=”Add”>
support-octavioMemberHi Yann, donij,
Dev team is investigating this issue, but we was able to replicate the issue only in Test Center. Could you share if you only got this problem in Test Center? if it happens in any other device could you share details such model and SO?
donijMemberNot tested in device. Works well when app is hosted on site but multiple clicks when in test center.
Cheers
support-michaelKeymaster> Works well when app is hosted on site but multiple clicks when in test center.
That is similar experience to our current testing. That is, problem seem isolated to the Test Center in our testing.
donijMemberHi Wayne,
we are looking forward to the solution. Life has been good with mobione. Can’t wait to see other features like camera support.
Thanks guys.
JohnJake2MemberHi all.
I am facing the same problem. I use an update button which deletes a table and then rebuild some infomation to store it back in the db.
Since my update button fires 0 to 5 times (depending on its mood) I sometimes have a mixture of old an new settings, sometimes the table is empty and other times I have my data two or three times.This is happening on the device (iPhone 4S). This little app is running as a web app (I did not test it as an iOS App yet).
The complete thing is similiar to this post: http://www.genuitec.com/support-genuitec/viewtopic.php?f=8&t=2715&hilit=button+event
When I let out myphoneui.preprocessDOM('#m1-Detail');
it works obviously. But letting out this code leads to the problem that my dynamic list that I use does not update the screen anymore. So scrolling down is a problem.
Are there any news concerning this issue?
JohnJake2 -
AuthorPosts