Polymer edit component set default values for input fields

Hi,

I am a new to Cuba Studio and Polymer. I’ve been tasked to create the Polymer part of an application developed in Cuba. I’ve created the input components. My question is : How do I set the default field values when adding a new record with the edit component ?

Regards.

Martin Oosthuizen

Hi,
Currently you can override _handleEntityIdChange function of CubaEntityEditViewBehavior to return an object with some pre-defined fields.

    Polymer({
      is: 'myapp-entity-edit',
      behaviors: [CubaLocalizeBehavior, CubaEntityEditViewBehavior],
     
      _handleEntityIdChange: function(newValue) {
        this.entity = {
          attr1: '123'
        }
      }
    });