Forums

How to read and update a database created with Chronoforms?

Kronosites 06 Jan, 2016
Hi,

I have a big form that saves all the data into a database (mysql), all using Chronoforms 5. Al works perfect.

What I need is to read this saved database and upload it all the times I need throught the frontend (give to my users the way to do this). How can I do it?

Thanks.
GreyHead 07 Jan, 2016
Hi Kronosites,

ChronoConnectivity

Bob
Kronosites 07 Jan, 2016
Hi again,

Thanks bob, I was reading about Chronoconnectivity (some documentation and the F.A.Q.s) but I don't understand how to edit all the database using the same form I use to create data in this db.

Could I find an example?
Kronosites 14 Jan, 2016
Hi again,

I have read and "tested" all the F.A.Qs about CC and CF, but my edit form didn't read any data, and didn't save.
CC works well, list the data base, make one colum editable, when I click any data of this colums the form of CF opens, but opens without data, and if I try to save, shows an "OK" message but no data is stored or changed.
Here the URL of the connection: http://gamewark.com/edit

Here are the steps I've followed:

CHRONOFORMS
1- Make a New Form with all the elemets I need. That's OK.
2- Add a Hidden Field which will have the primary key from the table. In my table the primary key is on the column "unique_id"
>> My table:

>>My form:
FormName: content-edit
FormApp: edit_pqr

3- In the Setup delete put a "html render" into "on load" event, leave empty the "on submit" event and then add a "connection action" from external apps:

Finish this form, save and exit.

CHRONOCONNECTIVITY
1- Create new connection with connection name "edit".
2- In "Models" y add as title "model1" and select the table. The others fields are empty.
3- In "Front list - Settings" y add into "Colums list" this:
model1.id:ID
model1.text1:Text1
model1.checkbox2:Checkbox2

4- I put "model1-text1:Text1" inside the "edit linkkable" box (to make all this colum editable).
5- In "Front List - Actions - Edit" y add "form event" this:
content-edit:load

6- I leave the "code" empty too.
7- In "Front List - Permissions" I put "allowed" in "Public" (in index, view, edit, save, save_list and toggle).
8- I save all and close.
Here you are the URL of the connection: http://gamewark.com/edit
GreyHead 14 Jan, 2016
Hi Kronosites,

The default Joomla! and ChronoForms database methods won't work if you use uniq_id as the primary key, they require an auto-incrementing integer.

You can use uniq_id but then you have to Custom Code the DB Read and DB Save code.

Bob
Kronosites 14 Jan, 2016
Ok,

I change, and I use now in my hidden field the column "id", which is an integrer with auto-increment.
But it still didnt' work.

FYI: I add a debuger in the link of connection.
Thanks.

>> Extra Info:
My table:

My edit form:

My connection:
GreyHead 14 Jan, 2016
Hi Kronosites,

From the FAQ: All of the input names should be array names using the Model ID, e.g. Article[title] as explained in the previous tutorial. If you add IDs they need to be unique but should not include the [] characters - using e.g. title should work OK.

Please also add a Debugger action in the form ON Load event so we can see what data is being loaded (or not).

Bob
Kronosites 14 Jan, 2016
Hi,

All the IDs in my form (and my table too) are uniques, so I didn't include "[]" characters.
I have just add a "debuger" into "on load" event of my form, after the HTML render.

URL connection: http://gamewark.com/edit
GreyHead 14 Jan, 2016
Hi Kronosites,

If you don't do it as the FAQ says don't be too surprised if it doesn't work.

Bob
This topic is locked and no more replies can be posted.