Generated cell in table


I am trying to create a generated column to display the latest one of several dates columns

I have added a column in browse xml

<column id="docsReceiveDate"

and implement this method.

public Component generateDocsReceiveDateCell(PurchaseOrderLine entity) {
        Label label = (Label) componentsFactory.createComponent(Label.NAME);
	return label;

the result is as the file attached.

the column generated, but the format is not correct. the column is not sortable.

Is it correct to use label component here?
How should I fix the date format and sortable issue?

Best Regards.



  1. column element may contain a nested formatter element that allows you to represent the attribute value in a format different from the standard for this Datatype, e.g.
<column id="date">
    <formatter class="com.haulmont.cuba.gui.components.formatters.DateFormatter" 

So, I suggest using this approach for formatting your date values.
2. Sorting is disabled because table knows nothing about datatype of your column. To enable sorting for this column, I suggest creating a meta property for this value.

public Date getDocsReceiveDate() {
	return getReceiveDate(getPurchaseOrder());
  1. As I can see from your screenshot, you already have the right date formatting for your application and the only reason you need to add a custom formatting is a generated column. I suppose that adding a temporal type to a meta property will be enough to resolve your needs, e.g.
public Date getDocsReceiveDate() {
	return getReceiveDate(getPurchaseOrder());


Hi Gleb,

I am grateful for your reply.

Thank you very much, that is the suggestion what I need.

Best Regards.

2 posts were split to a new topic: Sorting generated columns