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 -> General/Other

 Fatal error: Cannot redeclare header_beforeshow()

Print topic Send  topic

Author Message
David Milan
Posted: 02/24/2006, 3:59 AM

When ever I include an includable page (Header.ccp) in my Default.ccp, I get the following error.

=========================================
Fatal error: Cannot redeclare header_beforeshow() (previously declared in C:\Apache2\htdocs\Corporate\Header_events.php:5) in C:\Apache2\htdocs\Corporate\Header_events.php on line 43
=========================================

If I exclude the Header, no issue but I need the Header to be included. Line 43 refers to the following function:

=========================================
//Header_BeforeShow @1-A14CFA36
function Header_BeforeShow(& $sender)
{
$Header_BeforeShow = true;
$Component = & $sender;
$Container = CCGetParentContainer($sender);
global $Header; //Compatibility
//End Header_BeforeShow

//Hide-Show Component @4-286F3E6C
$Parameter1 = CCGetFromGet("ViewMode", "");
$Parameter2 = "Print";
if (0 == CCCompareValues($Parameter1, $Parameter2, ccsText))
$Component->Visible = false;
//End Hide-Show Component

//Close Header_BeforeShow @1-E0152CE0
return $Header_BeforeShow;
}
=========================================

Any clue on how to fix this? You help is most appreciated! :-)
padutoit

Posts: 9
Posted: 02/25/2006, 5:48 AM

Hi David,

I believe this to be a bug, the problem is the that fact that a report you have built at some stage with the print option has included the text

//Hide-Show Component @4-286F3E6C
$Parameter1 = CCGetFromGet("ViewMode", "");
$Parameter2 = "Print";
if (0 == CCCompareValues($Parameter1, $Parameter2, ccsText))
$Component->Visible = false;
//End Hide-Show Component

to the header events, nothing you do will change that for this page (I stand corrected) the only way I manged to get around this problem and see my Header include again was to copy any custom code to notepad and copy all the html if you have modified it with adding labels etc. to notepad as well.

Delete the header page from CCS and create it again (same name) then make it an includable page and edit the html, copy back your html from notepad and then return to design if you had any custom code like onbeforeshow etc. go to the events of the page and add the custom code then copy back your custom code and save and publish.

CCS staff I can recreate this problem time and time again, so I do believe it to be bug but I will wait for you guys to answer here for a better way around before adding it as a bug.
View profile  Send private message
brucewin

Posts: 143
Posted: 03/14/2006, 12:30 PM

I had the same thing happen to me. My work around was deleting the includable page header and copying my tables to the new page. Thanks to this post I found out the problem. I wasn't working on the header, the thing just quit working, just like you said, afterI created a report with the print option.

Now I am afraid to use the print option on grids or reports. Should I be?

Bruce
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.