1

I've been trying to debug this all day. I can't figure it out.

My subform field:

<field name="tricks" type="subform" 
    formsource="administrator/components/com_test/models/forms/bagtrick.xml" min="0" max="1000" multiple="true" buttons="add,remove,move"
    layout="joomla.form.field.subform.repeatable-table" groupByFieldset="true" 
    label="Models" description="Subform Field Description" />

bagtrick.xml:

<form>
<fieldset name="homemodelsrent" label="Home Models and Rent" repeat="true">
    <field name="homemodel" 
        type="sql" 
        label="Home Model" 
        description="Choose a home model"
        query="SELECT id, concat(title, ' - ',model) as composite_title from fd9un_test_tricks" 
        key_field="id" 
        value_field="composite_title" >
    </field>
    <field name="price"
        label="Rent"
        description="Enter rental price for this home model at this community"
        type="text" />
</fieldset>

It appears to work fine. enter image description here But when I save the form, the information is not saved. enter image description here My table has a column named 'tricks'. It is empty, no matter what I do.

Any thoughts greatly appreciated.

  • Added the following to my components table class bind function and it works. if((!empty($array['tricks'])&&(is_array($array['tricks'])))) { $this->_jsonEncode[]="tricks"; } – Alan Catterson Jul 29 '16 at 1:57
  • I have the same problem, although your solution looks ok, I would like to find the official way to do it. At least, the hidden field to store the value is added as in the repeatable field, so i guess there has to be some missing js that would do the job automatically. – spacebiker Sep 26 '16 at 18:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.