Autofilling blank properties with 'undefined' value | Community
Skip to main content
November 22, 2021

Autofilling blank properties with 'undefined' value

  • November 22, 2021
  • 1 reply
  • 1019 views

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

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

Siva_Sogalapalli
Community Advisor
Community Advisor
November 22, 2021

@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.

 

 

 

 

November 24, 2021

Hi @siva_sogalapalli !


Thanks for your answer.


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

Siva_Sogalapalli
Community Advisor
Community Advisor
November 24, 2021

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