CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Referencing object on Page from control's before show

Print topic Send  topic

Author Message
sosamv

Posts: 50
Posted: 01/02/2009, 8:24 AM

Thats pretty much it LOL, I attached a Label on the page Body and a grid below...on the grid's before_show event i want to $lbl->SetValue("BLA"); but refference dont work, I always end up using globals, but i dont like that any clues?

Thanx in advance!
View profile  Send private message
jjrjr1


Posts: 942
Posted: 01/02/2009, 11:50 AM

Hi

Try

$Container->lbl->SetValue("BLA");

Have fun

_________________
John Real - More CodeCharge Studio Support at - http://CCSElite.com
View profile  Send private message
sosamv

Posts: 50
Posted: 01/02/2009, 1:34 PM

Hi! thanx, but that doesnt seem to work, whet I have is:

let suppose:

<PAGE>
<"CCSCONTROL" I WANT TO MODIFY />

<GRID>
</GRID>
</PAGE>

grid_Before_Show{
$container->CCSCONTROL->SetValue("X");
}
This Doesnt Work...

other idea? Thanx!
View profile  Send private message
damian

Posts: 838
Posted: 01/02/2009, 1:58 PM

how can you have a ccs object outside your grid?
also in above scenario i dont think it would work because your ccscontrol occurs before your grid and so doing a before show on your grid is too late to change the ccscontrol which has already been displayed...

_________________
if you found this post useful take the time to help someone else.... :)
View profile  Send private message
sosamv

Posts: 50
Posted: 01/02/2009, 2:40 PM

Quote :
<PAGE> <"CCSCONTROL" I WANT TO MODIFY /> <GRID> </GRID> </PAGE>
Quote :
how can you have a ccs object outside your grid? also in above scenario i dont think it would work because your ccscontrol occurs before your grid and so doing a before show on your grid is too late to change the ccscontrol which has already been displayed...

hey damian! it is posible to have a control outside a form and call it from the BeforeShow Event:

function grid_Before_Show{
global $CCSCONTROL;
$CCSCONTROL->SetValue("X");
}

(The scenario above already works)

I'm just asking if it is posible to point to an object (Reference, without using GLOBALS) outside a form...
View profile  Send private message
maxhugen

Posts: 272
Posted: 01/11/2009, 5:46 PM

@sosamv, I'm not sure why you object to using globals. From my (limited) understanding of PHP, using globals (already created for you within the CCS code) is the correct way to go!

There is another technique, which consists of adding a template variable. Instead of adding a Label control from the Toolbox, manually type in something like {my_variable_name}. (curly braces and all!)

Then you can set this using the template global:
global $Tpl;  
$Tpl->setvar("my_variable_name", "X");

HTH
_________________
Max
www.gardenloco.com | www.eipdna.com | www.chrisarminson.com
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.