Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
Problem sorting config fields
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:
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();
}
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.
Copyright © 2025 Liferay, Inc
• Privacy Policy
Powered by Liferay™