Problem sorting config fields

Jamie Sammons, modified 1 Year ago. New Member Posts: 5 Join Date: 7/15/23 Recent Posts

I have a problem tryíng to sort the boolean type config field. I would like it to appear at the top of the UI and no matter what i try it will always appear at the bottom: 

Olaf Kock, modified 1 Year ago. New Member Posts: 5 Join Date: 7/15/23 Recent Posts
package com.once.notidi.config;

import com.liferay.portal.configuration.metatype.annotations.ExtendedObjectClassDefinition;
import com.liferay.portal.kernel.spring.aop.Property;

import javax.xml.bind.annotation.XmlAccessorOrder;

import aQute.bnd.annotation.metatype.Meta;
import aQute.bnd.annotation.metatype.Meta.Type;

@ExtendedObjectClassDefinition(category = "notidi-configuration", scope = ExtendedObjectClassDefinition.Scope.SYSTEM)
@Meta.OCD(id = "com.once.notidi.config.ConfigurationBloqueo", name = "Bloqueo")
public interface ConfigurationBloqueo {
	
	/*
	 * Estado de activación / Inactivación de las notificaciones por Whatsapp
	 */

	@Meta.AD(
			id = "0",
			deflt = "true",
			name = "Activar bloqueo",
			description = "Opción para activar o desactivar bloqueo en el envío masivo",
			required = false, optionLabels = {
					"Activar", "Desactivar" },
			optionValues = { "true", "false" })
	public boolean manageNotifications();

	/*
	 * Hora de inicio del bloqueo
	 */
	
	@Meta.AD(
			id = "1",
			deflt = "21:00", 
			name = "Hora de inicio", 
			description = "Establezca la hora de inicio para el bloqueo de notificaciones. "
							+ "Utilice el formato de 24 horas HH:mm."
							+ " Por ejemplo, '08:00' para las 8 AM o '18:00' para las 6 PM.",
 
			required = true, 
			type = Meta.Type.String
	)
	
	public String getStartingTime();

	/*
	 * Hora de fin del bloqueo
	 */
	@Meta.AD(
			id = "2",
			deflt = "9:00", 
			name = "Hora de fin",
			description = "Establezca la hora de fin para el bloqueo de notificaciones. "
							+ "Utilice el formato de 24 horas HH:mm."
							+ " Por ejemplo, '08:00' para las 8 AM o '18:00' para las 6 PM.", 
			required = true, 
			type = Meta.Type.String)
	public String getFinishingTime();

}

 

thumbnail
Olaf Kock, modified 1 Year ago. Liferay Legend Posts: 6441 Join Date: 9/23/08 Recent Posts

The configuration UI is automatically generated, and (without looking at the code) I am assuming that the automatically generated UI doesn't sort - or sorts in a way that always makes the checkboxes appear at the end.

You can provide your own configuration UI as well - I've seen it being done with some of Liferay's own configuration, but currently can't point out an example, sorry.

thumbnail
Russell Bohl, modified 1 Year ago. Expert Posts: 308 Join Date: 2/13/13 Recent Posts