Welcome to the Official BlackBerry® Support Community Forums. This is your resource to discuss support topics with your peers, and learn from each other. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Java Development

Reply
New Developer
vishalkheterpal
Posts: 92
Registered: 01-11-2011

response for the checkbox selection

hi

   I am developing an app in which i want to use a checkBox and other button.But on click on the checkbox

did not responde when i override the navigation click for the button(other used in the app on that screen)

how to fix it.

 

CheckboxField myCheckbox = new CheckboxField("First checkbox", true);

        LabelField lf = new LabelField("Hello World!", Field.FIELD_HCENTER);
        
        Middle cfm=new Middle(2);
        cfm.add(lf);
        add(myCheckbox);
        add(cfm);

 

protected boolean navigationClick(int status, int time) {

       return true;
    }

 

Any help

 

Please use plain text.
Developer
peter_strange
Posts: 14,614
Registered: 07-14-2008

Re: response for the checkbox selection

You appear to have overridden navigationClick for the screen (i.e. all Fields on the Screen) rather than just for the button.  Put a break point in your navigationClick and see if it is invoked when you click on the CheckboxField. 

 

In fact there should be no need to override navigationClick for the Button - you should listen for a Button 'click' event using a fieldChangedListener. 

Please use plain text.