Button Becomes Visible On Multiple Tabs

Brady Fearnow

New Member
I have form logic to make a button, which resides on the 2nd tab, visible if a checkbox is selected (it is by default) which is also on the 2nd tab. The problem is that on startup the button shows visible on the first tab. Any ideas? Thanks.
 

OliverR

Member
Hi, I noticed this exact same problem last week. I was going to make a post about it here, but you saved me the trouble.

This looks like a bug to me. To clarify for the devs: if you use form logic to make a button visible, the button will become visible on whichever tab you are currently on when the form logic rule gets executed, even if that is not the tab that the button is on. Only after you switch to the actual tab that the button is on, does the behaviour return to normal, ie. after that it is no longer visible on other tabs.
 

Dan Peluso

Member
Staff member
Hi,

Without seeing your project, my first guess would be that the button is not actually a "child control" of the tab control. You can test this by trying to move the button off of the tab control. If you are able to move it off the tab control and still see it, that tells me that it is not attached to the tab control.

You can either delete this control and add a new button while the tab control is selected or you can cut/paste this existing button being sure to select the tab control before pasting.

Please let us know how you make out.
 

OliverR

Member
Hi Dan, I've finally had some time to do some more testing with this. The buttons in my application are, in fact, child controls of the tab control. I've made a simple app to try and reproduce this behaviour. I've attached a .tpe file to this post.

Tab 1 contains 2 fields. Tabs 2 and 3 both contain 1 button. The button on Tab2 becomes visible when the fieldvalue of Field1 is changed, the button on Tab3 becomes visible when the fieldvalue of Field 2 is changed.

It works fine the first time after launching TracerPlus. However, when you exit and then reopen the session, the buttons will appear on Tab1 when you enter values into the fields.

I've reproduced this on a WM Emulator and a Motorola ES400 device running WM6.5.

Can you take a look at this and see if you get the same behaviour?
 

Attachments

Dan Peluso

Member
Staff member
Hi,

I am actually able to reproduce some portion of this. Very odd really. What I am seeing is that everything works fine the first time as you mentioned but then when changing data in either Field 1 or Field 2, the button assigned to become visible becomes immediately visible on Tab 1 *until* you actually select the tab page for the button. Once you select that tab page, the button visible behavior works correctly again.

At first glance, this certainly looks like a bug; either in TracerPlus or some strange MS Windows behavior. I will have our dev team take a further look at this.
 

Dan Peluso

Member
Staff member
Hi,

We have been able to confirm this as a Windows drawing issue as it relates to child tab pages and their sub components. I have marked it for fixing in v10 but, in the meantime, I have what looks to be a usable workaround. The basic idea is to use the SetPosition action as oppposed to set visible. So, when field value changed is fired, it will set the position of the button to somewhere visible on the screen. During the form initialize event, it sets the initial position to be somewhere off screen. I also had to default the .visible property to be true of course.

Let me know if this works for you. It seems to work for me.
 

Attachments

OliverR

Member
Thanks for the feedback, Dan. That workaround should do the trick nicely in the meantime, I hadn't thought of that.

Thanks a bunch!
 
Top