Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Regular Contributor
Posts: 62
Registered: ‎12-03-2010
My Device: Bold 9000
My Carrier: Software Enginear
Accepted Solution

navigational issue

Hi,

 

I have created on defualt listfield and i have add image with text but when i select one listfield it is not selecting here is my code.please check any problem is their in this code

 

protected boolean navigationClick(int status, int time)
       {
        Field field = this.getFieldWithFocus();
           if(field instanceof ListField)
           {
               int selected = listfield.getSelectedIndex();
               switch (selected) {
            case 0:
                UiApplication.getUiApplication().pushScreen(new IFHomeScreen(m_bApp));
                break;
            default:
                break;
            }
              return true;
            }
           return super.navigationClick(status, time);
       }

 

Thanks

Developer
Posts: 466
Registered: ‎03-04-2009
My Device: 8520
My Carrier: some

Re: navigational issue

Have this method overrided for your ListField.

Got resolved! Press kudo icon!
Regular Contributor
Posts: 62
Registered: ‎12-03-2010
My Device: Bold 9000
My Carrier: Software Enginear

Re: navigational issue

Hi,

 

Yes i have overrided the navigation method but it is not selecting the listfield, please tell me what i am missing in this code

 

protected boolean navigationClick(int status, int time)
       {
        Field field = this.getFieldWithFocus();
           
           if(field instanceof ListField)
           {
            
               int selected = listfield.getSelectedIndex();
               switch (selected) {
            case 0:
                UiApplication.getUiApplication().pushScreen(new IFHomeScreen(m_bApp));
                break;
            
            
            default:
                break;
            }
              return true;
            }

           return super.navigationClick(status, time);
       }

 

Thanks

Developer
Posts: 466
Registered: ‎03-04-2009
My Device: 8520
My Carrier: some

Re: navigational issue

while debugging are you able to jump into your method's body?

Got resolved! Press kudo icon!
Regular Contributor
Posts: 62
Registered: ‎12-03-2010
My Device: Bold 9000
My Carrier: Software Enginear

Re: navigational issue

hi,

 

 

 

No.i dont know why it is not going into navigation method.

Developer
Posts: 466
Registered: ‎03-04-2009
My Device: 8520
My Carrier: some

Re: navigational issue

try to create your List like follow example:

 

myList = new ListField() {
			protected boolean navigationClick(int status, int time) {
				
				int ind = myList.getSelectedIndex();
				// do your stuff there

				return true;
			}
		};

 

 

 

Got resolved! Press kudo icon!
Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified
Contributor
Posts: 49
Registered: ‎12-21-2010
My Device: 9000 Bold Device
My Carrier: software developer

Re: navigational issue

Hi,

 

you have solved my issue,thank you very much.

 

Thanks a lot

Highlighted
Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: navigational issue

Great - can you mark this Thread as solved please?