Foren

Setting default value in Expando Column in startup action

Gourab Kar, geändert vor 13 Jahren.

Setting default value in Expando Column in startup action

New Member Beiträge: 6 Beitrittsdatum: 11.05.10 Neueste Beiträge
Hello Everybody,

For a custom attribute, I have created a combo box using expando i.e. properties.setProperty(ExpandoColumnConstants.PROPERTY_SELECTION,Boolean.TRUE.toString());

When I open the related page, I get a blank combo box. Of course because in the start up action file, i have only created the field and is blank currently.

Now my question is how to add a generic default value, like "Select One" in the startup action itself?

As a note though, I am easily able to set default value in fields other than SELECTION( combo box), the only problem is with PROPERTY_SELECTION, true

I have tried createdColumn.setDefaultValue("Select One"), but no luck.

I have also tried the way user panel leverages expando for the custom attributes. But still unable to get the solution.

Thanks for any help in advance.
thumbnail
Orin Fink, geändert vor 6 Jahren.

RE: Setting default value in Expando Column in startup action

Junior Member Beiträge: 65 Beitrittsdatum: 25.03.10 Neueste Beiträge
I know this might be an old post, but the missing step here would be to make sure that you update the column. In this case...

createdColumn.setDefaultValue("Select One");
ExpandoColumnLocalServiceUtil.updateExpandoColumn(createdColumn);