Foros de discusión

(Boolean) Expando field to display as Checkbox?

Mikko Torri, modificado hace 12 años.

(Boolean) Expando field to display as Checkbox?

Junior Member Mensajes: 33 Fecha de incorporación: 10/05/11 Mensajes recientes
Hi

I've extended the calendar service with some new fields.
Currently I've defined them as boolean, since they're supposed to be checkbox type fields.
However by default they're shown as dropdown with True/False as selection.

Can they be changed to be displayed as checkbox?

This is the default code that outputs them on edit_event.jsp:

<liferay-ui:custom-attributes-available classname="<%= CalEvent.class.getName() %>">
    <liferay-ui:custom-attribute-list className="<%= CalEvent.class.getName() %>" classPK="<%= eventId %>" editable="<%= true %>" label="<%= true %>" />
</liferay-ui:custom-attributes-available>


Thanks,
Mikko
Bozhidar Dedov, modificado hace 12 años.

RE: (Boolean) Expando field to display as Checkbox?

New Member Mensajes: 10 Fecha de incorporación: 30/08/11 Mensajes recientes
Hi Mikko,

I had to do the same some weeks ago. Unfortunately there is no configuration option that enables changing the way the true/false field is displayed. For this you have to override a JSP from the taglib using a hook. Check here how to do it.

Regards,
Bozhidar
thumbnail
Dominik domih, modificado hace 11 años.

RE: (Boolean) Expando field to display as Checkbox?

Junior Member Mensajes: 57 Fecha de incorporación: 10/11/08 Mensajes recientes
Thanks, Bozhidar! Works like a charm :-)

It would be great if one could define the display of the custom attribute during creation, e.g. checkbox, radiobutton, ... like it's done with the data type presets. That would could be an option in the drop down field on creation of custom attributes. Maybe in a futur version ...