Generic Form Data in Scout Eclips

67 views Asked by At

I would like to know how to set generic form data on class.

I have class like this :

@FormData(value = AbstractMoreSmartFieldFormData.class, sdkCommand = FormData.SdkCommand.CREATE,
defaultSubtypeSdkCommand = FormData.DefaultSubtypeSdkCommand.CREATE)
public class AbstractMoreSmartField<T> extends AbstractSmartField<T> implements IMoreField {

  public Boolean isMore;

  @FormData
  public Boolean getIsMore() {
    return this.isMore;
  }

  @FormData
  public void setIsMore(Boolean isMore) {
     this.isMore = isMore;
  }
...

But it create form data like this :

public class AbstractMoreSmartFieldFormData extends AbstractValueFieldData<Object> {

and does not take T from creating class in to account. How to fix this?

Marko

1

There are 1 answers

0
Marko Zadravec On BEST ANSWER

I figure it out

You change sdkCommand to USE like :

@FormData(value = AbstractMoreSmartFieldFormData.class, sdkCommand = FormData.SdkCommand.USE,
defaultSubtypeSdkCommand = FormData.DefaultSubtypeSdkCommand.CREATE)

Then you can change AbstractMoreSmartFieldFormData and will not be overwritten when form data is update.

so change form data to

public class AbstractMoreSmartFieldFormData<T> extends AbstractValueFieldData<T>