Forms, subforms, and tabstop

Creating and using forms
Post Reply
khangx
Posts: 2
Joined: Wed Sep 22, 2010 9:13 pm

Forms, subforms, and tabstop

Post by khangx »

I am having a difficult time getting the tab order to work properly.
My structure:
MainForm
5 fields tab ordered from 1-5 and autofocus on start (Works) as expected. Cycle (Current Page)
Subform1
3 fields tab ordered 1-3. Here the problem is after the 5th tabstop from the main form, it won't go to this form, but skip over to subform2. (Current Page)
Subform2
7 fields tab ordered 1-7. Tab stop flies to this subform after the 5th tabstop from main form. (Current Page)

I even tried doing tab order 1-15 accordingly, but that did nothing. Occasionally the tab order will go in the order I want it, but that is depending how how the program launched it seems. I can continue to open and close the form, and randomly it will go in the order I want, but more often than not, it will skip from main form 5th tabstop to subform 2.

How can I overcome this issue? I have tried this in both version 2.4, and 3.2 with two test forms, and the problem persists. Oh, and each form created using different version of oOo.
OpenOffice 2.4 Mac
khangx
Posts: 2
Joined: Wed Sep 22, 2010 9:13 pm

Re: Forms, subforms, and tabstop

Post by khangx »

could still use some help please. Thanks in advance.
OpenOffice 2.4 Mac
User avatar
therabi
Volunteer
Posts: 763
Joined: Wed Sep 01, 2010 10:01 pm
Location: USA

Re: Forms, subforms, and tabstop

Post by therabi »

khangx wrote:could still use some help please. Thanks in advance.
I just did come checking and can not see any where to change the tabs stops in a main form. They seem to be set when you build the form.

As for sub forms, in edit mode right clicking brings up a dialogue. There select Controls. In the window that open you see Tab stops the default is 'No', change that to 'Yes' and then the Tap order can be selected. See screen shot attached.
Attachments
screen shot of Table Control
screen shot of Table Control
OpenOffice.org v3.3, LibO v3.32 on Ubuntu 10.10 and Win7
Ningalass
Posts: 1
Joined: Wed Oct 13, 2010 4:50 am

Re: Forms, subforms, and tabstop

Post by Ningalass »

I'm new to Base and was having a similar problem. I had so many controls on a form that they wouldn't all display on the screen. The tabstop would only progress through those that displayed on the screen. I found that if I scrolled to the end of the page and back again, then the tabstops would work properly.

My workaround was to alter a macro I found on the OO forum that set focus on a specific control and attached it as an action to be run when the form was opened. It focussed on the last text box on my form (txtAsset_OtherInfo) and then the first text box on my form (TextAssetAcquisitionDate ).



Sub Main
oDoc = ThisComponent
oDocView = oDoc.getCurrentController()

oForm = oDoc.drawpage.forms(0)
oFeld = oForm.getByName("txtAsset_OtherInfo")

oDocView.getControl(oFeld).setFocus()

oDoc = ThisComponent
oDocView = oDoc.getCurrentController()

oForm = oDoc.drawpage.forms(0)
oFeld = oForm.getByName("TextAssetAcquisitionDate")

oDocView.getControl(oFeld).setFocus()


End Sub


At the moment this seems to be working for me.
Open Office V3.2.1 installed on Windows XP Pro SP3
cscj01
Posts: 32
Joined: Wed Apr 02, 2008 12:45 am

Re: Forms, subforms, and tabstop

Post by cscj01 »

khangx wrote:I am having a difficult time getting the tab order to work properly.
My structure:
MainForm
5 fields tab ordered from 1-5 and autofocus on start (Works) as expected. Cycle (Current Page)
Subform1
3 fields tab ordered 1-3. Here the problem is after the 5th tabstop from the main form, it won't go to this form, but skip over to subform2. (Current Page)
Subform2
7 fields tab ordered 1-7. Tab stop flies to this subform after the 5th tabstop from main form. (Current Page)

I even tried doing tab order 1-15 accordingly, but that did nothing. Occasionally the tab order will go in the order I want it, but that is depending how how the program launched it seems. I can continue to open and close the form, and randomly it will go in the order I want, but more often than not, it will skip from main form 5th tabstop to subform 2.

How can I overcome this issue? I have tried this in both version 2.4, and 3.2 with two test forms, and the problem persists. Oh, and each form created using different version of oOo.
I have exactly the same problem with Openoffice.org 3.2.1, ooo-build 3.2.1.4, Ubuntu package 1:3.2.1-7ubuntu1 on Ubuntu 10.10 x64. However, I have had this problem since Ubuntu 9.10. I really don't like the macro solution. To my mind, this is a bug in OOo Base Forms. I have tried every possible setting I can think of to no avail. I even recreated the entire form with the same problems.

An interesting side note here is that if I tab to the second subform from the main form, I can then use backtab and it takes me in reverse order through the first subforms fields, and finally through the main form in reverse order. So you can position the cursor in the second subform and backtab completely through the subforms and main form in the correct order. It seems to me if Base can recognize the correct reverse order, it should be able to recognize the correct forward order.

As a final note, this form worked correctly for a long while after I first created it. It begin to fail as described here after I had made a small modification to one of the subforms. I do not remember when or what I modified now, because it has been quite a while back.
oleh108
Posts: 1
Joined: Tue Jan 25, 2011 10:20 pm

Re: Forms, subforms, and tabstop

Post by oleh108 »

Merely setting the tab order in the control dialog was not enough for me to get the correct tab order. The following hack into the form xml file worked for me to adjust the tab order:

