Custom Template - not able to edit (SOLVED)

downunder

New Member
Hi...
I am having a problem with a custom form. Everything works normally when adding new records, but when I try to edit the form using the same template, it goes through the motions, but does not save the changed data. The normal bootstrap template (in the back-end) saves the same changes normally.

I have attached a pic of the form, and it had to resemble the old hard-copy form, hence the complex custom form. I duplicated the bootstrap template, and only changed the default_group.php file (see code below). Due to the complexity, I could not use the foreach loop, but instead determined the element values and labels from the array, and placed them individually into the same DIV structure as the normal rows.

I am using the latest Github code and am using Joomla 3.3.1.

I am missing something simple, and it it driving me nuts trying to make it work.

Any help is appreciated, and to the devs, you have done a great job with this plugin/component.

Gordon...

PHP:
// No direct access
defined('_JEXEC') or die('Restricted access');
 
 
$elements = $this->elements;?>
 
<fieldset class="outerfieldset">
<legend class="legendtext">Report Background</legend>
    <fieldset class="firstfieldset">
    <legend class="legendtext2">Details and Actions</legend>
    <div class="row-fluid">
        <div class="control-group fabrikElementContainer plg-field fb_el_reports___subject fabrikDataEmpty">
            <?php echo $elements ['subject']->label; ?>
            <div class="controls">
                <div class="fabrikElement">
                    <?php echo $elements ['subject']->element;?>
                </div>
                <div class="fabrikErrorMessage"> </div>
            </div>
        </div>
    </div>
    <div class="row-fluid">
        <div class="control-group fabrikElementContainer plg-date fb_el_reports___date fabrikDataEmpty">
            <?php echo $elements ['date']->label; ?>
            <div class="controls">
                <div class="fabrikElement">
                    <?php echo $elements ['date']->element;?>
                </div>
                <div class="fabrikErrorMessage"> </div>
            </div>
        </div>
    </div>
    <div class="row-fluid">
        <div class="control-group fabrikElementContainer plg-databasejoin fb_el_reports___home_team_id mode-dropdown">
            <?php echo $elements ['home_team_id']->label; ?>
            <div class="controls">
                <div class="fabrikElement">
                    <?php echo $elements ['home_team_id']->element;?>
                </div>
                <div class="fabrikErrorMessage"> </div>
            </div>
        </div>
    </div>
    <div class="row-fluid">
        <div class="control-group fabrikElementContainer plg-databasejoin fb_el_reports___visiting_team_id mode-dropdown">
            <?php echo $elements ['visiting_team_id']->label; ?>
            <div class="controls">
                <div class="fabrikElement">
                    <?php echo $elements ['visiting_team_id']->element;?>
                </div>
                <div class="fabrikErrorMessage"> </div>
            </div>
        </div>
    </div>
    <div class="row-fluid">
        <div class="control-group fabrikElementContainer plg-databasejoin fb_el_reports___grade_id mode-dropdown">
            <?php echo $elements ['grade_id']->label; ?>
            <div class="controls">
                <div class="fabrikElement">
                    <?php echo $elements ['grade_id']->element;?>
                </div>
                <div class="fabrikErrorMessage"> </div>
            </div>
        </div>
    </div>
    <div class="row-fluid">
        <div class="control-group fabrikElementContainer plg-yesno fb_el_reports___ejection">
            <?php echo $elements ['ejection']->label; ?>
            <div class="controls">
                <div class="fabrikElement">
                    <?php echo $elements ['ejection']->element;?>
                </div>
                <div class="fabrikErrorMessage"> </div>
            </div>
        </div>
    </div>
    <div class="row-fluid">
        <div class="control-group fabrikElementContainer plg-yesno fb_el_reports___warning">
            <?php echo $elements ['warning']->label; ?>
            <div class="controls">
                <div class="fabrikElement">
                    <?php echo $elements ['warning']->element;?>
                </div>
                <div class="fabrikErrorMessage"> </div>
            </div>
        </div>
    </div>
    </fieldset>
    <fieldset class="secondfieldset">
    <legend class="legendtext2">Participants</legend>
    <div class="row-fluid">
        <div class="control-group fabrikElementContainer plg-field fb_el_reports___subject_name">
            <?php echo $elements ['subject_name']->label; ?>
            <div class="controls">
                <div class="fabrikElement">
                    <?php echo $elements ['subject_name']->element;?>
                </div>
                <div class="fabrikErrorMessage"> </div>
            </div>
        </div>
    </div>
    <div class="row-fluid">
        <div class="control-group fabrikElementContainer plg-field fb_el_reports___subject_position">
            <?php echo $elements ['subject_position']->label; ?>
            <div class="controls">
                <div class="fabrikElement">
                    <?php echo $elements ['subject_position']->element;?>
                </div>
                <div class="fabrikErrorMessage"> </div>
            </div>
        </div>
    </div>
    <div class="row-fluid">
        <div class="control-group fabrikElementContainer plg-databasejoin fb_el_reports___official_name mode-dropdown">
            <?php echo $elements ['official_name']->label; ?>
            <div class="controls">
                <div class="fabrikElement">
                    <?php echo $elements ['official_name']->element;?>
                </div>
                <div class="fabrikErrorMessage"> </div>
            </div>
        </div>
    </div>
    <div class="row-fluid">
        <div class="control-group fabrikElementContainer plg-field fb_el_reports___official_email">
            <?php echo $elements ['official_email']->label; ?>
            <div class="controls">
                <div class="fabrikElement">
                    <?php echo $elements ['official_email']->element;?>
                </div>
                <div class="fabrikErrorMessage"> </div>
            </div>
        </div>
    </div>
    <div class="row-fluid">
        <div class="control-group fabrikElementContainer plg-field fb_el_reports___official_phone">
            <?php echo $elements ['official_phone']->label; ?>
            <div class="controls">
                <div class="fabrikElement">
                    <?php echo $elements ['official_phone']->element;?>
                </div>
                <div class="fabrikErrorMessage"> </div>
            </div>
        </div>
    </div>
    <div class="row-fluid">
        <div class="control-group fabrikElementContainer plg-field fb_el_reports___official_level">
            <?php echo $elements ['official_level']->label; ?>
            <div class="controls">
                <div class="fabrikElement">
                    <?php echo $elements ['official_level']->element;?>
                </div>
                <div class="fabrikErrorMessage"> </div>
            </div>
        </div>
    </div>
    <div class="row-fluid">
        <div class="control-group fabrikElementContainer plg-field fb_el_reports___official_other1">
            <?php echo $elements ['official_other1']->label; ?>
            <div class="controls">
                <div class="fabrikElement">
                    <?php echo $elements ['official_other1']->element;?>
                </div>
                <div class="fabrikErrorMessage"> </div>
            </div>
        </div>
    </div>
    <div class="row-fluid">
        <div class="control-group fabrikElementContainer plg-field fb_el_reports___official_other2">
            <?php echo $elements ['official_other2']->label; ?>
            <div class="controls">
                <div class="fabrikElement">
                    <?php echo $elements ['official_other2']->element;?>
                </div>
                <div class="fabrikErrorMessage"> </div>
            </div>
        </div>
    </div>
    </fieldset>
