1

I am trying to create a customized list field where, I have more then 2 clickable buttons in each row. For that i have customized the HorizontalFieldManager and created own manager to align the field elements. Now UI is perfectly fine.

But, I am struggling to handle the events work for both.

Step-1 I have used fieldChangedListener for buttons added in row. It is working fine

public void fieldChanged(Field field, int context) {} 

step-2 have used navigation click to handle event on the parent manager.

  protected boolean navigationClick(int status, int time) {
            Field field = getFieldWithFocus();
            Dialog.alert("shops field clicked");        
                return super.navigationClick(status, time);
        }

Now, even the navigationClick event works. But as the button is the child field added to VFM. When i click on the button both the VFM and button event comes together.

How could i restrict only to the button while it is clicked on the ButtonField.

4

1 に答える 1

2

私があなたの質問を正しく理解していればnavigationClick()、マネージャーに呼び出されるのではなく、子フィールド(クリック可能なボタン)に対してのみ呼び出されるようにします。失望させて申し訳ありませんが、できません。ナビゲーションクリックイベントは常にマネージャーに対して最初に呼び出され、マネージャーが子フィールドにイベントを伝播する場合にのみ呼び出されます。キーイベント、タッチイベント、フォーカスイベントなどにも同じことが当てはまります。

達成しようとしていることを説明し、コードスニペットを追加すると、解決策が見つかると確信しています。

于 2012-05-11T19:11:40.503 に答える