Unzip the OOo Base file into a dedicated directory, e.g. "myDb" (e.g. with http://www.7-zip.org). Open "myDb/content.xml" with a text editor (e.g. with http://notepad-plus-plus.org) and search for the name of your form as the "db:name" attribute of a "db:component" element of the "db:forms" element. The "xlink:href" attribute specifies the subdirectory that contains the form's files, e.g. "forms/Obj12". In this subdirectory, open the "content.xml" file (e.g. "forms/Obj12/content.xml") with a text editor. At the very end, just before the closing tags "</office:text></office:body></office:document-content>" you'll find the control tags ("draw:control"). Each such tag has a "draw:z-index" attribute. Merely by experimentation I found out that the focus moves to controls with higher "draw:z-index" values first. To see the name of the control, search for the value of the "draw:control" attribute of the "draw:control" element. Adjust the "draw:z-index" values as required. You may set all controls to the same initial "draw:z-index" values, e.t. 20. Then adjust those controls that are out of order up or down as per your control hierarchy. Finally, zip all files/folders of the contents of the directory created initially ("myDb"). Rename the zip file to the desired database file name, and you should have your database file with the tab stops adjusted.

Bit clumsy, sure, but at least a workaround.

Hope this helps. ;)
OOo 3.2.1 on OpenSUSE Linux 11.0/KDE3.5 and OOo 3.2.1 on MS WinXPSP3
ChristyMcFadden
Posts: 3
Joined: Thu Dec 01, 2011 10:59 pm

Re: Forms, subforms, and tabstop

Post by ChristyMcFadden »

I am having a very similar problem with a form I created. (tabs stops not going where I want) I was hoping to use the macro provided in this thread but its not working in openoffice 3.3. I have never used a macro before and it keeps coming back variable not defined on the first line of code. I'm using the macro after the losing focus event with the last control on the form I'm leaving and trying to set focus on a control in a subform (but the one I want it to tab to). Does anyone have any suggestions for me?
Open Office version 3.3 on Windows 7
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Forms, subforms, and tabstop

Post by Villeroy »

Tab stops are broken. IMHO, the tab order in the properties dialog has no effect. The tab-order dialog which is callable from the form navigator or from toolbar "Form Design" applies the correct tab order for a single (sub-)form.
Ctrl+Tab lets you jump between different forms, seemingly in the order as they appear in the form navigator. It is possible to drag around the forms with all their elements until you get the wanted order of forms and subforms.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
ChristyMcFadden
Posts: 3
Joined: Thu Dec 01, 2011 10:59 pm

Re: Forms, subforms, and tabstop

Post by ChristyMcFadden »

The tabs will not jump from subform to subform in the order they are listed in form navigator. In fact, no matter which order I put the subforms in on the form navigator screen, they always jump from the mainform to the same subform and then up in the opposite order I'm trying to create (except they work corectly within each subform). I even recreated the form and I'm keep having the same problem. That's why I thought a macro could force it to jump to the subform I want.
Open Office version 3.3 on Windows 7
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Forms, subforms, and tabstop

Post by Villeroy »

Well, then you've got to hack a macro for the form controller.
http://api.openoffice.org/docs/common/r ... oller.html
http://api.openoffice.org/docs/common/r ... tions.html
Good luck.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
papijo
Posts: 90
Joined: Sat Nov 08, 2014 5:46 pm
Location: Brittany, West of France

Re: Forms, subforms, and tabstop

Post by papijo »

oleh108 wrote:Merely setting the tab order in the control dialog was not enough for me to get the correct tab order. The following hack into the form xml file worked for me to adjust the tab order:
[...]
Hope this helps. ;)
Just to confirm that the hack posted by oleh108 - although clumsy, as he says - does work fine. :bravo:
LO: LibreOffice 6.4.0.3 (x64) on Windows 10 64bits. Split database HSQL 2.3.4.
RPG
Volunteer
Posts: 2250
Joined: Tue Apr 14, 2009 7:15 pm
Location: Netherlands

Re: Forms, subforms, and tabstop

Post by RPG »

Hello

The tab-order in a data-form is sometimes difficult. This was special true for me when I made complex forms and the first form on sccreen was not the form with the index 1. I could change this once by moving the data-forms in a complex way. This is the same as Villeroy told. Later I did have wrote a macro for moving forms. It can only move the main-forms and not subforms. What is the relation between the form-index and the taborder is not clear to me.

I have add the macro to this post. Start the macro from the IDE
module : OrganizeForms
sub : startfromBasic
The form you want change must be on top and in edit mode.
Then change to the IDE and start the macro.

Try it first in a form what is not so important. I have add it as a extension. The reason is: I use a dialog. Rename the file by deleting the last zip word of the name.

Romke
Attachments
BaseRPG.oxt.zip
Delete the last zip from the file. It is an extension and I can not upload an extension.
(4.83 KiB) Downloaded 175 times
LibreOffice 7.1.4.2 on openSUSE Leap 15.2
Arineckaig
Volunteer
Posts: 828
Joined: Fri Nov 30, 2007 10:58 am
Location: Scotland

Re: Forms, subforms, and tabstop

Post by Arineckaig »

FWIW, I have had no problems using the relatively simple method described by datajet at:
viewtopic.php?f=13&t=28399&p=129450#p140170
As explained in that post it is important: first, that the Cycle property for each sub-form should be set to "Current Page", and secondly that no duplicate tag order numbers (other than 0) should be included if the form document.

My tests have been limited, but the method so far has not be defeated by multiple sub-forms or by several generations of sub-forms
When this issue has been resolved, it would help other users of the forum if you add the word - [Solved] - to the Subject line of your 1st post (edit button top right).
AOOo 4.1.5 & LO 6 on MS Windows 10 MySQL and HSQLDB
Post Reply