BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 04-13-2009, 03:15 PM   #1 (permalink)
Thumbs Must Hurt
 
Join Date: Jun 2008
Model: 8820
PIN: N/A
Carrier: AT&T
Posts: 72
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default how can I select text in a TextField programatically?

Please Login to Remove!

I have a TextField and after setting its contents (with setText()) I want to select part of it. How can this be done from the TextField API?
Offline  
Old 04-13-2009, 06:05 PM   #2 (permalink)
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Post Thanks: 0
Thanked 34 Times in 33 Posts
Default

Why don't you just use getText() to retrieve the current string and create a new string with the part of the string that is of interest?
Offline  
Old 04-13-2009, 06:16 PM   #3 (permalink)
Thumbs Must Hurt
 
Join Date: Jun 2008
Model: 8820
PIN: N/A
Carrier: AT&T
Posts: 72
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

When I say "select" I mean that the string (or part thereof) is both highlighted and will be captured by the framework if the user does a copy. Further more, any typing would immediately replace the selected text.
Offline  
Old 04-13-2009, 07:00 PM   #4 (permalink)
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Post Thanks: 0
Thanked 34 Times in 33 Posts
Default

I don't see any support for this in the API.

However, I imagine this can be accomplished by utilizing event injection to simulate the required keystrokes.
Offline  
Old 04-19-2009, 11:58 AM   #5 (permalink)
New Member
 
Join Date: Apr 2009
Model: 9530
PIN: N/A
Carrier: no
Posts: 12
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

i want to see
Offline  
Old 04-19-2009, 01:53 PM   #6 (permalink)
Thumbs Must Hurt
 
Join Date: Jun 2008
Model: 8820
PIN: N/A
Carrier: AT&T
Posts: 72
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

I had asked the same question on the RIM BB Forum. It was suggested by someone to override the TextField and call MoveFocus (or Navigate??- don't recall full method name right now). One person said they tried it and it work. I have not had the time to come back to this issue yet.
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Inter-tel Axxess 550.5321 UC/SIP SW Ver WIN2K Server
$2199.0
Inter-tel Axxess 550.5321 UC/SIP SW Ver WIN2K Server pictureAutumn Flowers waitress server waiter waist apron 3 pockets
$11.0
Autumn Flowers waitress server waiter waist apron 3 pockets pictureAvaya S8300D Media Server 700463532
$299.99
Avaya S8300D Media Server 700463532 pictureLOT OF (3) "BUNN" H.D. COMMERCIAL SS (NSF) 1.5gal COFFEE DISPENSERS/SERVERS
$59.99
LOT OF (3) "GLAS TENDER" SS REFRIGERATED ICE CREAM/DESERT SERVER STATION W/DIPPING WELL
$699.99






Copyright 2004-2016 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.