开发者

Blackberry ObjectListField on click

开发者 https://www.devze.com 2023-03-08 17:26 出处:网络
How to get selected row from blackberry objectlistfield, when user clicks on list it开发者_StackOverflow中文版em?getSelectedIndex()

How to get selected row from blackberry objectlistfield, when user clicks on list it开发者_StackOverflow中文版em?


getSelectedIndex()

You will also have to set the setChangeListener() and implement the corresponding methods like fieldChanged() and keyDown()

have you read the documentation before asking ? Do you have a more specific question ?


public boolean navigationClick(int status, int time) {
    Field focus = list.getLeafFieldWithFocus();
    Dialog.alert("Focus String :: " + focus.getIndex());

    if (focus instanceof ListField) {
        ListField listField = (ListField)focus;

        Dialog.alert("Selected Index"+listField.getSelectedIndex());
        Dialog.alert("Selected List Value"+listField.getCallback().get(listField,
            listField.getSelectedIndex()).toString());
    }
    return true;
}
0

精彩评论

暂无评论...
验证码 换一张
取 消