Forums

New/Edit buttons not working when accessed through a form

Bullfn33 17 May, 2012
I was attempting to set up a CC connection through a form using a ChronoConnectivity task but when I access the form in front end and click on one of the toolbar buttons like New or Edit it just adds a # at the end of the url and nothing happens.

Is this a bug or maybe something wrong in my setup?
GreyHead 18 May, 2012
Hi Bullfn33,

I'm not sure but I think that the buttons use JavaSCript so this sounds like a JS error on the page.

Bob
Bullfn33 22 May, 2012
I decided to use CC directly to display form results without going through a form. When I do this the New button works but the Edit button reloads the connection with the "Wrong record!" system message displayed. I'm guessing this is because I have auto-listing turned off since I'm using the custom header/body/footer boxes and there is no way to select a record to edit.

I'm using the toolbar buttons since I'm not sure if there is a way to add them in the custom boxes such as using the {edit_record} syntax like in version 3. I attempted to use the _EDIT_:Edit format that is shown in the Toolbar tasks option but that does not show anything.

In the old version you could just hit the edit button and the record that was loaded would direct to the populated form. Is there a way to have CC4 behave the same way?
Max_admin 23 May, 2012
Hi,

In the custom listing you can use:

{paginator} to display the pagination box

{checkbox} to display the checkboxes to be used with the toolbar.

You can also use the "List view fields" and the "Edit fields" boxes, example, if you have a field called "title", then add it to both boxes, and when you write "{title} in your "custom list body" area, it will link to the edit page, automatically.

Your first solution with the form should have worked, but it has a bug in RC2, it has been fixed in the coming release.

Regards,
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
Bullfn33 24 May, 2012
The users only view their own one record so my aim is to only require one click in the toolbar to edit the record. To clarify, will the next release allow me to use my first solution to display a connection through a form where the edit button on the toolbar will take the user to edit his data without having to click a checkbox?
Max_admin 31 May, 2012
What about setting up the "Read" permissions to the "Owner" only ? they will get access denied when they try to see others records, and you can simply use the linking mechanism, you don't have to use the toolbar and checkboxes anyway ?

The new version has been released yesterday!

Regards,
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
Bullfn33 02 Jun, 2012
Hi Max,

I already have it so the users can only view their own records, however, I'm still trying to figure out a way to have them just hit the edit button on the toolbar so it displays their populated form. This worked in version 3 when using the {edit_record} tag but I understand the toolbar is a different concept to be used with checkboxes.

My first choice: It looks like the Front Permissions > General tab has the capability for users to edit their own data by selecting "Owner" in the Update Permissions box but do you still have to click a checkbox prior for this to work? It would be nice if only the Owner option is selected in the update box that it would take the user to their own w/o having to click a checkbox since that is already the logic. Maybe a feature for a future version?

My second option: for a one click edit is to place a form field in the custom list body, however, I typed a form field {username} I have in the Edit Fields and Data Listing Fields boxes then placed the tag in the body box as directed but it display a text box field with the username in it instead of a link. Before the update, it showed the link. Maybe something wrong with my set up but can you verify this still works?

Your first solution with the form should have worked, but it has a bug in RC2, it has been fixed in the coming release.


my first solution:

I was attempting to set up a CC connection through a form using a ChronoConnectivity task but when I access the form in front end and click on one of the toolbar buttons like New or Edit it just adds a # at the end of the url and nothing happens.


I also experimented with this again (going through a form to load the connection) and there was no change after updates. I'm probably not going to use this route but I wanted to let you know that I got the same results after updating.

In any event, the new version of CF fixed my existing record overwrite code so that is one big fix I needed, thank you. I love how versatile and powerful the new CF and CC are together. I just wish I was smart enough to unlock all of it's power! 😶 It is impressive and will be getting a subscription when I get things completed with this project.

John
Max_admin 03 Jun, 2012
Hi John,

The default toolbar edit button requires a checkbox, but I can tell you how to create a link called "Edit your record" and this will simply open the default edit page for the user's record.

However, here is a different solution using the toolbar:

Add this to your tool bar:
edit:Edit Your Record


This will add a new toolbar button, when you click it, it will open the "edit" event in your form, moreover, if you add "edit" to the "custom tasks" box in your connection, and you have a field named "cb" in the data passed to the new form event, then the data of this record will be loaded, so all what you will have to do is to add a hidden field to either the header or the footer (or event any row), give it a name="cb" and a value = the primary key value of the logged in user's record, then add a "Show HTML" action to the "edit" event in your form (create that event).

Pay attention to set the "Read" and "Update" permissions to "Owner" so that any smart users get blocked if they try to read other records by changing the cb value.

Regards,
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
Bullfn33 03 Jun, 2012

Hi John,

The default toolbar edit button requires a checkbox, but I can tell you how to create a link called "Edit your record" and this will simply open the default edit page for the user's record.

However, here is a different solution using the toolbar:

Add this to your tool bar:

edit:Edit Your Record


This will add a new toolbar button, when you click it, it will open the "edit" event in your form


I'm trying this solution first. I see the new toolbar button show up in the connection when I add this but then when you say it will open the edit event in the form my form did not have one. So I added an event called "edit" but then which action item do I need to add to that event to have the form load with the user's data? I tried using Show html and Chronoconnectivity Task with no luck loading the form. All I get when clicking this additional edit toolbar button is a blank page within the template. What am I missing? thanks

John
Max_admin 07 Jun, 2012
Hi John,

You will have to add "edit" to the "Custom tasks" box AND you will need to pass the the record's primary key value under "cb", so you will need a hidden field with the desired value.

Regards,
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
This topic is locked and no more replies can be posted.