CodeCharge Studio
search Register Login  

Visual PHP Web Development

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

YesSoftware Forums -> Archive -> GotoCode Archive

 Changing a value in Before Show event

Print topic Send  topic

Author Message
OIGweb
Posted: 11/06/2003, 8:23 AM

I have a grid that pulls a value from the DB, the value is a 1 or 0 and I am trying to change the value to Yes if the value is 1 and No if it is 0. This is what I have so far but it does not work. I am new to CCS, thanks.

Table code

do {
$this->ds->SetValues();
$Tpl->block_path = $ParentPath . "/" . $GridBlock . "/Row";
$this->TIME_KEEPER_EMP_ID->SetValue($this->ds->TIME_KEEPER_EMP_ID->GetValue());
$this->TIME_KEEPER_NO->SetValue($this->ds->TIME_KEEPER_NO->GetValue());
$this->TIME_KEEPER_PRIME->SetValue($this->ds->TIME_KEEPER_PRIME->GetValue());
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShowRow");

Table_events
//BindEvents Method @1-079AD58F
function BindEvents()
{
global $HR_TIME_KEEPERS;
$HR_TIME_KEEPERS->TIME_KEEPER_PRIME->CCSEvents["BeforeShow"] = "HR_TIME_KEEPERS_TIME_KEEPER_PRIME_BeforeShow";
}
//End BindEvents Method

//HR_TIME_KEEPERS_TIME_KEEPER_PRIME_BeforeShow @19-D6F75A16
function HR_TIME_KEEPERS_TIME_KEEPER_PRIME_BeforeShow()
{
$HR_TIME_KEEPERS_TIME_KEEPER_PRIME_BeforeShow = true;
//End HR_TIME_KEEPERS_TIME_KEEPER_PRIME_BeforeShow

//Custom Code @23-D1053C58
// -------------------------
global $HR_TIME_KEEPERS;
$value = HR_TIME_KEEPERS->ds->GetValue()
if ($value == 1)
HR_TIME_KEEPERS->ds->SetValue(Yes);
else
HR_TIME_KEEPERS->ds->SetValue(No);
// -------------------------
//End Custom Code
DaveRexel
Posted: 11/06/2003, 10:32 AM

::
Just a quick suggesstion, amend your custom code as follows :

HR_TIME_KEEPERS->ds->SetValue("Yes");
else
HR_TIME_KEEPERS->ds->SetValue("No");

Hope this helps
Greetings
Dave

RexDesign CodeCharge Studio Tutorials
http://www.rexdesign.com/ccs/default.php
OIGweb
Posted: 11/06/2003, 11:03 AM

Thanks but I tried that, this is the error message I am recieving

Fatal error: Call to undefined function: getvalue() in /oigweb/OEO/test/HR_REPORTS/TIME_KEEPER_events.php on line 23

global $HR_TIME_KEEPERS;
line 23: $value = $HR_TIME_KEEPERS->ds->GetValue();
if ($HR_TIME_KEEPERS == 1)
$HR_TIME_KEEPERS->ds->SetValue("Yes");
else
$HR_TIME_KEEPERS->ds->SetValue("No");
DaveRexel
Posted: 11/06/2003, 12:00 PM

::
After a detailed logic check on posted code I see that the proposed solution could read :

//---CHANGE 1|0 TO Yes|No--------
global $HR_TIME_KEEPERS;
if ($value == 1)
$HR_TIME_KEEPERS->TIME_KEEPER_PRIME->SetValue("Yes");
else
$HR_TIME_KEEPERS->TIME_KEEPER_PRIME->SetValue("No");
//---------------------------------

(Assuming that the CCS component you wish to alter display is TIME_KEEPER_PRIME)

Sincerely hope this helps.
Dave
OIGweb
Posted: 11/07/2003, 6:17 AM

Thanks Dave, it works!!!!!!!!

   


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

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


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