Bug in focussing and disabling tabs on tabpane by scripting?

Discuss all problems you have with Servoy here. It might help to mention the Servoy version and Operating System version you are using

Bug in focussing and disabling form by scripting?

Postby pbakker » Mon Oct 06, 2003 9:26 am

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
pbakker
 
Posts: 2822
Joined: Wed Oct 01, 2003 8:12 pm
Location: Amsterdam, the Netherlands

Postby pbakker » Tue Oct 07, 2003 8:58 am

Anyone?
pbakker
 
Posts: 2822
Joined: Wed Oct 01, 2003 8:12 pm
Location: Amsterdam, the Netherlands

Postby Guest » Tue Oct 07, 2003 9:25 am

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

Postby maarten » Tue Oct 07, 2003 9:26 am

Sorry, I wasn't logged in.
Maarten Berkenbosch
User avatar
maarten
 
Posts: 797
Joined: Wed Apr 23, 2003 10:52 pm
Location: Amersfoort, Netherlands

Postby maarten » Tue Oct 07, 2003 1:13 pm

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...
Maarten Berkenbosch
User avatar
maarten
 
Posts: 797
Joined: Wed Apr 23, 2003 10:52 pm
Location: Amersfoort, Netherlands

Postby pbakker » Tue Oct 07, 2003 1:15 pm

:D

I just changed to this type of Tabpanel view this morning
pbakker
 
Posts: 2822
Joined: Wed Oct 01, 2003 8:12 pm
Location: Amsterdam, the Netherlands

Postby maarten » Tue Oct 07, 2003 4:16 pm

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.
Maarten Berkenbosch
User avatar
maarten
 
Posts: 797
Joined: Wed Apr 23, 2003 10:52 pm
Location: Amersfoort, Netherlands

Postby pbakker » Tue Oct 07, 2003 4:24 pm

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

Looking forward to the elegant solution.... :wink:
pbakker
 
Posts: 2822
Joined: Wed Oct 01, 2003 8:12 pm
Location: Amsterdam, the Netherlands


Return to Discuss possible Issues and Bugs

Who is online

Users browsing this forum: Bing [Bot] and 5 guests