Strange behavior with drop-down lists

I installed the latest version offered:

Version: 24.2.4.2 (X86_64) / LibreOffice Community
Build ID: 51a6219feb6075d9a4c46691dcfe0cd9c4fff3c2

In Base, a control table displays only 2 rows rather than multiple rows in a form drop-down list. Is this a bug appearing with this new update?

Capture d’écran 2024-06-26 084858

Édition Windows 11 Famille
Version 23H2
Version du système d’exploitation 22631.3810
Expérience Windows Feature Experience Pack 1000.22700.1020.0

More information needed:
Do you work with macro code? Filtering the content of the listbox in some way?

@RobertG,

Yes, I work with Macros. On the other hand, many macros are used in this form, but not directly linked to this drop-down list.

The form concerned is not linked to any events. Concerning the data, there is a sort performed for the field of a table. A subform contains the control table containing this drop-down list. No event is linked to the subform, the content type for this subform is a request, the following:

SELECT "JTActeursFS".* FROM "JTActeursFS" WHERE "jIDRole" = COALESCE ( ( SELECT "RoleID" FROM "TFiltre" WHERE "ID" = 1 ), "jIDRole" ) ORDER BY ( SELECT REPLACE( "TitreAnglais1", ' ', '.' ) FROM "TFilmsSeries" WHERE "FilmSerieID" = "JTActeursFS"."jIDFilmSerie" ) --
//
//	Requête [sfm-SelectionFS] dans le formulaire principal [frm-Acteurs].
//
//	Elle sélectionne toutes les colonnes de [JTActeursFS] en fonction d'une condition dépendant d'une sous-requête
//	dans [TFiltre]. Elle effectue un tri basé sur une valeur extraite de [TFilmsSeries], avec remplacement des
//	espaces par des points.

The control table of this subform has an event linked to the mouse button pressed, the following:

'	Cette procédure permet d'ouvrir un enregistrement spécifique dans un sous-formulaire.
'	Elle utilise des noms de contrôles, des objets de formulaires et des filtres pour afficher les détails pertinents.
'	L'argument "oEvent" est utilisé pour capturer les actions de l'utilisateur, en l'occurrence un double-clic.

Sub	OpenRecordID(oEvent As Object)
	Dim iID As Integer
	Dim oColumnID As Object, oControl As Object, oDoc As Object, oForm1 As Object, oForm2 As Object, oSubForm As Object	
	Dim sCtrlTableName As String, sMainFormName As String, sObjName As String, sFilter As String
		
	If oEvent.ClickCount <> 2 Then Exit Sub						' S'il n'y a pas eu de double-clic, on quitte la procédure.

	sCtrlTableName = oEvent.Source.Model.Name					' Nom de la table de contrôle du sous-formulaire.

	' Nom du formulaire.
	If sCtrlTableName = gcCntrVue Then
		sMainFormName = oEvent.Source.Model.Parent.Name
	Else
		sMainFormName = oEvent.Source.Model.Parent.Parent.Name
	End If

	oForm1 = ThisComponent.Drawpage.Forms.getByName( sMainFormName )	' Récupère le formulaire principal.

	' Détermine le sous-formulaire et l'objet à utiliser en fonction du nom de la table.
	Select Case sCtrlTableName
	    Case gcCntrActeurs
			oSubForm = oForm1.getByName( gcSFrmActeurs )	' Accède au sous-formulaire [cntr-sfrmActeurs].
			oControl = oSubForm.getByName( sCtrlTableName )	' Accède à la table de contrôle du sfrm [cntr-SelectionActeurs].
			oColumnID = oControl.getByName( gcColActeurID )	' Accède à la colonne cachée "ActeurID" de la table de contrôle.
			sObjName = "Acteurs"
	    Case gcCntrActrices
	        oSubForm = oForm1.getByName( gcSFrmActrices )	' Accède au sous-formulaire [cntr-Actrices].
	       	oControl = oSubForm.getByName( sCtrlTableName )	' Accède à la table de contrôle du sfrm [cntr-SelectionActrices].
	        oColumnID = oControl.getByName( gcColActriceID )' Accède à la colonne cachée "ActriceID" de la table de contrôle.
	        sObjName = "Actrices"							
	    Case gcCntrFS
	        oSubForm = oForm1.getByName( gcSFrmFS )			' Accède au sous-formulaire [cntr-SelectionFS].
	       	oControl = oSubForm.getByName( sCtrlTableName )	' Accède à la table de contrôle du sfrm [cntr-SelectionFS].
	        oColumnID = oControl.getByName( "FilmID" )		' Accède à la colonne cachée "fILMID" de la table de contrôle.
	        sObjName = "FilmsSeries"
	    Case gcCntrVue
	       	oControl = oForm1.getByName( sCtrlTableName )	' Accède à la table de contrôle du sfrm [cntr-SelectionFS].
	        oColumnID = oControl.getByName( "FilmSerieID" )	' Accède à la colonne cachée "FilmID" de la table de contrôle.
	        sObjName = "FilmsSeries"
	End Select
	
	iID = oColumnID.getCurrentValue()											' ID de l'enregistrement à ouvrir.

	ThisDataBaseDocument.CurrentController.Connect() 							' Se connecte à la DB, par précaution.
	ThisDatabaseDocument.CurrentController.loadComponent(2, sObjName, FALSE) 	' Const 2 pour charger les formulaires.

	'	Détermine quelles actions prendre en fonction du nom de la table de contrôle
	
	oDoc = ThisDatabaseDocument.FormDocuments.getbyname( sObjName )
	
	Select Case sCtrlTableName
	    Case gcCntrActeurs
	        oForm2 = oDoc.getComponent().getDrawPage().getForms().getByName( gcFrmActeurs )
	        sFilter = "( ActeurID = " & iID & " )"
	    Case gcCntrActrices
	        oForm2 = oDoc.getComponent().getDrawPage().getForms().getByName( gcFrmActrices )
	        sFilter = "( ActriceID = " & iID & " )"
	    Case gcCntrFS, gcCntrVue
	        oForm2 = oDoc.getComponent().getDrawPage().getForms().getByName( gcFrmFS )
	        sFilter = "( FilmSerieID = " & iID & " )"
	End Select

	Wait 100				' Cela donne le temps d'accéder à l'enregistrement demandé.

 	oForm2.Filter = sFilter	' Applique le filtre pour afficher l'enregistrement correspondant à l'ID.
	oForm2.Reload()			' Recharge le formulaire pour obtenir l'enregistrement spécifié.
	oForm2.Filter = ""		' Réinitialise le filtre.
