# Programatically set field tab sequence at runtime

**URL:** <https://forum.servoy.com/t/programatically-set-field-tab-sequence-at-runtime/17174>\
**Category:** Classic Servoy\
**Created:** [April 12, 2013, 12:00am UTC](https://forum.servoy.com/t/programatically-set-field-tab-sequence-at-runtime/17174 "2013-04-12T00:00:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mark\_Crichton](https://avatars.discourse-cdn.com/v4/letter/m/3ab097/32.png) [@Mark\_Crichton](https://forum.servoy.com/u/Mark_Crichton)\
**Post date:** [April 12, 2013, 12:00am UTC](https://forum.servoy.com/t/programatically-set-field-tab-sequence-at-runtime/17174/1 "2013-04-12T00:00:11Z")

</div>

Hi ALl

I have a form where I need to change the tab sequence of fields that I have rearranged using  
elements.prdIcon.setLocation(1,1)  
elements.fld\_ordstart.setLocation(1,2)  
elements.fld\_ordpopid.setLocation(1,4) … etc in my form method

Now I need to make the tab sequence match the new sequence. I gather this can be doen via solution model, but cannot find the way to do this.  
Can some please help with some sample code.  
Many thanks  
Mark

---

<div class="post-metadata">

**Author:** ![pbakker](https://avatars.discourse-cdn.com/v4/letter/p/a4c791/32.png) [@pbakker](https://forum.servoy.com/u/pbakker)\
**Post date:** [April 12, 2013, 6:33am UTC](https://forum.servoy.com/t/programatically-set-field-tab-sequence-at-runtime/17174/2 "2013-04-12T06:33:26Z")

</div>

controller.setTabSequence() will do the trick.

Paul

---

<div class="post-metadata">

**Author:** ![lopamudram](https://avatars.discourse-cdn.com/v4/letter/l/a8b319/32.png) [@lopamudram](https://forum.servoy.com/u/lopamudram)\
**Post date:** [April 12, 2013, 11:58am UTC](https://forum.servoy.com/t/programatically-set-field-tab-sequence-at-runtime/17174/3 "2013-04-12T11:58:18Z")

</div>

> pbakker:  
> controller.setTabSequence() will do the trick.
> 
> Paul

Hi Paul

Controller.setTabSequence () is not working properly for me.

I am trying to update tab sequence of three fields in a form from [elem1, elem2, elem3] to [elem1, elem3, elem2].  
I have attached following code to the on action event of a button.

```auto
controller.setTabSequence([elements.elem1, elements.elem3, elements.elem2]);

```

But, on clicking tab the control switches only between elem1 and elem3. It never goes to elem2. I am testing it with servoy 6.1.3.  
Am I missing something?

Regards  
Lopamudra  
[http://www.mindfiresolutions.com/](http://www.mindfiresolutions.com/)

---

<div class="post-metadata">

**Author:** ![sovanm](https://avatars.discourse-cdn.com/v4/letter/s/a183cd/32.png) [@sovanm](https://forum.servoy.com/u/sovanm)\
**Post date:** [April 12, 2013, 1:42pm UTC](https://forum.servoy.com/t/programatically-set-field-tab-sequence-at-runtime/17174/4 "2013-04-12T13:42:49Z")

</div>

Hi,

I faced this kind of problem few days back. I had four elements(three text field and a button) in a form and I had used

```auto
elements.<element-name>.setLocation(x,y)

```

to change the position of the elements and applying the tab sequence to those element accordingly on clicking of a button. I missed a one element from the tab sequence array in controller.setTabSequence([elementArray]) and got the same unexpected behavior as mention above by Lopamudra.

We need to pass all the element on the forms to the element-array to apply the tab sequence properly.

Hope this help

Thanks  
Sovan Misra  
[http://www.mindfiresolutions.com](http://www.mindfiresolutions.com)
