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

HP / Agilent 16500A Mainframe Logic Analyzer
$99.99
HP / Agilent 16500A Mainframe Logic Analyzer pictureHP Agilent 8709A Synchronizer + Opt K32 Phase Lock Controller In Mainframe
$299.95
HP Agilent 8709A Synchronizer + Opt K32 Phase Lock Controller In Mainframe pictureTektronix TM506 High Power Compartment Mainframe Rack Mount
$99.95
Tektronix TM506 High Power Compartment Mainframe Rack Mount pictureHPAgilent E1421B 6-Slot MainFrame W/ E1406A & E1740A Time Interval Analyzer
$300.0
HPAgilent E1421B 6-Slot MainFrame W/ E1406A & E1740A Time Interval Analyzer pictureHP 70205A Graphics Display, 70001A Mainframe, 70590A OPT H69 Test Module Adapt.
$49.99
HP 70205A Graphics Display, 70001A Mainframe, 70590A OPT H69 Test Module Adapt. picture






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