End Sub

The control table column showing only two rows rather than several has no associated events, but there is a query, the following:

SELECT "TitreAnglais1", "FilmSerieID" FROM "TFilmsSeries" ORDER BY 1 --
//
//	Requête pour la colonne ou liste de contrôle [cntr-SelectionFS] du [srm-SelectionFS]
//	des formulaires principaux [frm-Acteurs] et [frm-Actrices]. Elle extrait deux colonnes de [TFilmsSeries]
//	et les affiche dans l'ordre croissant en utilisant [TitreAnglais1].

The information I have just given is linked to the first ‘frm-Acteurs’ form of the main ‘Acteurs’ form. There is a second form linked to the main form named ‘frm-Filtre’ which is used to filter the second column named ‘Role’ of the said control table. This is a sorting query performed according to the selection of a role. The request is :

SELECT "Role", "RoleID" FROM "TRoles" UNION ALL SELECT '< Tous >', NULL FROM "TFiltre" WHERE ID = 1 ORDER BY 1 --
//
//	Requête pour la liste déroulante [lst-FiltreRoles] présente dans tous les formulaires.
//	Elle récupère des données de deux sources [TRoles] et [TFiltre]. Elle les fusionne en une seule liste triée
//	par ordre croissant selon la colonne [Role]. Cette liste affiche les rôles avec l'option "< Tous >" en haut.

This is the details I can give you for now regarding the macros and filters used.

Open the form for editing, not for input data.
Right mouse click on column “Titre anglais”.
Choose “Column”.
What could you see in list box properties → General → Line count?
What could you see in Data → List Content?

I checked the ‘Line Count’ property and it is set to 0. In the previous version, even with this number, all the control tables with this type of column showed a possibility of 26 selection lines as a maximum. In this new version, it shows 2 lines as a maximum.
.
However, in the new version, if I set this number to 10, the table displays 10 lines according to the query specified in the list content of the Data tab. I could say that this solves the problem.
.
Does this mean that with this new version, we are required to establish the number of lines that we want to display in this type of column, which was not the case in the previous version?

Never seen it is checked to ‘0’. Have tested with an old version, LO 7.2.5.2. A listbox inside a table control will be set to ‘5’ in line count. A listbox outside a table control will be set to ‘20’, if it is set to drop down.
It is the same for all versions here.

With my actual computer configuration and with version LibreOffice_7.6.7_Win_x86-64, it doesn’t change much whether 0, 5, 10, or 15 is used as a number for the ‘Line Count’ or ‘Number of Rows’ property for a list box, the list will display 25 rows of selection plus the current selection. It was the same for the version before version 24.2.4.2.
.
With version 24.2.4.2, if you enter the number 0 in the ‘Line Count’ or ‘Number of rows’ property, there are 2 lines displayed, one selection plus the current selection. If we enter the numbers 5, 10, …, 30, the list will contain this number of selection rows plus the current selection.
.
Is this a bug that existed in previous versions that has been fixed with this new version?

Tested with LO 7.2.5.2: Set LineCount to ‘0’. Nothing changes, all rows will be shown.
Tested with LO 24.2.4.2: Only one value and a button for scrolling through the values appears. The one value, which will be shown when clicking on the control is the already choosen value.
All tested with OpenSUSE 15.6 64bit rpm Linux.

The old behavior ignores the value for line count. So it has been a bug, which is fixed now with LO 24.2.

1 Like

.
Thank you @RobertG for taking the time to do all these checks.
.
Initially, I thought it was the new version that was problematic, because with the value 0, very few lines were displayed. I never cared about the value inserted into this ‘Number of Rows’ property since a large selection of rows appeared in the list box in previous versions.
.
So I thought this latest version was buggy, but it’s quite the opposite, a bug was fixed with this one.
.
So everything is perfect on my side, I just have to make the necessary modifications for the various forms using this list type (list box).
.
Thanks again!