FieldGroup setFieldValue problem

Hi.
I create a fieldGroup component and i set datasource. Everything works fine but when i try setFieldValue using datasource object fill only DataTime element.


fieldGroup.setFieldValue("orderName", ecmorders.getOrderName());
fieldGroup.setFieldValue("taskId", ecmorders.getTaskId());
fieldGroup.setFieldValue("itemId", ecmorders.getItemId());
fieldGroup.setFieldValue("number", ecmorders.getNumber());
fieldGroup.setFieldValue("orderDate", ecmorders.getOrderDate());

Object ecmorders is all set (tested by showNotification) and datatypes is the same. I try everything but the fields is still empty (except OrderDate).

Hi,

Could you attach a small project that illustrates this issue and tell us how to reproduce this problem there?

I create 1 entity (the same as my main project). Still only datatime format is set.

https://megawrzuta.pl/download/7735be6c80ecb3c6e21c139984f925b5.html
http://www.filedropper.com/testproject_1

I think problem is in method setFieldValue or in constructor. When i declare FieldGroup object i can read all Fields Id, but when i try set or get FieldValue i had NullException.

Hi, your ecmOrdersDs does not have item. You need to set item to DS before setting values to fields:


@Inject
private Datasource<EcmOrders> ecmOrdersDs;
@Inject
private Metadata metadata;
...

@Override
public void init(Map<String, Object> params) {
    ecmOrdersDs.setItem(metadata.create(EcmOrders.class));

    ...
}

Sorry for waiting.
I think the problem isnt in empty DS, in my test project i just fill field with String and still was empty. Secondary i got data in my Ds, i was connected to DB.