chriss
|
| Posted: 08/15/2008, 2:25 PM |
|
How do I add custom code to execute when a link is clicked?
Only event is Beforeshow
|
|
|
 |
datadoit
|
| Posted: 08/15/2008, 3:21 PM |
|
Well, coupla options:
1. AJAX
2. Have the link go to a page that runs your script, then direct onward
from there (or return).
|
|
|
 |
chriss
|
| Posted: 08/17/2008, 1:09 AM |
|
AJAX - just cn't get my head around this - looked at Help, only thing I
found is hiding
controls.
I tried (2) putting my code onto a Blank page - I need to pass a database
value
so I used CCSetSession(variable, value); to set this and
$myvariable=CCGetSession(variable);
to get but how do a open the NEXT page !
"datadoit" <datadoit@forum.codecharge> wrote in message
news:g84vgl$n21$1@news.codecharge.com...
> Well, coupla options:
>
> 1. AJAX
>
> 2. Have the link go to a page that runs your script, then direct onward
> from there (or return).
|
|
|
 |
datadoit
|
| Posted: 08/17/2008, 6:06 AM |
|
$Redirect: http://docs.codecharge.com/studio40/html/Components/Var...direct.html?toc
|
|
|
 |
chriss
|
| Posted: 08/17/2008, 1:57 PM |
|
Ok this works for one link!
aarg...my problem now is CCSetSession is required for each value in the grid
so when the form opens CCSetSession will be set to ythe LAST value in the
Grid.
So I can't use CCSetsession must find some other way to pass a database
value of the link
Back to the drawing board - seems like a simple task but my Brain is not
getting it
All I want to do is open a page from a Grid but pass the database value of
link field
"chriss" <chriss@itrnospam.com> wrote in message
news:g88mce$ls5$1@news.codecharge.com...
> AJAX - just cn't get my head around this - looked at Help, only thing I
> found is hiding
> controls.
>
> I tried (2) putting my code onto a Blank page - I need to pass a database
> value
> so I used CCSetSession(variable, value); to set this and
> $myvariable=CCGetSession(variable);
> to get but how do a open the NEXT page !
>
> "datadoit" <datadoit@forum.codecharge> wrote in message
>news:g84vgl$n21$1@news.codecharge.com...
>> Well, coupla options:
>>
>> 1. AJAX
>>
>> 2. Have the link go to a page that runs your script, then direct onward
>> from there (or return).
>
>
>
|
|
|
 |
chriss
|
| Posted: 08/17/2008, 2:55 PM |
|
Press .. next to link page
"chriss" <chriss@itrnospam.com> wrote in message
news:g8a3ce$ebh$1@news.codecharge.com...
> Ok this works for one link!
>
> aarg...my problem now is CCSetSession is required for each value in the
> grid
> so when the form opens CCSetSession will be set to ythe LAST value in the
> Grid.
>
> So I can't use CCSetsession must find some other way to pass a database
> value of the link
>
> Back to the drawing board - seems like a simple task but my Brain is not
> getting it
>
> All I want to do is open a page from a Grid but pass the database value of
> link field
>
> "chriss" <chriss@itrnospam.com> wrote in message
>news:g88mce$ls5$1@news.codecharge.com...
>> AJAX - just cn't get my head around this - looked at Help, only thing I
>> found is hiding
>> controls.
>>
>> I tried (2) putting my code onto a Blank page - I need to pass a database
>> value
>> so I used CCSetSession(variable, value); to set this and
>> $myvariable=CCGetSession(variable);
>> to get but how do a open the NEXT page !
>>
>> "datadoit" <datadoit@forum.codecharge> wrote in message
>>news:g84vgl$n21$1@news.codecharge.com...
>>> Well, coupla options:
>>>
>>> 1. AJAX
>>>
>>> 2. Have the link go to a page that runs your script, then direct onward
>>> from there (or return).
>>
>>
>>
>
>
|
|
|
 |
chriscripps
Posts: 30
|
| Posted: 08/17/2008, 3:36 PM |
|
Instead of setting a session variable, how about a parameter? You could set the parameter on the parameter tab on the link setup screen (database column). You can open the dialog box with this tab by clicking the ... next to href line in the properties section. You should also get this setup dialog box when you are first setting up the link. With the key of the database set as the parameter, you could then do another query to get more information if you wanted. ie, build another grid and use the parameter in your where statement.
I think you might look at this example to get an idea how to set that up:
http://examples.codecharge.com/ExamplePack/MasterDetail/MasterDetail.php
Hope that helps,
Chris
|
 |
 |
wkempees
Posts: 1679
|
| Posted: 08/17/2008, 5:22 PM |
|
chriss,
If you read all replies carefully, and your original post is based on a grid full of links them the answer is in the combination of all replies.
Your first page is a page that contains a grid.
The grid has at least one column being the datavalue (field) you want to pass.
Publish that page (or LiveView it) and see all your desired data is there.
(taking into account filtering etc.)
Now design your calledpage and make it do your custom programming.
One thing to do is to CCGetFromGet("parametername","default value") the passed parameter.
When done, goback to your first page open the gridrow in Design rightclick the datacolum and change it to a link, then open the links properties and all will become so clear to you.
You can add the page to be called as well as the parameter, as well as the text of the link.
Walter
_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)
if you liked this info PAYPAL me: http://donate.consultair.eu
|
 |
 |
jjrjr1
Posts: 942
|
| Posted: 08/17/2008, 5:49 PM |
|
Hi
Maybe I do not get this but for what its worth I'll try. Maybe it is this simple
You have a grid. And the grid has a field that is a link right.
What you want to do is execute a link with a parameter to cause a script to do something custom. Is that right?
It seems to me you can select the link field in the grid. On the properties you can click on the href property three dots. Here you can set what you waht the url page to be and have the parameter copme from a field in that table entry. You might have to add a field to your table for that value but each entry in the grid will jave whatever value you want.
Would that work?
Of course the script called would have to know what to do for each value passed. That could be hard coded or tabel driven as well.
Let me know if I am missing something.
Have fun
_________________
John Real - More CodeCharge Studio Support at - http://CCSElite.com |
 |
 |
|