- This topic has 9 replies, 3 voices, and was last updated 11 years, 9 months ago by mreade.
-
AuthorPosts
-
mreadeMemberSupport,
I recently packaged an iOS app and i have this installed on my iPhone 5. After installing the app, I have noticed that there are times when i need to “double-tap” the push buttons to perform the command, or to clear the fields.
Any thoughts why this might be so?
Thanks
mreade
support-octavioMemberIs a web app or native app?
Could you try build a simple example and check if this behavior is the same?
Could be that maybe your device is not recognizing when you tap it?
mreadeMemberHello Octavio,
It was built as a Native App. If I recall, it was doing the same when I was testing it through the Test Center as well as after installing the ipa setup file.
mreade
WaylandDavisMemberHi.
This may be the “delay” of 300 microseconds that iOS puts in their “clicks.” I was running into what I thought was a need to double click, but instead it was a delay. I fixed it with the “TAP” from jquery.mobile.js.
Used that mobile file and here’s the event I added in the phoneui.documentReadyHandler = function() area:
$(“m1-SPC-btn20pct”).tap(function(event)
{
if(cordovaready == true) {
navigator.notification.vibrate(1000); // this just vibrates when btn pushed
}
event.preventDefault(); // turns off the old 300 ms delay.
});
mreadeMemberThanks Octavio,
So, just so I completely understand your last post.
Do I use exactly the same code snippet you have provided? Do I need to change anything?
Do I need to add any javascript commands to the push buttons? Or, just add the code snippet to the phoneui.documentReadyHandler = function() area?
Thanks in advance.
mreade
WaylandDavisMemberI’m not Octavio – I’m wildwex…anyway.
You need to use the code for each button or other element you intend to Tap.
$(“Your-button-name-here“).tap(function(event)
{
if(cordovaready == true) {
navigator.notification.vibrate(1000); // this just vibrates when btn pushed
}
event.preventDefault(); // turns off the old 300 ms delay.
});Hope it helps.
wildwex
mreadeMemberThanks for the reply.
Although I cannot see the yellow text too good, i can copy and paste it to see what you have typed.
Many thanks,
mreade
mreadeMemberWildwex,
I have a “Clear” “Calculate” “Email” push button on several forms. The Clear button on call forms is ID: push1, The Calculate button on call forms is ID: push2, and the Email button on all forms is ID: push3
Will I need to create 1 snippet of code for each of the 3 push buttons, for each form?
In other words,
Form1 = 3 push buttons, 3 separate snippets of code
Form2 = 3 push buttons, 3 separate snippets of code
Etc.Or, can i prepare 3 snippets of call (1 for each push button) that will apply to all “push1” buttons on all forms, etc.
I have 25 forms x 3 push buttons on each form for a total of 75 push buttons
25 forms have 1 push button called “push1”
25 forms have 1 push button called “push2”
25 forms have 1 push button called “push3”I am just trying to explain this with as much detail as possible to make sure i get this right. So bare with me….
Form1:
$(“m1-Form1-push1”).tap(function(event)
$(“m1-Form1-push2”).tap(function(event)
$(“m1-Form1-push3”).tap(function(event)Form2:
$(“m1-Form2-push1”).tap(function(event)
$(“m1-Form2-push2”).tap(function(event)
$(“m1-Form2-push3”).tap(function(event)Form3:
$(“m1-Form3-push1”).tap(function(event)
$(“m1-Form3-push2”).tap(function(event)
$(“m1-Form3-push3”).tap(function(event)Form4, Form5, etc.
Etc…………..
I am wondering if it is possible for the MobiOne developers to built a new property into the Push Button Widget so users could set time event if/when required?
Thanks in advance
mreade
WaylandDavisMemberHi,
I’m still a little new to jQuery and Javascript, but here is a snippet I use to handle multiple buttons in another app:
elem = document.body.getElementsByTagName(‘*’);
for(c=0;c<elem.length;c++)
{
elem[c].css(“z-index”, “0”); // This sets all Z positions to 0.
elem[c].css(“position”, “fixed”); // Keeps things from moving around.
$(elem[c]).tap(function(event) // Fix “click” to be a tap to get rid of 300 ms delay.
{
if(cordovaready == true) {
navigator.notification.vibrate(1000); // Vibrate when user select items for feedback.
}
event.preventDefault(); // Prevents the normal click actions, i.e. delay.
});}
I’m thinking there may be a jQuery wildcard using $(“[id^=m1-Form]”) that you can use and iterate through all the buttons in the entire document.
mreadeMemberThanks Wildwex, you are certainly much more advanced that me at this point! 🙂
Maybe we can get Support to chime in on this?
Support???
Thanks
mreade
-
AuthorPosts