claudio morinico
|
| Posted: 11/25/2005, 5:14 AM |
|
Hello to everyone.
I am trying CCS and would like to know how to do the following.
I have a grid that lists table records from SQL table "Drivers".
Each driver has assigned a vehicle too ("Vehicles" table).
The grid lists each driver and it's corresponding vehicle.
Also i have a vehicles grid to show vehicles on a separate page.
I have each record edit pages too.
What i want to do is call the edit vehicle from the drivers grid (column vehicle) and from the vehicles grid. But i cannot make the vehicle edit page return to the corresponding caller grid.
Do you understand what i mean or should i explain a bit more? (sorry for my -not so good- english)
Thanks in advance.
Claudio Morinico.
|
|
|
 |
mrachow
Posts: 509
|
| Posted: 11/25/2005, 7:21 AM |
|
I'm using to things.
One is Javascript like <a href = "javascript:history.back()"> Go back </a>
or
every initial page is setting a session variable
Session("Backpage") = PathToCurrentPage & FileName
and later on the called page
Redirect = Session("Backpage")
The used variables are set from Studio (Syntax is ASP).
All is included as Custom Code.
_________________
Best regards,
Michael |
 |
 |
cmorinico
Posts: 4
|
| Posted: 11/25/2005, 7:36 AM |
|
Michael, thanks for your answer.
Using the javascript approach (or back button) doesn't give satisfactory results because if you edit the data, the grid isn't updated.
I will look into the second option so see if i can implement it that way.
Anyway other suggestions are welcome.
Regards,
Claudio.
|
 |
 |
mrachow
Posts: 509
|
| Posted: 11/27/2005, 4:10 AM |
|
Ahh ... depending on your scripting language look for a command/function that will make your initial page to be requested anew on every visit.
For example for PHP
header("Cache-Control: no-cache, must-revalidate");
_________________
Best regards,
Michael |
 |
 |
cmorinico
Posts: 4
|
| Posted: 11/28/2005, 7:47 AM |
|
OK, i understand. I manually do that in some PHP pages i coded manually.
But where can i insert this code in CCS?
Thanks for your time and patience.
Claudio.
|
 |
 |
cmorinico
Posts: 4
|
| Posted: 11/28/2005, 9:05 AM |
|
I mean where in the form code should i insert this code to make the send, cancel and delete button return to the calling page.
I cannot use the javascript code because as i understand, i can only insert a header('Location: xxxx')...
I have been studying the generated class, but i cannot find a way to do it.
The only thing i can do right now is insert a link label and direct it to the calling page using javascript as you suggested, but it is not very professional.
BTW: i use PHP language.
Regards,
Claudio.
|
 |
 |
peterr
Posts: 5971
|
| Posted: 11/28/2005, 3:37 PM |
|
Claudio,
I would probably try to do this on the server, by modifying the $Redirect variable. An example is shown at http://docs.codecharge.com/studio3/html/ProgrammingTech...irectUsers.html , although $Redirect can be changed in several events. I recommend that you test simple code in After Insert/Update/Delete events, like $Redirect="SomePage.php". When this works then you can use several methods to detect the previous page, like checking the HTTP Referrer, or creating a session variable on the previous page/grid, or appending a URL parameter to the link on the previous page/grid.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
 |
 |
cmorinico
Posts: 4
|
| Posted: 11/29/2005, 3:55 AM |
|
Thanks, i already figured that and implemented it successfully with a URL parameter. I like CCS more and more every day. I'll have to convince my boss to buy it.
Also i like the support on this forum.
Thanks again.
Claudio.
|
 |
 |