create a subform field.
form.txt
( wouldn't allow direct pasting of form field )
examine backend. You'll see 4 rows of fields instead of 2 rows with defaults
change form type to repeatable
examine backend...
you get single row ( NOT SURPRISING )
put type back to subform, remove default values.
add default to individual fields
<field name="socialiconname" type="text" label="name" default="mary" /> <field name="socialiconimage" type="media" label="image" default="" /> <field name="socialiconclass" type="text" label="class" default="fa fa-facebook" /> <field name="socialiconurl" type="url" label="url" default="http://no.net" />
multiple rows with defaults set per subform field.
see above.
systeminfo-2019-01-14T02_54_24+00_00.txt
I've tried dozens of possibilities and nothing seems to work properly.
Labels |
Added:
?
|
@dgrammatiko oh wow... Why the downgrade from repeatable? That was an important feature imo.
So what is the purpose/use of the "default" parameter? https://docs.joomla.org/Special:MyLanguage/subform_form_field_type Says to use a json string which afaik I'm doing correctly.
This should work:
{"socialArray0":{"socialiconname":"facebook","socialimage":"","socialclass":"fa fa-facebook","socialiconurl":"http://no.net"}, "socialArray1":{"socialiconname":"Youtube","socialimage":"","socialclass":"","socialiconurl":""}}
It's how the values are stored in the database.
very interesting, ty! I assume this would go in the "default" parameter
Yes, it would go to default
attribute. There was an error in the above code. Fixed now.
I think it can be closed, as it not an issue, but incorrect usage
@Fedik not incorrect usage necessarily, more like undocumented usage!
@dgrammatiko it's fine :D your right way more then your wrong lol
Status | New | ⇒ | Discussion |
Category | ⇒ | Fields |
Labels |
Added:
J3 Issue
|
Status | Discussion | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2019-12-29 22:10:43 |
Closed_By | ⇒ | HLeithner |
@N6REJ this is expected. The repeated fields, in the current implementation, are just a hard copy of the initial provided field. So whatever the default value there will be repeated on the subsequent fields. It's designed that way, it's not a fault or limitation.
PS if you need deferent default values then spawn different fields...