Passing variable to a connectivity app

chriso0258 03 Nov, 2012
I have a drop down menu which lists 18 categories of books in our chess library. I started to write 18 different connectivity apps for each category and then thought there had to be a better way, using only one app which would use a variable sent by the form to the app defining the WHERE statement filter (i.e. WHERE 'category'=3).

I've tried using the DB Multi Record Loader which worked great in listing the filtered books, however, I need to be able to click on a book to go to more book details and to be able to add a checkbox and submit button to checkout the book from the library.

I then tried the Chrono Connectivity Task action, but it would only execute the app as written, meaning that the app defined the WHERE statement and not the form. Also, what is the difference between "Data Field Name" and "Field Name". Maybe I'm configuring something wrong.

Hope I've made some sense here. Is there a way to pass a variable to a connectivity app, since it is in the app that I can configure all the other parameters such as editing, formatting, etc.

Here is the debugger info:

Array
(
[chronoform] => library_category_select
[event] => submit
[Itemid] => 813
[option] => com_chronoforms
[view] => form
[category] => 2
[input_submit_8] => Submit
[b6a7562249e6c0c25e4040f068c5b874] => 1



Thanks.
Max_admin 03 Nov, 2012
Hi chriso,

You can pass it in the url to the connection and capture it in the SQL box using php:

index.php?option=com_chronoconnectivity&chronoconnection=content&task=cc_list_data¶m=3

And in the SQL box:
<?php $param = JRequest::getVar('param'); ?>


Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
chriso0258 04 Nov, 2012
Thanks Max. Using your suggestions I did get it working. Just for any others who may have similar questions (and for myself when I forget six months from now😶 ), here is what I did.

1. Add a Chrono Connectivity Task in your form's event. Fill in the Connection name, and task.
2. In the connectivity app, I put the following in the WHERE SQL box:
<?php $param = JRequest::getVar('category');
if ($param >= 1) {
echo "Category="; echo $param;
}
?>
chriso0258 04 Nov, 2012
Well, one problem solved lead to another. When I click on the link to view a publication I get the following error:

There is no connection with this name or may be the connection is not published, Please check the available connections in the Connections Manager.



However, if I link directly to the connectivity app (with no php script) without going through the Chrono Connectivity Task, things work well. I think the reason is that different links are created for the publications depending on the method used.

If I go through the Chrono Connectivity Task, this type of link is created for each publication:

http://www.ccchessclub.jesusmylord.org/index.php/component/chronoconnectivity/cc_edit_data/56?Itemid=813

and I get the above error message. Note: Each of the publication links contains the added ?Itemid=813.

However, if I link directly to the connectivity app (say through a menu option), this link is created for each publication:

http://www.ccchessclub.jesusmylord.org/index.php/cumberland-county-chess-club-library/all-materials/cc_edit_data/56

Note the lack of the ?Itemid=813.

As a side note, if I test the form from the backend, it works fine because the Itemid is empty and therefore does not affect the link.

Is there anything I can do to get the links to work using the Chrono Connectivity Task method I've set up? Somehow, strip the Itemid from the link?

Thanks.
chriso0258 07 Nov, 2012
Does anyone have any ideas as to why I can't access my form through a Chrono Connectivity Task? You can see what I'm referring to at http://www.ccchessclub.jesusmylord.org/. If you click on the "All Materials" menu item under "Library" and then click on a book, you will see how things are supposed to work.

However, if you click on the "Library" link and then make a selection and then click on a book, you get a connection error.

I see that two different links are being created. I would like to be able to use the category selection method (by clicking the "Library" menu item) but I don't know how to correct this problem.

Please help. I'm at a loss.
Max_admin 08 Nov, 2012

1. Add a Chrono Connectivity Task in your form's event. Fill in the Connection name, and task.
2. In the connectivity app, I put the following in the WHERE SQL box:

<?php $param = JRequest::getVar('category');
if ($param >= 1) {
echo "Category="; echo $param;
}
?>



What if you do #2 only here ? why should you access the connection through a connectivity task ?

You can pass the category in the connection url

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
chriso0258 16 Nov, 2012

why should you access the connection through a connectivity task ?

You can pass the category in the connection url



Thanks for answering Max. I guess I'm more confused than I thought. I thought the only way to access the connection was through a connectivity task. Can you explain how to access it upon making a selection and submitting? How will the form know which app to use?

Regarding your other comment, how do I pass the category in the connection url? I know that it is already being past via POST, but, then back to the first question, how does the form know to query the appropriate connection app?

Also, the problem isn't getting the category passed. The problem is executing the Front Form listed in the connectivity app's front editing tab. I've changed the link to the website. If you go to http://cumberlandcountychess.org/ and select library, you can see what I mean.

I apologize if I've sounded confused, I guess because I am confused. Thanks for you patience. It is greatly appreciated.
This topic is locked and no more replies can be posted.