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
Contributor
Posts: 34
Registered: ‎12-20-2010
My Device: DevAlpha Beta 2
My Carrier: Orange

Page CustomControl visibility listener

Hello,

 

I have a very simple question.

Is there any way to know when a Page and/or CustomControl is becomining visible/invisible to the user.

For instance, when I create a TabbedPane, I create all the Pages for all the Tabs. What I would like to know is if it exists a way to know, when the user has selected a Tab, that the Page associated with the Tab is becoming visible.

 

Of course, I could track the Tab event and then try to figure out what screen should have become visible to the user. However I would like to know if there is some signal or something emited by the Page/CustomControl itself to track the visibility.

 

Thank you

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

Re: Page CustomControl visibility listener

Not sure if this is exactly what you are looking for but some of the signals associated with visual node, especially onVisibleChanged signal might be worth playing around with.

 

https://developer.blackberry.com/cascades/reference/bb__cascades__visualnode.html

 

Please let us know if this works for you

 

Graham

Contributor
Posts: 34
Registered: ‎12-20-2010
My Device: DevAlpha Beta 2
My Carrier: Orange

Re: Page CustomControl visibility listener

Hello,

 

Thank you, this isn't exactly what I was looking for.

Indeed, I think this is used for instance for sheets that you will set as visible or not.

Here, I just switch tabs and when I press a tab, the Page displayed doesn't send the signal "visibleChanged".

 

Just to let you know, this is how I tried :

In my case, I have a CustomControl class that I use to set the content of a Page.

so I connect the signal with my slot like this :

connect(this, SIGNAL(visibleChanged(bool)), this, SLOT(visibilityDidChange(bool)));

 

When I select a Tab and my page becomes visible,  my slot isn't called.

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

Re: Page CustomControl visibility listener

It was worth a try - I will do some investigation today and see if I can come up with an answer for you.

 

Graham

 

Contributor
Posts: 34
Registered: ‎12-20-2010
My Device: DevAlpha Beta 2
My Carrier: Orange

Re: Page CustomControl visibility listener

Yes, 

 

Thank you.

Highlighted
Developer
Posts: 526
Registered: ‎05-17-2009
My Device: 9900
My Carrier: ATT

Re: Page CustomControl visibility listener

You should use the activeTabChanged signal and wait to set up the contents of your tab until that signal is fired for the tab.

Like all of my posts
Developer
Posts: 64
Registered: ‎07-15-2008
My Device: Z10
My Carrier: Rogers

Re: Page CustomControl visibility listener

this would be a really great feature to have.. it would let you load images in scrollers only as they become visible as well. Anyone found a hidden signal or work around?