Switching tabs programmatically

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

Switching tabs programmatically

Postby maria.kyselova » Mon Mar 18, 2013 6:05 am

Hi All,

A simple operation throws "java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 1" when I switch between the tabs on a tabpanel.
The tabpanel has two tabs referring to the same table view form through two different relations.
If I remove either of the tabs - the form looks fine.
However, if I execute the line below, the exception is thrown:
Code: Select all
elements.tab_report_lists.tabIndex = elements.tab_report_lists.getMaxTabIndex();


Setting the tab index with a number (2) or the tab name as a string produce the same effect.

Bug?

Cheers,
Maria
Cheers,
Maria
maria.kyselova
 
Posts: 172
Joined: Thu Aug 09, 2012 12:56 am

Re: Switching tabs programmatically

Postby Andrei Costescu » Mon Mar 18, 2013 1:24 pm

This sounds a bit strange to me.
I'm thinking: if you have the first tab open with a set of related records, then you select records/work with those records, then you click on the second tab => another set of related records will be loaded. When you come back to the first tab should the other related set of records be re-loaded into the form? Selection kept and all?

I guess it would work if you used a clone for each tab instead of the same form instance. (either at designtime or at runtime with solutionModel)
But why do you need the same form in both tabs?
Andrei Costescu
Servoy
Andrei Costescu
 
Posts: 1018
Joined: Tue Jun 26, 2007 3:14 pm

Re: Switching tabs programmatically

Postby maria.kyselova » Wed Mar 20, 2013 3:42 am

Andrei Costescu wrote:This sounds a bit strange to me.
I'm thinking: if you have the first tab open with a set of related records, then you select records/work with those records, then you click on the second tab => another set of related records will be loaded. When you come back to the first tab should the other related set of records be re-loaded into the form? Selection kept and all?

I guess it would work if you used a clone for each tab instead of the same form instance. (either at designtime or at runtime with solutionModel)
But why do you need the same form in both tabs?


Hi Andrei,
I need the same form in both tabs because one of them displays records filtered by two columns and the other one filters records only by one column. Each tab has a different relation.

Everything should work just fine, I'm not loading anything manually or keeping track of record indexes.
We have a similar thing in other places and it works fine. Just not for this one.

Will keep digging.
Cheers,
Maria
maria.kyselova
 
Posts: 172
Joined: Thu Aug 09, 2012 12:56 am

Re: Switching tabs programmatically

Postby Andrei Costescu » Wed Mar 20, 2013 9:51 am

And the only thing that doesn't work is changing the tab through scripting? Otherwise it works fine - changing tabs using mouse for example (or are you using hidden tabs)?

What version of Servoy do you use?
You could also check the app. server log file for for any errors before executing the tab-switch script (maybe something happens and the tab-panel is not constructed correctly).
Andrei Costescu
Servoy
Andrei Costescu
 
Posts: 1018
Joined: Tue Jun 26, 2007 3:14 pm

Re: Switching tabs programmatically

Postby maria.kyselova » Wed Mar 27, 2013 4:04 am

Andrei Costescu wrote:And the only thing that doesn't work is changing the tab through scripting? Otherwise it works fine - changing tabs using mouse for example (or are you using hidden tabs)?

What version of Servoy do you use?
You could also check the app. server log file for for any errors before executing the tab-switch script (maybe something happens and the tab-panel is not constructed correctly).


Hrm.. I didn't try to change tabs with the mouse.
I found a way to filter my related foundset with a help of only one relation, so the requirement is not there any more, Andrei.
Thank you for your input. I'll come back here if the issue comes up again.
Cheers,
Maria
maria.kyselova
 
Posts: 172
Joined: Thu Aug 09, 2012 12:56 am


Return to Discuss possible Issues and Bugs

Who is online

Users browsing this forum: No registered users and 4 guests

cron