If you are using Internet Explorer, please remove blackberry.com from your compatibility view settings.

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
Developer
ankityadav4u
Posts: 231
Registered: ‎03-16-2011
My Device: 9700, 9550, and JDE
My Carrier: AIRTEL, BSNL

Design Issue......... managing screens

hello all, there is some desiign issue related to screen management.

 

i hv a tab header in all screens, on click any perticular button one specific screen is pushed. what i want is, to maintain only single instance of any perticular screen. But this gives a problem when user click on any button /tab more than once, multiple instance are created.

 

somehow i m solving it having static reference to one screen type, and on everyclick i check if it is not null i pop it, but when user returns (hard key return), the reference in not null but so it cannot be poped.

however it is also possible using overriding onClose method

 

but i m looking for any other, better approach,....................


available on: Monday to Friday, Indian standard (day) time : )
  • Give kudos by clicking on the star icon to say "Thanks!" if you feel this response is helpful.
  • Click "Accept as Solution" if this post was what you needed. so that people who are trying to help will not waste their time reading a thread where no help is needed.

Please use plain text.
Developer
peter_strange
Posts: 19,601
Registered: ‎07-14-2008
My Device: Not Specified

Re: Design Issue......... managing screens

I think you have two choices, though I'm sure other people will think of others,

 

1) Either maintain and cache a single instance of each screen, so the click does not create an instance, but instead swaps to that instance.

2) Create a new instance of the selected screen and discard the current screen

 

Either way you manage the swap from one to the next by pushing the new screen and popping the current screen.  You can't manage a 'tab using just popping when the screen is closed. 

 

I recommend (1). 

Please use plain text.
Developer
ankityadav4u
Posts: 231
Registered: ‎03-16-2011
My Device: 9700, 9550, and JDE
My Carrier: AIRTEL, BSNL

Re: Design Issue......... managing screens

oh, the same way i m doing , i said if its not null i m poping it,

but also creating the new instance with same reference and pushing it (this way m achiving some sort of caching )

 

it is ok, but  m looking if any better way is there.................


available on: Monday to Friday, Indian standard (day) time : )
  • Give kudos by clicking on the star icon to say "Thanks!" if you feel this response is helpful.
  • Click "Accept as Solution" if this post was what you needed. so that people who are trying to help will not waste their time reading a thread where no help is needed.

Please use plain text.
Developer
peter_strange
Posts: 19,601
Registered: ‎07-14-2008
My Device: Not Specified

Re: Design Issue......... managing screens

What would make it better?

Please use plain text.