maxhugen
Posts: 272
|
| Posted: 01/11/2009, 5:29 PM |
|
I've added a Label "RID" within a link so I can set a URL parameter:
<a href="/Review_popup.php" onclick="return PopupReview(this,{RID},0)">Add your review</a>
Using Firebug + FirePHP, I have verified that the Label control is being set correctly in the control's BeforeShow event:
$eid = CCGetFromGet("EID","");
fb("eid: ".$eid);
$Component->SetValue($eid);
fb("Component: ".$Component->GetValue()); // returns the expected value
However, it does not appear in the webpage !!!
Yet, the identical link and code works fine in another webpage. (I copied and pasted it to the non-working page).
I'm pulling my hair out over this... has anyone any suggestions?
MTIA
_________________
Max
www.gardenloco.com | www.eipdna.com | www.chrisarminson.com |
 |
 |
ckroon
Posts: 869
|
| Posted: 01/11/2009, 7:52 PM |
|
The first code refers to RID the second code refers to EID...?
_________________
Walter Kempees...you are dearly missed. |
 |
 |
maxhugen
Posts: 272
|
| Posted: 01/12/2009, 1:32 PM |
|
Yes, "RID" is just the name of the Label, whereas "EID" is the URL param...
_________________
Max
www.gardenloco.com | www.eipdna.com | www.chrisarminson.com |
 |
 |
damian
Posts: 838
|
| Posted: 01/12/2009, 6:42 PM |
|
it sounds like your label is displaying before the event is firing...
_________________
if you found this post useful take the time to help someone else.... :)
|
 |
 |
maxhugen
Posts: 272
|
| Posted: 01/12/2009, 7:15 PM |
|
I have the code in the Label's BeforeShow event....
_________________
Max
www.gardenloco.com | www.eipdna.com | www.chrisarminson.com |
 |
 |
jjrjr1
Posts: 942
|
| Posted: 01/13/2009, 9:01 AM |
|
Try getting rid of the label,
In the onclick event parameter for the control in the properties dialog box place your onclick javascript.
return PopupReview(this,{RID},0);
Then in the page before show event
global $Tpl
$Tpl->setvar("RID",CCGetParam("EID",""));
_________________
John Real - More CodeCharge Studio Support at - http://CCSElite.com |
 |
 |
maxhugen
Posts: 272
|
| Posted: 01/13/2009, 2:35 PM |
|
Hi John
Good news, and bad! The good news is that your suggestion works, thank you!
The bad news is that I really don't understand why?
I use template variables in a number of places, and can distinguish them from "Labels" by clicking on them - CCS doesn't display properties for it etc.
I've also used Labels outside of Forms (ie, not in a CCS block), and used BeforeShow to set their values. Haven't struck a problem before.
In a sense, I've been mixing template variables and Labels... but now I'm not sure which to use where, and why.
From your experience, can you offer any thoughts on this?
Many thanks.
_________________
Max
www.gardenloco.com | www.eipdna.com | www.chrisarminson.com |
 |
 |
jjrjr1
Posts: 942
|
| Posted: 01/18/2009, 6:45 AM |
|
Hi
I think the problem is along the lines of what damian suggested. In fact, it was his post that caused me to suggest this quick fix for you. And without looking at the code and it possibly being what he suggested, I thought this method would be the quickest en easiest to implement.
CCS sometimes places the firing order of events in such ways that they do not occur in the order you expect. You might look at the main page code to see when this label if processed at both the page level and component level.
However, you do not want to modify the CCS generated code to re-order the events. It will break CCS's ability to maintain the form.
In the past I have deleted controls and replaced them in order to get the squence i want.
In this case, I just gave you a quick fix that is not dependant on those events firing order as it seemed you just wanted to display the data and this was the easiest way to describve a fix for you.
Does that help?
_________________
John Real - More CodeCharge Studio Support at - http://CCSElite.com |
 |
 |
maxhugen
Posts: 272
|
| Posted: 01/18/2009, 3:11 PM |
|
I agree that the firing of events is not always intuitive; I have often wished for more info from YesSoftware as to the sequence(s) of these.
I'm just grateful for your 'quick fix' - one more trick to remember. 
Cheers
_________________
Max
www.gardenloco.com | www.eipdna.com | www.chrisarminson.com |
 |
 |
|