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
New Developer
amitabhsh
Posts: 13
Registered: ‎10-16-2011
My Device: 9300
My Carrier: Vodafone

Event on click using trackpad on input box

hi All,

I am trying to have add a search box inside the app, to better utilize the space i intend to submit the search query once the user clicks on the input/search text box.

 <input type="text" id="search" style="width:80%;" align="center"  onclick="searchItems()"/>

function searchItems(){

alert("Search results");

}

 

 

I have created an onclick Event with the input box, but it is not working. Would appreciate if someone can point me in right direction.

Please use plain text.
Developer
SumiGhosh
Posts: 435
Registered: ‎09-20-2011
My Device: Z10 LE, Playbook, DevAlpha C, 9900, 9380
My Carrier: Vodafone

Re: Event on click using trackpad on input box

Hi,

 

use onblur or onchange................ 

Please use plain text.
New Developer
amitabhsh
Posts: 13
Registered: ‎10-16-2011
My Device: 9300
My Carrier: Vodafone

Re: Event on click using trackpad on input box

Sumi,

 

Onblur and onchange dont' get the desired result for example if a user presses back key that will also result into an onblur.

 

I am talking a search similar to the blackberry app world, i.e. you type in the text and click on the trackpad button again to search it.

 

 

Please use plain text.
New Contributor
pepe-el-toro
Posts: 2
Registered: ‎11-08-2011
My Device: 9700
My Carrier: 507-6944-5215

Re: Event on click using trackpad on input box

I got the same problem can anyone respond to this please.... I am using the " onkeypress " and detecting if the user tap on the "return" key on the keyboard but my client is not happy with that implementation... he want the user do a simple "click" in the texbox and do the action instead of pressing "enter"

Please use plain text.
BlackBerry Development Advisor (Retired)
jeffheifetz
Posts: 518
Registered: ‎07-18-2011
My Device: Bold
My Carrier: Rogers

Re: Event on click using trackpad on input box

Hi amitabhsh.

 

Can I get a little information about your problem.

 

Where is the code being run (e.g.. WebWorks App, Browser, BF2 App)?

What codeline are you seeing the issue on (e.g.. 5.0, 6.0, all)?

What devices are you seeing the issue on (e.g.. 9800, 9700)?



1.Please resolve your thread by clicking the "Accept as Solution" button below the post which solved your problem!
2. If any post helps you please click the button below the post(s)
Please use plain text.
New Developer
amitabhsh
Posts: 13
Registered: ‎10-16-2011
My Device: 9300
My Carrier: Vodafone

Re: Event on click using trackpad on input box

hi,

 

I am trying to implement this in a webworks application.


Device : Curve 9300

OS 6.0/5.0

 

It would be great help if you can point me out in the right direction.

Please use plain text.
BlackBerry Development Advisor (Retired)
jeffheifetz
Posts: 518
Registered: ‎07-18-2011
My Device: Bold
My Carrier: Rogers

Re: Event on click using trackpad on input box

I copied and pasted the code you had and have it working in a 9300 running 6.0 bundle 2808. Can you provide the exact bundles where it is failing?



1.Please resolve your thread by clicking the "Accept as Solution" button below the post which solved your problem!
2. If any post helps you please click the button below the post(s)
Please use plain text.
New Developer
amitabhsh
Posts: 13
Registered: ‎10-16-2011
My Device: 9300
My Carrier: Vodafone

Re: Event on click using trackpad on input box

Hey jeff,

 

         I am using 9300 , OS 6.0 bundle 2475.

 

I tried running it again, still not working. This works absolutely fine in the blackbery app world app that i am using, not sure what i am doing wrong in following code

 

 

<html>
<head>
<meta name="viewport"
	content="width=device-width, height=device-height, initial-scale=1.0, 'maximum-scale=1.0, 'minimum-scale=1.0, user-scalable=no" />
<script type="text/javascript">
</script>
<body>
<input type="text" onclick="alert('onclicktext');">
<br/>
<input type="text" onkeypress="alert('onkeypress');">
</body>
</html>

 

Please use plain text.
BlackBerry Development Advisor (Retired)
jeffheifetz
Posts: 518
Registered: ‎07-18-2011
My Device: Bold
My Carrier: Rogers

Re: Event on click using trackpad on input box

Hi amitabhsh,

 

I just tested on a 9300 running 6.0 bundle 2475 and was able to get the code working fine...

 

Maybe you can send me the cod file you generated to see if its in the app or perhaps your phone...



1.Please resolve your thread by clicking the "Accept as Solution" button below the post which solved your problem!
2. If any post helps you please click the button below the post(s)
Please use plain text.
New Developer
amitabhsh
Posts: 13
Registered: ‎10-16-2011
My Device: 9300
My Carrier: Vodafone

Re: Event on click using trackpad on input box

Hey jeff,

 

Many thanks for your inputs.. There is be no issue with the phone..Trackpad click is working with the blackberry app world as i already mentioned.

 

I have DM you link to the cod file, where the first textbox is onclick event and the sencond is onkeypress,please suggest what i am doing wrong in the app.

 

Please use plain text.