Forums

Save Data from repeatable Form

Proximate 20 Feb, 2018
Hi
I've now figured out how to create Repeatable Forms. Next Issue is, i am not able to bring the Save / Update Function of a "repeatet Form" to Work.
I hope i am missing just spomething simple, unfortunately i was not able to debug before save (?) like "show me what we try to save"

DB Structure:
aio_packs --> contains all Packages (Master)
aio_equipment --> contains all Equipments
aio_package_equipment --> Defines which Equipment should be listed inside which package and the amount (once, twice and so on)
A Repeater View contains the form with the fields for ID, Amount, Text Identifier (read Only), Update and Delete Button
to display a value in the form field for the actual amount i added this into the Value field: {var:repeater_equipment_edit_view.row.Data.equipment_amount}

Field names are: "Data[id]" "Data[equipment_amount]"
Save Button has its own ID : "button_{var:repeater_equipment_edit_view.row.Data.id}"

The form looks actualy like that (inwork):


The Problem now is, the Save function can't handle the inputs, nothing happens on the DB on Save. Data Provider is set to {data:Data}
Second: for some reason it reloads all "Amount-Fields" with the changed value, but just in the view, nothing on the db.

I have also created another view called simple_edit (just to check if the save function works) - this one saves a new entry in the db (which i think is ok because there are no related data informations for ID on form load).


i've attached the SQL and a Backup aswell.

Please be kind, its still "work in progress" :-)[file=10114]All_in_One_Packages_20_Feb_2018_17_48_37.c6bak[/file]
​[file=10115]Aio_Packs.sql.zip[/file]


Thx for your feedback & sorry for the long Post
Proximate 20 Feb, 2018
Additional info:
I added now hidden fields for each table column - if i click on save the page blinks short and then i have the following debug:

Array
(
[option] => com_chronoconnectivity6
[cont] => manager
[conn] => all-in-one-packages
[pack_id] => 2
[event] => edit
[Data] => Array
(
[id] => 2
[package_id] => 2
[equipment_id] => 1
[equipment_amount] => 90

)

[button4] =>
[8fd29f445baa6933f74c2d3c5d0c496e] => a55246f88b6c612763d33b319ca4a942
[23e820ba035e658a94025b4a02bea2fb] => 62012e29f9432b65cbd3f916a9468443
)
As far as i understand, save function should be able to process the Data if i set Data Provider to {data:Data} (Save Model is also Data but that isnt important isn't it?)

kind regards
Proximate
Max_admin 20 Feb, 2018
Hi Proximate,

Do you have a loop function to handle the repeater save ? if not then please check the Chronoforms6 manual in the downloads page as it explains how to do that.

Best regards
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Proximate 20 Feb, 2018
Hi Max

Thanks for your fast response - no actualy i did not use the Loop for saving - but i have a save button (Refresh) Button for each element something like:

form start
id
name
amount
save button
form end

form start
id
name
amount
save button
form end

form start
id
name
amount
save button
form end

... and so on so i save just one element is this not possible?
the main idea is to have a later an inline form for each element.

Kind regards
Proximate
Proximate 21 Feb, 2018
Answer
Its ok now
i rebuilded the whole thing now based on your Dynamic example via Table view and Inline Edit and Update all Button. less complicated and works like a charm :-)

Checkout the dynamic example with table view and the Loop Function for save
This topic is locked and no more replies can be posted.