Expand my Community achievements bar.

Autofilling blank properties with 'undefined' value

Avatar

Level 1

Hi all.

There is a problem. When some property value exists in blueprint and it's blank, it's autofilled with 'undefined' string in live copies. Which can sometimes break the validation. How can I avoid this autofilling?

 

UPD: 'undefined' string only appears when Edit Dialog is opened

 

Blueprint propertiesBlueprint propertiesLive copy propertiesLive copy properties

4 Replies

Avatar

Community Advisor

@kaltavskii , 

You can set default property value in the sling model:

 

@Model(adaptables=Resource.class)

public class MyModel

{

        @Inject

        @Default(values="")

         private String name;

}

or add a condition to check property value and set default value if it's undefined.

 

 

 

 

Avatar

Level 1

Hi @Siva_Sogalapalli !


Thanks for your answer.


I made a small update of my post yesterday. Will your answer be the same?

Avatar

Community Advisor

@kaltavskii do you have this issue for the page properties or in component within live copy?