Forums

front editing in CC V4 RC3.2/ CF V4 RC 3.5

bighen 16 Sep, 2012
Hi all,

I'm trying to create proper cf form to display records from the CC connection.
No success. OK, the form loads but never with data in the fields.

To learn from basics I went through tutorials accessed here:
http://www.chronoengine.com/faqs.html
No success again. Again, the form loads but never with data in the fields.

I've read some topics about it but again no clue regarding built-in form display.
Actaully I've made myself a few such list/form pages but it was always hand-made, never

After some debugging I discovered that the form does not fill in with data because of model name.
If connection uses any model name it does not work cause when form is loaded
it does not find data in sub-array named with cc model name.
It looks for the data in standard array without the model name.

I hope someone was at that point and found what is the easiest way to fix it somehow.
Here:
http://chronoengine.com/forums.html?cont=posts&f=12&t=67806&p=271502&hilit=form+db+save#p271502
is the way which probably creates the same model name structure in the form display side however it's a bit complex...

My connection is made of 3 different tables and I need the model name at the connection definittion.

Long post... I hope Bob or Max would be so kind to explain something or give any hint

Regards
Henryk
bighen 16 Sep, 2012
While waiting for smarter solution I found two solutions:

1. You can add DB Load Record action to the form.
DB Field should be the name of record id field (usually id or cf_id)
Table - obviously the table you are browsing
Request parm - is always 'cb' cause that;s what CC V4 prepares as the id of displayed record
Model ID - the name of model id used in connection definition

Works ok however I haven't found multi-table config working so if relations used it's no good.

2. You can add Custom code action and put a piece of PHP cloning the arrays properly:
foreach ($form->data['modelid'] as $k => $v) {
    $form->data[$k] =  $v;
}

Works great!

These are a bit 'dirty' clues however if something works who cares...

Henryk
GreyHead 17 Sep, 2012
Hi Henryk,

I'm not very familiar with the new ChronoConnectivity but my understanding is that it will handle the edit functions internally. But that may not be true if you have linked tables.

Please see this FAQ for setting up linked DB Record Loaders.

Bob
Max_admin 18 Sep, 2012
Hi,

If you use a Model name "Article" then your form fields names should match this, example:

Without a Model name, your form field name should be: "title"

With Model name: Article[title]

I hope this clears itπŸ™‚

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
bighen 18 Sep, 2012
Thanx Max,
Why I couldn't see it ?
πŸ˜€
Henryk
kevinliang 30 Sep, 2012
HI Max,
Using the model name with field name together(sample: Article[title]) on the form, the data from two tables can been displayed on the form correctly, but when I use the same form to create new record which I set "Save Under Model Id" to yes, all the input data was gone, the record was generated in table but without the input data, I did not even see the input data on the debug screen.

But for the same form, If I set the field name without model name (sample:title),i can create new record in two tables successfully.

Because in ChronoConnectivity, I only can set one form for front Editing, how can I use one form to view/edit existing data from multiple table, and create new record as well.


Regards

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