Fórum

Setting default value in Expando Column in startup action

Gourab Kar, modificado 13 Anos atrás.

Setting default value in Expando Column in startup action

New Member Postagens: 6 Data de Entrada: 11/05/10 Postagens Recentes
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, modificado 6 Anos atrás.

RE: Setting default value in Expando Column in startup action

Junior Member Postagens: 65 Data de Entrada: 25/03/10 Postagens Recentes
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);