08-18-2008 07:19 AM - edited 08-18-2008 12:57 PM
Hey everyone,
I wanted to know, what is the status of undocumented API's on the blackberry?
I want to use TextField.autoSelectFullText(). It works well, but isnt documented.
What are the risks? is there an alternative to using this message to select all the contents of a TextField?
Solved! Go to Solution.
08-18-2008 10:40 AM
Undocumented methods should not be used. They can change or be removed at any time.
Can you describe what you are trying to accomplish? With that we may be able to provide an alternative option.
08-18-2008 11:03 AM
Can you describe what you are trying to accomplish?
08-18-2008 11:49 AM
This can be done by calling setCursorPostion(0), then calling the select method and passing in true and then calling setCursorPostion again and passing in the text length.
08-18-2008 12:53 PM - edited 08-18-2008 01:02 PM
like this?
fEditField.setCursorPosition(0);
fEditField.select(true);
fEditField.setCursorPosition(EditField.getTextLeng
because it dosnt work.
it just puts the cursor at the end.
I checked it now with just fEditField.select(true);
calling this method didnt enter select mode.
08-18-2008 02:50 PM
Yes that should work. I tried it in the BlackBerry Simulator included in the version 4.5.0 BlackBerry JDE. What version are you using?
08-18-2008 02:53 PM - edited 08-18-2008 03:03 PM
i use the eclipse plugin, JDE 4.3.
for backwords compatability reasons.
i have the JDE 4.6 Beta installed, Ill check if it works with that for me.
08-18-2008 03:11 PM
I tried it in the version 4.3.0 BlackBerry JDE and it worked there as well. In my test, I was overriding the keyChar method of EditField to execute the same code if a specific key was pressed.
From where are you trying to call this code from? Does the field have focus at the time (required to select)?
08-18-2008 03:27 PM
I'm doing this within the constractor for my class.
Before calling it i call field.setFocus()
fEditField= new EditField("Name: ", strName);
add(fEditField)
if (selectTitle)
{
fEditField.setFocus()
fEditField.setCursorPosition(0);
fEditField.select(true);
fEditField.setCursorPosition(fCardName.getTextLeng
//fEditField.autoSelectFullText();
}
and i tried on 4.6 beta and that didnt work too...
any idea?
08-18-2008 03:53 PM