Welcome!

Welcome to the Official BlackBerry Support Community Forums. This is your resource to discuss support topics with your peers, and learn from each other. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

BlackBerry WebWorks Contributions

Reply
Contributor
subhaMaz
Posts: 18
Registered: ‎02-18-2011
Accepted Solution

jQuery touchend and click is not working properly with BlackBerry Webworks(Touch and Non-touch)

[ Edited ]

Hi All

 

I am very new to blackberry webworks application development. I have started my application with jQuery mobile for all BB devices (touch, non touch, touch and type) of OS 6 and 7 with single codebase.

 

Here I have some issues related to button click and touchend event.

 

Basically touchend event is working with buttons for touch device(Torch 9810) but not working with non-touch device(Bold 9780), which is expected.

 

click is working fine for non-touch devices but for touch devices it not working properly. When I am touching button it is getting focus on first time then firing click event twice on second touch.

 

$('#loginpage').live( 'pageshow',function(event){
                    $("#loginButtonId").live("click", callLogin);
             });

 

function callLogin(event)
{

        // login logic here

}

 

Can anyone tell me, whats wrong here or any other tricks to resolve that issue.

 

Regards-

SubhaMaz

Please use plain text.
Developer
WebCreep
Posts: 235
Registered: ‎07-27-2012
My Carrier: Airtel

Re: jQuery touchend and click is not working properly with BlackBerry Webworks(Touch and Non-touch)

You need to place an invisible object like plane png image in order to scroll over the clickable part and then click that object
Please use plain text.
Contributor
subhaMaz
Posts: 18
Registered: ‎02-18-2011

Re: jQuery touchend and click is not working properly with BlackBerry Webworks(Touch and Non-touch)

Hi WebCreep

 

Thanks for quick reply.

 

I could not get your point properly. I am giving my HTML code here. Can you please explain how to implement "plane png image" in this HTML code here.

 

 

<a href="#" data-role="button" data-inline="true" data-theme="b" data-mini="true" id="loginButtonId" name="loginButtonName" x-blackberry-focusable="true">Login</a>

 

 

 

Please use plain text.
Developer
WebCreep
Posts: 235
Registered: ‎07-27-2012
My Carrier: Airtel

Re: jQuery touchend and click is not working properly with BlackBerry Webworks(Touch and Non-touch)

<a href="#" data-role="button" data-inline="true" data-theme="b" data-mini="true" id="loginButtonId" name="loginButtonName" x-blackberry-focusable="true"><img src="1.png" width="50" height="10"></a>

 

click webcreep.in/1.zip download this and see weather it works or no

if its not then tell me i will do one more and give

Please use plain text.
Developer
BrajeshSanodiya
Posts: 101
Registered: ‎08-03-2011
My Carrier: BlackBerry Developer

Re: jQuery touchend and click is not working properly with BlackBerry Webworks(Touch and Non-touch)

Hi

 

use the JQuery Mobile http://jquerymobile.com/blog/2012/07/12/jqm-1-1-1/

 

 

-----------------------------------------------------------------------
"Like" if you liked the post.
"Accept as Solution" if the post solves your question.
-----------------------------------------------------------------------
Please use plain text.
Contributor
subhaMaz
Posts: 18
Registered: ‎02-18-2011

Re: jQuery touchend and click is not working properly with BlackBerry Webworks(Touch and Non-touch)

This issue is supposed to be resolved.

Following code will give the idea-

 

var flag = false;

 

$('#loginpage').live( 'pageshow',function(event){
         $("#loginButtonId").bind("touchend click", callLogin);
});

 

function callLogin(event)
{
        if (!flag) {
            flag = true;
            setTimeout(function(){ flag = false; }, 100);
   
            // login code
        }
}

Please use plain text.