Forums

Return to original page if pressing cancel during edit?

ahannover 20 Nov, 2008
Not sure how to explain this in a non programmer way.

I have two choronoconnectivity connections to the same DB data. One is for listing all records with one data field having a link to the other connection for a specific record.
Lets call them connection 1 and connection 2.


Connection 1 Body
<table style="text-align: left; width: 100%;" border="0"
 cellpadding="2" cellspacing="0">
  <tbody>
    <tr<?php if ($i % 2) echo ' style="background-color: 
#EBEBEB;"';?>>
      <td style="font-weight: bold; width: 3%;">{cf_id}</td>
      <td style="font-weight: bold; width: 7%;">{date_0}</td>
      <td style="font-weight: bold; width: 4%;">{time_1}</td>
      <td style="font-weight: bold; width: 21%;">{system_1}</td>
      <td style="font-weight: bold; width: 15%;">{customer_1}</td>
      <td style="font-weight: bold; width: 40%;"><a href="index.php?option=com_chronoconnectivity&connectionname=action_log_db_edit_action + &entry={cf_id}">{action_1}</a></td>
      <td style="font-weight: bold; width: 10%;">{name_1}</td>
    </tr>
  </tbody>
</table>
<?php $i++ ?>


The second listing (connection 2) is for editing or deleting a record.
The where clause is conditioned so that it always only return one record. (the one who's link was clicked in the previous example {action_1})
Connection 2 where statement.
WHERE cf_id = "<?php echo JRequest::getVar('entry') ; ?>"

In connection 2 I have included {edit_record}.

Anyhow, the problem is that if I press edit and then reconsider and press cancel, I get redirected back to the original connection but the array is empty so list is unpopulated.
I would like to be able to redirect back to the same stage I was before pressing edit alternatively link back to connection 1.

Max, is this possible?

Best regards
Anders
Max_admin 20 Nov, 2008
Hi Andres,

if the edit is coming from Con 2 then you should redirect back to Con 2 if cancel is clicked ? you say you go back to Con 1 ? this is odd! can I see this somewhere ? and if you so then lets disable any SEF running!

Regards
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
ahannover 20 Nov, 2008
No, sorry if I made things confusing. I shouldn't really have included the information about connection 1. The main thing with that part was that connection 2 will always only list one record (the one linked from connection 1).

The edit is in connection 2 and the problem is that if I press edit and then cancel it will return to connection 2 but the list will be empty.
I wish the return url should contain the same data as before I pressed edit or be able to return to a specified url (like in chronoforms)

//Anders
Max_admin 20 Nov, 2008
aha, the cancel will just submit the form, so include a hidden field in your "frontend edit template" code in connection 2 with the name entry and make its value as you need and it should work I believe!

Regards
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
kitecom 05 Dec, 2008
Hi Guys

I've got the above working well for me now, I've managed to generate a summary list of completed forms, each with a link to the full form. Perfect. Now there's just three things I need to do...
The first is probably mind-numbingly simple, but I can't nail it. I'd like my summary list to display in reverse chronological order. Most recently completed form at the top.
The second is to limit the number of lines on the summary page (let's say a max of 20 followed by some simple pagination)
The last on is to have an "archive" button that would move a line at a time from the summary list to a second summary list (called "archive" for example)

What do we think, as far as I can see there's no pain-free way to move records from one table to another, but I can't really see any other way of making the "archive" concept work...

Thanks again in advance
Max_admin 05 Dec, 2008
Hi Kitecom,

#1- use this code in the WHERE sentence:
ORDER BY datetime DESC

#2- look at the legend tab for how to use the pagination!
#3- this iwll be hard to do yes, may be you can make a chronoform which will do this task!

Regards
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.

VPS & Email Hosting 20% discount
hostinger