Bug in focussing and disabling tabs on tabpane by scripting?

Hi,

I’m experiencing the following problem (Windows OS, 1.2RC4 &1.2RC5):

I have a form with two tabpanels with both the same two tabs. Next to these tabpanel I have one field, with a Global Variable attached to it. The Global Variable has a custom value list attached. The following Onchange method is attached to this field:

if ( globals.LinkType == ‘Receipt to Receipt’ )
{
elements.ReceiptsLeft.setTabEnabled(1,true);
elements.ReceiptsLeft.tabIndex = 1
elements.ReceiptsLeft.setTabEnabled(2,false);
elements.InvoicesRight.setTabEnabled(1,false);
elements.InvoicesRight.setTabEnabled(2,true);
elements.InvoicesRight.tabIndex = 2
}
else if ( globals.LinkType == ‘Receipt to Invoice;’ )
{
elements.ReceiptsLeft.setTabEnabled(1,true);
elements.ReceiptsLeft.tabIndex = 1
elements.ReceiptsLeft.setTabEnabled(2,false);
elements.InvoicesRight.setTabEnabled(1,true);
elements.InvoicesRight.tabIndex = 1
elements.InvoicesRight.setTabEnabled(2,false);
}
else if ( globals.LinkType == ‘Invoice to Invoice;’ )
{
elements.ReceiptsLeft.setTabEnabled(1,false);
elements.ReceiptsLeft.setTabEnabled(2,true);
elements.ReceiptsLeft.tabIndex = 2
elements.InvoicesRight.setTabEnabled(1,true);
elements.InvoicesRight.tabIndex = 1
elements.InvoicesRight.setTabEnabled(2,false);
}
globals.ID1_ID = null;
globals.ID2_ID = null;
globals.ID1_Amount = null;

The idea of this method is that of both tabpanels only one tab is enabled and has focus.

What happend is that after one or two times changing the Global Variable LinkType (thus triggering the above script) some parts of either one of the tabpannels gray out and cannot be clicked into. When I then change GV LinkType again, the same or the other tabpanel is getting this problem.

Is there something I’m doing wrong with my scripting, or have I found a bug here?

Thanx in advance,

Paul

Anyone?

Can you send me a copy(export file) of your solution?

Sorry, I wasn’t logged in.

Looking into this..

note:
If you hide your tabs you don’t have to use..
elements.ReceiptsLeft.setTabEnabled(1,false);
elements.ReceiptsLeft.setTabEnabled(2,true);
etc…

:D

I just changed to this type of Tabpanel view this morning

The problem why your script isn’t working is because you’re trying to activate one form at the same time in both tabPanels.

eg.
elements.ReceiptsLeft.tabIndex = 1
elements.InvoicesRight.tabIndex = 2

solution:
1)duplicate form receipts_for_match
2) rename to receipts_for_matchLEFT and receipt_for_matchRIGHT
3) use the first one only for your LEFT tabpanel and the 2nd one only for your RIGHT tabPanel

Duplicating forms isn’t very elegant (reminds me of some other database ;) ) but for now it’s the only way.
We’ll try to come up with a better solution in the meantime.

OK, thanks for the help. I’ll solve it this way for now.

Looking forward to the elegant solution… :wink: