Hello,
I have problem with reading data and put it into edit form.
I've followed the tutorial on http://www.chronoengine.com/faqs/72-ccv5/5208-connectivity-edit-with-chronoforms.html.
Let me explain what I did:
1. I've created an "activityregistration" form with model name "activityregmodel"
2. I've created a connection "activitylistforuser" and set it like on the tutorial.
3. I've created a copy of registration form named "activityregeditform" and used "DBread". I set the Enable ModelID --> Yes and ModelID-->"activityregmodel"
4. Loaded this "activityregeditform" on "Edit" Action
When I click on "Edit" link, it does not read the current record.
I have tried many things. Before, it was reading only first record. I've changed something and it started to read last record. Now, i added two more records to the table(their IDs like 5,6,7,9,10,11,12). Now it brings the record with ID 10(May this be because of the hidden field that I've added later?).
Another point, when I edited something on edit action, it creates a new data with new ID, does not update the current one. It records tha data on database without its uniqueID.
Confused too much. What may cause this? What am i missing?
Thank you.
I have problem with reading data and put it into edit form.
I've followed the tutorial on http://www.chronoengine.com/faqs/72-ccv5/5208-connectivity-edit-with-chronoforms.html.
Let me explain what I did:
1. I've created an "activityregistration" form with model name "activityregmodel"
2. I've created a connection "activitylistforuser" and set it like on the tutorial.
3. I've created a copy of registration form named "activityregeditform" and used "DBread". I set the Enable ModelID --> Yes and ModelID-->"activityregmodel"
4. Loaded this "activityregeditform" on "Edit" Action
When I click on "Edit" link, it does not read the current record.
I have tried many things. Before, it was reading only first record. I've changed something and it started to read last record. Now, i added two more records to the table(their IDs like 5,6,7,9,10,11,12). Now it brings the record with ID 10(May this be because of the hidden field that I've added later?).
Another point, when I edited something on edit action, it creates a new data with new ID, does not update the current one. It records tha data on database without its uniqueID.
Confused too much. What may cause this? What am i missing?
Thank you.
Hi Maat,
You don't need to use "db read" when you are using the form in Connectivity, it handles that for you, as in the tutorial, only the "HTML" action is used.
And if you have php 5.5 or later then you can try Connectivity v6, which can manage the whole app for you, here is the first tutorial:
http://www.chronoengine.com/faqs/73-chronoconnectivity-v6.html
But I'm planning to write a tutorial on data reading and editing later today.
Best regards,
Max
You don't need to use "db read" when you are using the form in Connectivity, it handles that for you, as in the tutorial, only the "HTML" action is used.
And if you have php 5.5 or later then you can try Connectivity v6, which can manage the whole app for you, here is the first tutorial:
http://www.chronoengine.com/faqs/73-chronoconnectivity-v6.html
But I'm planning to write a tutorial on data reading and editing later today.
Best regards,
Max
Hi Max,
Actually, I have started Chrono adventure with Chronoconnectivity6. I followed the steps on the tutorial that you sent. No problem when I want to list all records. I tried to create a user filter (allow the user list only his records), I couldn't. Lack of tutorial about CC6 was another problem. That was why I preferred to use CC5. Can you tell me what I should write in "Where Conditions" box at "Functions"?
I've tried this php code:
It didnt work. I tried another thing:
Didn't work either.
If I achieve to solve this problem, I can try to go further on CC6.
Thank you.
Actually, I have started Chrono adventure with Chronoconnectivity6. I followed the steps on the tutorial that you sent. No problem when I want to list all records. I tried to create a user filter (allow the user list only his records), I couldn't. Lack of tutorial about CC6 was another problem. That was why I preferred to use CC5. Can you tell me what I should write in "Where Conditions" box at "Functions"?
I've tried this php code:
<?php
$user = \JFactory::getUser();
return array('activityregmodel.user_id' => $user->id);
?>
It didnt work. I tried another thing:
activityregmodel.user_id: ???????
Didn't work either.
If I achieve to solve this problem, I can try to go further on CC6.
Thank you.
Hi maat,
Great, in v6 it's much easier:
Let me know if you meet any other issues!π
Best regards,
Max
Great, in v6 it's much easier:
activityregmodel.user_id:{user:id}
Let me know if you meet any other issues!π
Best regards,
Max
Hi Max,
Didn't work either. :? Still blank list with table headings.
Any other suggestions?
activityregmodel.user_id:{user:id}
Didn't work either. :? Still blank list with table headings.
Any other suggestions?
Hi again,
After discovering "debug", I found why it is blank list when added user filter . π Debug says:
It says user_id=646, and this ID belongs the super user. That was why the list is blank, because there is no records from that user. To test other user, I needed a real menu link, not the "open connection" window on Chronoconnectivity6 interface. I tried to add a new menu item with menu type "Chronoconnectivity6-->Default". When I select this menu type, I had an error "Error loading form file"
Stuck againπ
After discovering "debug", I found why it is blank list when added user filter . π Debug says:
Array
(
[0] => SELECT `Connection`.`id` AS `Connection.id`, `Connection`.`title` AS `Connection.title`, `Connection`.`alias` AS `Connection.alias`, `Connection`.`published` AS `Connection.published`, `Connection`.`public` AS `Connection.public`, `Connection`.`description` AS `Connection.description`, `Connection`.`params` AS `Connection.params`, `Connection`.`events` AS `Connection.events`, `Connection`.`views` AS `Connection.views`, `Connection`.`functions` AS `Connection.functions`, `Connection`.`locales` AS `Connection.locales`, `Connection`.`rules` AS `Connection.rules` FROM `ztfuh_chronoengine_connections6` AS `Connection` WHERE `Connection`.`alias` = 'activitylistforuser';
[1] => SELECT COUNT(`activityregmodel`.`id`) AS `activityregmodel.count` FROM `ztfuh_chronoengine_chronoforms_datatable_actregform` AS `activityregmodel` WHERE `activityregmodel`.`user_id` = '646';
[2] => SELECT `activityregmodel`.`id` AS `activityregmodel.id`, `activityregmodel`.`uniq_id` AS `activityregmodel.uniq_id`, `activityregmodel`.`user_id` AS `activityregmodel.user_id`, `activityregmodel`.`created` AS `activityregmodel.created`, `activityregmodel`.`modified` AS `activityregmodel.modified`, `activityregmodel`.`activityname` AS `activityregmodel.activityname`, `activityregmodel`.`activitygoal` AS `activityregmodel.activitygoal`, `activityregmodel`.`activityfield` AS `activityregmodel.activityfield`, `activityregmodel`.`activitymethod` AS `activityregmodel.activitymethod`, `activityregmodel`.`activityplan` AS `activityregmodel.activityplan`, `activityregmodel`.`activityparticipantnumber` AS `activityregmodel.activityparticipantnumber`, `activityregmodel`.`activityduration` AS `activityregmodel.activityduration`, `activityregmodel`.`activitysubmit` AS `activityregmodel.activitysubmit` FROM `ztfuh_chronoengine_chronoforms_datatable_actregform` AS `activityregmodel` WHERE `activityregmodel`.`user_id` = '646' LIMIT 30;
)
It says user_id=646, and this ID belongs the super user. That was why the list is blank, because there is no records from that user. To test other user, I needed a real menu link, not the "open connection" window on Chronoconnectivity6 interface. I tried to add a new menu item with menu type "Chronoconnectivity6-->Default". When I select this menu type, I had an error "Error loading form file"
Stuck againπ
Hi maat,
I will check the menu link problem, but you can simply append this to the link in your browser address bar:
Then in the "Where conditions":
Best regards,
Max
I will check the menu link problem, but you can simply append this to the link in your browser address bar:
&user_id=789
Then in the "Where conditions":
activityregmodel.user_id:{data:user_id}
Best regards,
Max
Hi Max,
Still tryin on CC6 and waiting for a tutorial about "modify data".
Meanwhile, I returned CC5 and removed DBread part. It worked. Now, it brings the right data.
Thank you for your guidence.
Best regards.
Still tryin on CC6 and waiting for a tutorial about "modify data".
Meanwhile, I returned CC5 and removed DBread part. It worked. Now, it brings the right data.
Thank you for your guidence.
Best regards.
Hi maat,
Glad you got v5 working for now.
I will try to write a tutorial on this soon, also v6 next update has a wizard mode to make the connection creation process easier, you may send me a message using the "contact us" page to get a backup file.
Best regards,
Max
Glad you got v5 working for now.
I will try to write a tutorial on this soon, also v6 next update has a wizard mode to make the connection creation process easier, you may send me a message using the "contact us" page to get a backup file.
Best regards,
Max
This topic is locked and no more replies can be posted.