Reputation: 1033
Something is driving me crazy on BlackBerry dev. I have a custom EditField
. Here is the code:
private EditField m_Txt=new EditField(EditField.FOCUSABLE |
EditField.FILTER_DEFAULT) {
protected void layout(int width, int height)
{
setExtent(Display.getWidth(), m_TxtHeight);
}
public boolean isFocusable()
{
return true;
}
protected void onFocus(int direction)
{
super.onFocus(direction);
invalidate();
}
protected void onUnfocus() {
super.onUnfocus();
invalidate();
}
};
The thing is that it cannot get the focus. Actually it does call isFocusable
etc. but the cursor doesn't show and I cannot write anything. I am surely missing something as I'm new to BlackBerry dev, but what ?
Thanks a lot
Upvotes: 0
Views: 1176
Reputation: 1033
I've actually found the answer. I totally forgot to call the super.layout method. So the layout method should be:
protected void layout(int width, int height)
{
super.layout(Display.getWidth(), m_TxtHeight);
setExtent(Display.getWidth(), m_TxtHeight);
}
Upvotes: 1
Reputation: 11876
What OS are you testing with? If it is a recent OS6 release, I've found in those versions you don't get a cursor in text edit fields until you enable select mode.
Upvotes: 1