# 2nd instance of form in tabpanel not sorted

**URL:** https://forum.servoy.com/t/2nd-instance-of-form-in-tabpanel-not-sorted/4317
**Category:** Classic Servoy
**Created:** [June 8, 2005, 8:35am UTC](https://forum.servoy.com/t/2nd-instance-of-form-in-tabpanel-not-sorted/4317 "2005-06-08T08:35:54Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Neale](https://avatars.discourse-cdn.com/v4/letter/n/7ab992/32.png) [@Neale](https://forum.servoy.com/u/Neale)
#### Post date: [June 8, 2005, 8:35am UTC](https://forum.servoy.com/t/2nd-instance-of-form-in-tabpanel-not-sorted/4317/1 "2005-06-08T08:35:54Z")

</div>

Servoy 2.2rc9, Java 1.5, Linux…

We have a tab-panel which has two different instances of the same form (via different relations). The form has an initialSort set.

For the first instance of the form, the initialSort works OK. But… the second instance ignores the initialSort.

Thanks,  
Neale.

---

<div class="post-metadata">

### Author: ![Jan\_Blok](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@Jan\_Blok](https://forum.servoy.com/u/Jan_Blok)
#### Post date: [June 9, 2005, 8:10am UTC](https://forum.servoy.com/t/2nd-instance-of-form-in-tabpanel-not-sorted/4317/2 "2005-06-09T08:10:21Z")

</div>

The initial sort is applied when not sorted yet, useSeparateFoundset to get a differently sorted foundset at the same time

---

<div class="post-metadata">

### Author: ![Neale](https://avatars.discourse-cdn.com/v4/letter/n/7ab992/32.png) [@Neale](https://forum.servoy.com/u/Neale)
#### Post date: [June 10, 2005, 7:02am UTC](https://forum.servoy.com/t/2nd-instance-of-form-in-tabpanel-not-sorted/4317/3 "2005-06-10T07:02:48Z")

</div>

Thanks for the suggestion. Unfortunately it didn’t help - i.e. the 2nd instance of the tab-panel remains unsorted ![:-(]( "Sad")

Regards,  
Neale.

---

<div class="post-metadata">

### Author: ![maarten](https://avatars.discourse-cdn.com/v4/letter/m/ecccb3/32.png) [@maarten](https://forum.servoy.com/u/maarten)
#### Post date: [June 10, 2005, 9:54am UTC](https://forum.servoy.com/t/2nd-instance-of-form-in-tabpanel-not-sorted/4317/4 "2005-06-10T09:54:58Z")

</div>

Hi Neale,

We’ve done some testing and  
what’s (probably) happening is following:

1)assume you have 2 relations A and B used for pointing to the same childform (tabpanel)  
2) before showing one of the 2 tabs, you are doing somethng in a script with let’s say relation A. (eg. var x = relationA.myField)  
The moment you’re touching this relation , the foundset (query) of the form is being initialised, causing to override the initialSort property of the form.  
3) Now when you go to the TAB based on relation A, you’ll see the sort doesn’t work, but the TAB on relation B does.

We’ve tried various workarounds but none of them are very reliable.

After release 2.2 we’are going to move the initialSort property to the relation editor to make sure the relation is always initialised properly.
