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 Contributor
Posts: 4
Registered: ‎02-23-2010
My Device: Bold 9700
My Carrier: Vodafone UK

Autocomplete fields in a widget

Hi all

 

I'm trying to create a google-suggest style autocomplete field in my blackberry widget. For performance, I would prefer not to have to call the server for suggestions on every key press. I have a list of items that the autocomplete can choose from (c. 2500) which I would like to store locally.

 

My question is - what's the best way to achieve this in widget? Should I use jquery (which seemingly has a large overhead) or try to write an extension to the blackberry autocomplete field? Or maybe there's a more efficient way using sqlite?

 

Grateful for any suggestions.

 

Thanks!

 

Ben

Retired
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: Autocomplete fields in a widget

Have you checked out the HTML5 datalist field that is available in 5.0?

 

http://devblog.blackberry.com/2010/03/use-html5-in-your-blackberry-web-content/

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
New Contributor
Posts: 4
Registered: ‎02-23-2010
My Device: Bold 9700
My Carrier: Vodafone UK

Re: Autocomplete fields in a widget

I haven't - but I will do now!

 

Thanks!

New Contributor
Posts: 4
Registered: ‎02-23-2010
My Device: Bold 9700
My Carrier: Vodafone UK

Re: Autocomplete fields in a widget

[ Edited ]

Hmmm. Perhaps it's me, but I can't seem to get this to work reliably in the simulator.

 

<div>
<b>Test list:</b><br/>
<input id="a" name="b" list="lstS" />
<datalist id="lstS">
          <option label="G" value="Abc">
          <option label="D" value="Def">
          <option label="L" value="Ghi">
          <option label="E" value="Jkl">
          <option label="W" value="Mno">
</datalist>
</div>

 

Thae datalist displays, but the rest of the items on the screen have gone! Also, using typeahead and then scrolling down to select an item seems to crash the browser.

EDIT: I should also add that I have over 2500 possible entries for my datalist - the list seems to want to display on load so I think that could also cause a few problems!!

 

The simulator is Bold 9700 (5.0.0.469)

 

Any tips anyone?

 

Thanks

 

Ben

 

Highlighted
Contributor
Posts: 33
Registered: ‎07-08-2010
My Device: Bold 9700/9900 - Playbook v2.0.xxx
My Carrier: Telus

Re: Autocomplete fields in a widget

Same here. Bold 9700 and the Storm2 with 5.0.0.496

 

Looks like a nice feature that I could use but does not seam stable.