Programatically set field tab sequence at runtime

Questions and answers for designing and implementing forms in Servoy

Programatically set field tab sequence at runtime

Postby Mark Crichton » Fri Apr 12, 2013 2:00 am

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
Mark Crichton
DataWise Ltd - New Zealand
http://www.datawise.co.nz
User avatar
Mark Crichton
 
Posts: 109
Joined: Mon Jan 24, 2011 10:01 am
Location: Auckland, New Zealand

Re: Programatically set field tab sequence at runtime

Postby pbakker » Fri Apr 12, 2013 8:33 am

controller.setTabSequence() will do the trick.

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

Re: Programatically set field tab sequence at runtime

Postby lopamudram » Fri Apr 12, 2013 1:58 pm

pbakker wrote: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.
Code: Select all
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/
lopamudram
 
Posts: 20
Joined: Wed May 02, 2012 12:05 pm

Re: Programatically set field tab sequence at runtime

Postby sovanm » Fri Apr 12, 2013 3:42 pm

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
Code: Select all
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
sovanm
 
Posts: 99
Joined: Fri Oct 28, 2011 1:55 pm
Location: Bhubaneswar, India


Return to Forms

Who is online

Users browsing this forum: No registered users and 7 guests