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.

inside custom component

Web and WebWorks Development

Reply
Contributor
ashokkonraiyandi
Posts: 13
Registered: ‎01-24-2012
My Device: 9860

Backbutton

Hi I,m using BB9860 on that when ever i hit the manual backbutton my application is exit i want it goes to the previous page how can i do that?,can any one instruct me? thank you

New Developer
yoghurt1001
Posts: 14
Registered: ‎07-31-2011
My Device: Bold 9900, Z10, Playbook

Re: Backbutton

Hey, i haven't used it myself but the documentation explains a SystemEvent onHardwareKey function where you can catch certain keys that are pressed and attach a function. Here is a code snippet from the api:

 

<script type="text/javascript">
function trapForBackKey() {
blackberry.system.event.onHardwareKey(blackberry.system.event.KEY_BACK, handleBack);
}

function handleBack() {
alert("handle back button");
}
</script> 

Contributor
ashokkonraiyandi
Posts: 13
Registered: ‎01-24-2012
My Device: 9860

Re: Backbutton

Thank you i have an another doubt where i have to use this in phonegap or my js file

 

thank you

New Member
Jerlies
Posts: 1
Registered: ‎02-09-2012
My Device: Bold 9900

Re: Backbutton

What doubt?

Contributor
ashokkonraiyandi
Posts: 13
Registered: ‎01-24-2012
My Device: 9860

Re: Backbutton

Where i have to use that code in main.js or phonegap

New Developer
yoghurt1001
Posts: 14
Registered: ‎07-31-2011
My Device: Bold 9900, Z10, Playbook

Re: Backbutton

I'm not using phonegap but I think it only adds some additional features to the base api of webworks, so I would try to put it in the native javascript code (main.js in your case). 

Contributor
ashokkonraiyandi
Posts: 13
Registered: ‎01-24-2012
My Device: 9860

Re: Backbutton

Ok thank you let me check with that....

Contributor
ashokkonraiyandi
Posts: 13
Registered: ‎01-24-2012
My Device: 9860

Re: Backbutton

Hi

   

 Thank you the manual backbutton is working in webworks SDK 2.2 but not in 2.3 is there any one use with 2.3.1.

 The backbutton is working on the 2.3.1?

Can any one suggest me the solution.