PDA

View Full Version : deep check on Component.isVisible()



re_buchanan
1 Nov 2010, 1:05 PM
is there a reason that the "isVisible()" method on a component doesn't accept and pass on the "deep" parameter?

Thanks

Condor
2 Nov 2010, 2:32 AM
No reason, just nobody needed it until now.

You are free to override the isVisible method if you want to.

re_buchanan
2 Nov 2010, 4:30 AM
cool - follow-up question: does my needing it make you think I might be doing something wrong?

Thanks

Condor
2 Nov 2010, 4:42 AM
OK, you've got me interrested. Why do you need it?

re_buchanan
2 Nov 2010, 6:15 AM
basically, I've got a card inside a card and the innermost card needs to behave differently whether or not it is visible (if it's visible, it takes action 'Z' - otherwise, it waits until it becomes visible/active and then takes action 'Z')

without the deep=true, the innermost card seems to think it is visible when it is the activeItem on the panel to which it belongs even if that panel itself is NOT active on the panel to which it belongs

if that doesn't make sense, I'll be glad to try to explain again

Condor
3 Nov 2010, 12:07 AM
But checking if the Element is visible isn't completely correct here. You should be checking if the component (and all it's ownerCt's) are on the activeItem of the container layout.