form action between two chronoconnectivity listings

switch between ChronoConnectivity listings for different years.

Overview

The issue occurred when using a form action to navigate between two CF listings, as the form action did not redirect to the intended listing.
Use a URL parameter passed via a link instead of a form action. Create a link in one listing's footer that points to the other listing with a year parameter, then use that parameter in the second listing's WHERE SQL to filter the results.

Answered
ni nilubon03 29 Sep, 2015
Hello,

I use ChronoConnectivity to display a list of applicants for a summer camp form. Now, the new season is coming up. I need to create another list for the previous year and allow the camp coordinator switch to view the list between the current year and previous year(s).

This is what I tried and have not success.

I have two CC; current_camp and previous_camp.

On the current_camp connectivity, I have a current year list on the top. On the bottom, I have a simple form with a drop down ist for 'year' to select, then I have form action to previous_camp connectivity. Hoping that when camp coordinator select year from drop down list, the previous camp connectivity will display a list for a previous year(s).

It did not work as I expect. The form action never get to the previous_camp. It just stay on the current_camp.

Please advise.

Thank you,
Nilubon
Gr GreyHead 30 Sep, 2015
Hi Nilubon,

I would probably add a radio button to the top to use as a filter for the listing.

Bob
ni nilubon03 30 Sep, 2015
Bob,
Thank you for your suggestion. It made me to go back and follow your instruction on ChronoConnectivity dynamic filters 1.pdf.

I have a simple form with the drop down list on the header and apply your WHERE SQL to fit my form. When I click filter, I always get "You have an error in your SQL syntax; ".
Below is the code in my WHERE SQL box.
<?php
$previous_year = JRequest::getString('previous_year', '', 'post');
if ( $previous_year ) {
echo " WHERE `Year` = $previous_year ";
}
?>

Did I miss something?
Thank you,
Nilubon
ni nilubon03 01 Oct, 2015
Answer
Bob,
I got it worked.
I changed from using form to passing URL parameter on the link.
This is how I did it just someone else who needs to accomplish similar task like me.

I have 2 ChronoConnectivity listings; mycamp and mycamp_previous_year

For mycamp, I have this code on the Footer box
<?php
echo "<a href='/component/chronoconnectivity/mycamp_previous_year?previous_year=2015'>2015</a>";
?>

For the mycamp_previous_year, I have this on the WHERE SQL
<?php
$previous_year_var = JRequest::getVar('previous_year');
echo " `Year` = $previous_year_var ";
?>

On the header box, I have
<?php
$previous_year_var = JRequest::getVar('previous_year');
echo "<h3>My camp - " . $previous_year_var. "</h3>" ;
?>

Thank you for your code that help me able to apply to accomplish this.

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