</fieldset>ETC ETC
 

Attachments

  • report_form.jpg
    report_form.jpg
    412.1 KB · Views: 239
By adding nested fieldset tags you are "breaking" the Fabrik sturcture, I assume this is the problem (the fieldset in default.php is e.g. holding the groupid).

You should create additional Fabrik groups for your "inner" fieldsets, add some custom CSS to float the groups (until here you won't need a custom template at all)
and maybe some divs for the "outer" borders.
 
Hi Troester

Thanks for the quick feedback. I converted all the fieldsets to divs to see if this was the problem, and it wasn't. I even removed all the divs and kept the fields. Again not the problem. I said in the post above it would be something simple, and it was, I left the hidden ID field off the form. Putting it back and the form works fine for ADD and EDIT. (see below). Doh! My really stupid mistake for the week.

In effect your comment on holding groupid got me thinking clearly. You don't need the internal ID to ADD a record (autogenerated), but definitely need it to EDIT as it does not know where to save it. Thanks again.

PHP:
<fieldset class="outerfieldset">
<legend class="legendtext">Report Background</legend>
    <fieldset class="firstfieldset">
    <legend class="legendtext2">Details and Actions</legend>
    <div class="row-fluid">
        <div class="control-group fabrikElementContainer plg-internalid fb_el_reports___id fabrikHide">
            <?php echo $elements ['id']->label; ?>
            <div class="controls">
                <div class="fabrikElement">
                    <?php echo $elements ['id']->element;?>
                </div>
                <div class="fabrikErrorMessage"> </div>
            </div>
        </div>
    </div>
ETC ETC
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top