CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Dynamically change link text

Print topic Send  topic

Author Message
pbrad

Posts: 58
Posted: 02/25/2008, 9:01 AM

Hi,

I am just learning CCS so I am not sure if I am doing this wrong or if there is a problem with the new version.

I have a link called Logout and I am trying to change the text to change from Login to Logout if the user is logged in. I can figure this out but right now I can't even force the link text to change to Logout or anything else.

I am using the following code on the object 'Before Show':

//Logout_BeforeShow @8-9E4497AF
function Logout_BeforeShow(& $sender)
{
$Logout_BeforeShow = true;
$Component = & $sender;
$Container = & CCGetParentContainer($sender);
global $Logout; //Compatibility
//End Logout_BeforeShow

//Custom Code @12-2A29BDB7
// -------------------------

$Logout->SetValue("test");
$Logout->SetLink("test.htm");
// -------------------------
//End Custom Code

//Close Logout_BeforeShow @8-5AB7ACC1
return $Logout_BeforeShow;
}
//End Close Logout_BeforeShow

It is picking up the Link URL change with no problems but I can't get the Link Value to change. Am I doing something wrong?

Thanks for any help,

Pete
_________________
Pete

CCS 4
MySQL
PHP
View profile  Send private message
datadoit
Posted: 02/25/2008, 1:12 PM

For the link's properties, make certain that the Visible property is set
to Dynamic.
pbrad

Posts: 58
Posted: 02/25/2008, 1:22 PM

Thanks, yes it already was set for dynamic visiblity.

Pete
_________________
Pete

CCS 4
MySQL
PHP
View profile  Send private message
datadoit
Posted: 02/25/2008, 2:18 PM

Good. Now in your HTML make sure it looks like:

<!-- BEGIN Link YourLink --><a href="{YourLink_Src}">{YourLink}</a><!--
END Link YourLink -->
pbrad

Posts: 58
Posted: 02/25/2008, 2:33 PM

Hi,

Thanks, I see my problem now! I was using an example that I found and didn't clue in that I needed to put 'YourLink' in the curly brackets, the example that I used gave:

<!-- BEGIN Link YourLink --><a href="{YourLink_Src}">{Link}</a><!--
END Link YourLink -->

and so I just put the word 'Link' inside the brackets, now I see that it should have been the name of my link. I feel slightly stupid. Thanks very much for your help.

Cheers,
Pete

_________________
Pete

CCS 4
MySQL
PHP
View profile  Send private message
datadoit
Posted: 02/25/2008, 6:37 PM

Don't feel bad. I recall many frustrations when first getting into CCS.
There are inconsistencies that drove me nuts, but with time and
experience you just know about them.

This is one of those inconsistencies. If you set a link's visible
property to Dynamic, why doesn't CCS automatically put the curly
brackets and link name in the HTML for you?

In an older CCS version, this used to be the "Extended HTML" feature for
controls, which required right clicks and properties and sub-menus that
you were supposed to subliminally know about. I think ALL controls
placed onto a page should be "Extended HTML" by default, or at least a
configuration option.

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.

PHP Reports

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

Home   |    Search   |    Members   |    Register   |    Login


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