CodeCharge Studio
search Register Login  

Web Reporting

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

YesSoftware Forums -> CodeCharge Studio -> PHP

 Change the Link Component dynamically

Print topic Send  topic

Author Message
romeop

Posts: 6
Posted: 04/19/2004, 12:06 PM

Hi,
I have a grid form containing only a link component. When a user clicks on one of the rows he gets redirected to the same page(with the ID of the clicked row in the URL). Now I want to dynamically show which was the clicked row by either setting the td - bgcolor to a different color or changing the link color of the appropriate link or (would be perfect) changin the link component to a label component.

The aim is to show the user what cell he has clicked on (this is very often used in navigation headers). How can I make this inside codecharge?
I haven`t found the ability to make anything similar up to know. The component reference does not help very much. Please help.
Code Snippets would be appreciated very much.
View profile  Send private message
Don Safar
Posted: 04/19/2004, 12:20 PM

Change the control to a label. In the before show row of the grid,
dynamically build a link or display text based on whether a param is passed
to the page and it if matches the id on the current row.

"romeop" <romeop@forum.codecharge> wrote in message
news:5408423374db62@news.codecharge.com...
> Hi,
> I have a grid form containing only a link component. When a user clicks on
one
> of the rows he gets redirected to the same page(with the ID of the clicked
row
> in the URL). Now I want to dynamically show which was the clicked row by
either
> setting the td - bgcolor to a different color or changing the link color
of the
> appropriate link or (would be perfect) changin the link component to a
label
> component.
>
> The aim is to show the user what cell he has clicked on (this is very
often
> used in navigation headers). How can I make this inside codecharge?
> I haven`t found the ability to make anything similar up to know. The
component
> reference does not help very much. Please help.
> Code Snippets would be appreciated very much.
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>

peterr


Posts: 5971
Posted: 04/19/2004, 12:30 PM

We have various examples on how to use the SetValue function to change control values. For example:
http://docs.codecharge.com/studio/html/QuickStart/EnhAp...FieldValue.html
http://docs.codecharge.com/studio/html/QuickStart/EnhAp...LabelValue.html
http://docs.codecharge.com/studio/html/ProgrammingTechn...ntrolValue.html
http://docs.codecharge.com/studio/html/ProgrammingTechn...eTextColor.html

And even how to change a Grid's cell color as you described:
http://docs.codecharge.com/studio/html/ProgrammingTechn...eCellColor.html

You should be able to use the above code with the CCGetParam function described at:
http://docs.codecharge.com/studio/html/Components/Funct...CCGetParam.html
You'd use CCGetParam to compare a value of a URL variable to the one in your Grid.
I don't program in PHP, but I'm assuming that in the Grid's Before Show Row event you could use the code like:
  
global $Tasks;  
  if ($Tasks->Priority->GetValue() == CCGetParam("priority_id", 0)) {  
    $Tasks->Priority->SetValue("<font color=RED>".$Tasks->Priority->GetValue()."</font>");  
  }  
(I modified the example from the CCS doc at http://docs.codecharge.com/studio/html/ProgrammingTechn...eTextColor.html)

I'm not sure if modifying a Link's value will not cause problems, therefore if it doesn't work then either change the cell color, or add a Label in front of your Link that you can use to display something in front of the link, for example "->".
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.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.

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.