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
Highlighted
New Developer
Posts: 81
Registered: ‎03-22-2013
My Device: 9900,9930,9790,9780,9330
My Carrier: Blackberry
Accepted Solution

Fields are not getting refresh for common bottombar

Hello All,

 

In my app I have created one common bottombar for all scrrens same as e.g  of buttonField given in below link.

 

http://stackoverflow.com/questions/16798908/a-buttonfield-to-be-displayed-on-all-the-screens-of-blac...

 

I have added one guage,labelfield for displaying timer,play and pause button image which is added in one horizontalfieldmanager . This manager is common for all screens. When i click on any song . Song is getting play

and guage is moving accordingly.

My problem is that when i play any song from one screen as A screen  all works perfectly(as guage is moving,label showing correct time). But when i pop current scrren (i.e A). Screen below as e.g B getting displayed . But the contents of this is not getting refresh.

 

Please reply.

Thanks in Advance

 

 

 

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

Re: Fields are not getting refresh for common bottombar

Fields can only be displayed in one screen at a time - they only have one Manager.  So if you have two screens both with bottombars, then you have two different bottombars. 

 

Presumably you have, in Screen A, set up a call back of some other 'wiring' to update the contents of the bottombar in that Screen.  When you swap to Screen B, it has a different bottombar which is not wired up.

 

AFAIK, you have two possible solutions:

 

a) Change your processing so that when you swap from Screen A to Screen B, you remove the bottombar from Screen A and use it in Screen B.  SImilarly when you pop Screen B to return to Screen A, you update the bottom bar again.

 

b) Alternatively have just one screen, and instead of swapping screens to go from A to B, swap the contents of the screen.  One option is to have a VFM A and VFM B, so swapping from screen A to screen B involves removing VFM A and adding VFM B.

 

It is not possible for me to help you choose which of these two methods will be best for you, as it depends on the application and how you are trying to write it. 

New Developer
Posts: 81
Registered: ‎03-22-2013
My Device: 9900,9930,9790,9780,9330
My Carrier: Blackberry

Re: Fields are not getting refresh for common bottombar

Thank Peter,

 

Solution b will not works for me because i have added same bottom player in multiple screens(more than 10 screens).

 

If i go through solution a then my concerns is that how to get current instance of bottmplayer to delete or add.

 

Please provide any solution for the same.

 

 

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

Re: Fields are not getting refresh for common bottombar

"how to get current instance of bottmplayer to delete or add"

 

Sorry I don't understand why this is a problem. 

 

In the first screen that is displayed you will create it and have a reference to it.  This same reference will be passed to the other screens. 

New Developer
Posts: 81
Registered: ‎03-22-2013
My Device: 9900,9930,9790,9780,9330
My Carrier: Blackberry

Re: Fields are not getting refresh for common bottombar

Thanks Peter,

 

I have  gone through solution a and it works. Previously i confused so i asked about current instance . But no need of that i have deleted hfm before calling add method .