autoform array display no field (initialCount)

164 views Asked by At

I have an autoform containing an array of Objects and and Array of Strings:

# Schema
misc:
    type: Array
    label: "Something"
    optional: true
"misc.$": 
    type: String
    optional: true

initially i want no form to be displayed. Just the "+"-button. I use this in my template:

+autoForm collection="Collections.UserProfiles" id="updateProfileForm" type="update" doc=this class="form-horizontal"
+afQuickField name="misc" template="bootstrap3-horizontal" initialCount=0

i already tried to use initialCount = 0 in the Schema as well.

1

There are 1 answers

1
maltesar On

Ok, I just found out how it works. Sorry for asking, but maybe someone has the same Question. Just specify you schema like this. It works for arrays of objects as well.

misc:
    type: Array
    label: "Something"
    optional: true
    autoform:
        initialCount: 0
"misc.$": 
    type: String
    optional: true

still i dont know why i didnt work to set it in the template. Because thats the ways it is explained in the autoform documentation.