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

Native Development

Reply
Developer
Posts: 125
Registered: ‎06-19-2012
My Device: PlayBook + Red Z10 + BB10 Dev Alpha C
My Carrier: none
Accepted Solution

more signals for AbstractPane

I would like AbstractPane to emit a signal when it is pushed on or popped from the view stack. This will have many uses for everybody, but a specific usage that I have is that my Pane currently connects to signals from other classes (and does a lot of work when it receives a signal), and I would like to call disconnect when the Pane is not visible, to avoid the heavy computations that are only relevant when the Pane is visible.

 

Currently, only NavigationPane emits signals, for instance when the top changes, but this tells you only what the new top is, not which view has just disappeared. I can of course subclass NavigationPane, keep a shadow copy of the view stack, and emit an appropiate signal for the disappearing Pane and the appearing Pane, but the best place for this code is in Cascased itself, not in my code.

Developer
Posts: 125
Registered: ‎06-19-2012
My Device: PlayBook + Red Z10 + BB10 Dev Alpha C
My Carrier: none

Re: more signals for AbstractPane

I have subclassed Pane and have added 4 functions that are called by an (also subclassed) NavigationPane at the approriate times.

 

public: virtual void viewWillAppear() { }

public: virtual void viewWillDisappear() { }

public: virtual void viewDidAppear() { }

public: virtual void viewDidDisappear() { }

 

If you use this class as the base class of your Page objects, you can simply overwrite any of these functions, without having to add any boiler-plate code. Anyone interested in the code can send me a message.

 

Retired
Posts: 138
Registered: ‎05-11-2012
My Device: Developer
My Carrier: Developer

Re: more signals for AbstractPane

 

Please request a feature in Issue Tracker: http://supportforums.blackberry.com/t5/Java-Development/Developer-Issue-Tracker/td-p/271768

 

 

Ideally these signals should be emited from the NavigationPane rather than the AbstractPane as AbstractPane is too general and does not control when pages are being shown or hidden.

 

 

Highlighted
Developer
Posts: 125
Registered: ‎06-19-2012
My Device: PlayBook + Red Z10 + BB10 Dev Alpha C
My Carrier: none

Re: more signals for AbstractPane

In my implementation they do, and the constructor of the subclass of Page connects all 4 new signals to virtual functions.