大家好,我坚持一个问题。我在一个屏幕中实现了一个ListField
。在屏幕上方,我使用了一个HorizontalFieldManager
来保存TitleLabel and Two Butons
。我已经在列表字段的所有行上推入了一些屏幕。我的问题是,letSuppose当我在第四行,我选择了我想要的然后当我点击按钮,然后按钮工作,但我已经在第四行实施的屏幕也出现如何避免它。我正在Storm 9550模拟器上测试它,并使用Blackberry eclipse plugin5.0。我没有想法,请帮助我。ListField和按钮焦点问题在同一屏幕
导航点击,就如同这
protected boolean navigationClick(int status, int time) {
selectListAndButton();
return true;
}
//这里是selectListAndButton方法
private selectListAndButton(){
Field field = getFieldWithFocus().getLeafFieldWithFocus();
if(field == backCustomButton){
//Popped the active Screen
}else if(field == saveCustomButton){
//Saving some Data to the Database And pushing another Screen here
// problem comes here if i am at 2nd row of the listfield and selects
something from there and clicked on the button the screen which was
implemented at 2nd row also appears
}
else if (_list.getSelectedIndex() == 0){
//Called a date picker
}
else if (_list.getSelectedIndex() == 1){
//Pushed some another screen
}
else if (_list.getSelectedIndex() ==){
//Pushed some another screen
}
什么是'isTouchInside()'方法你可以探索多一点,为什么它不工作'navigationclick' – BBdev 2012-01-09 08:23:37
的TouchEvent方法将调用navigationClick默认。他们使它与旧代码兼容。这工作非常好,除非你在控件/屏幕上重写navigationClick方法。我没有调试你的代码,但看起来像触摸事件不会调用onFocus为您的按钮或它在UI线程队列和navigationClick聚焦获得它之前的进程。 – 2012-01-09 21:01:35
好吧,只要它能为我工作,我会给你一个kudo和+1,试图解释我thanx ... – BBdev 2012-01-10 03:57:44