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

 Custom Code Not Coppied

Print topic Send  topic

Author Message
paulmason411


Posts: 127
Posted: 05/21/2009, 8:28 PM

When I copy a grid or record from one page to another the custom code blocks are reinitialized with the "// Write your own code here." comment and all previous code is removed. Is this a bug or purposeful? Is there a workaround, apart from manually copying the code each time?

_________________

http://paulmason.name - Web Development Blog

View profile  Send private message
jjrjr1


Posts: 942
Posted: 05/21/2009, 9:21 PM

What version??

I have never had that problem but have not checked in the latest release..


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


Posts: 5971
Posted: 05/21/2009, 9:32 PM

Which specific event is it? And which programming language?
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
jjrjr1


Posts: 942
Posted: 05/21/2009, 9:41 PM

LOL

Yea Peter. That is the better question.....


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

Posts: 838
Posted: 05/22/2009, 7:55 PM

afaik it has always done that for me - php, v 2.x, 3.x, 4.x

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


Posts: 5971
Posted: 05/23/2009, 6:13 PM


There are specific instances when this should happen. It should not happens in every case.
Also, it's easy to forget cases when this did not happen - most people don't pay attention when events are copied.

_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
jjrjr1


Posts: 942
Posted: 05/23/2009, 7:52 PM

Peter

Can you cite times when custom code should and should not copy.

That would be good info to know.

Thanks.

BTW I will be in Las Vegas soon. I will stop in and visit.

John

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


Posts: 127
Posted: 06/03/2009, 7:00 PM

My programming language is PHP. I just tried to replicate the error, but can't exactly remember how it happened. I'll let you know if it happens again, with more specific details.

_________________

http://paulmason.name - Web Development Blog

View profile  Send private message
paulmason411


Posts: 127
Posted: 06/04/2009, 8:32 PM

I just copied a panel with an include page inside it from one page to another and the custom code for the Before Show event was lost. This was the code that should have been copied over:

  
if (CCGetParam("con_id") == 0) {   
  $Component->Visible = true; 	  
}  


Can someone explain to me why this happens?
_________________

http://paulmason.name - Web Development Blog

View profile  Send private message
peterr


Posts: 5971
Posted: 06/05/2009, 2:38 PM

Hi,

Logically this can happen if your component name (for example Panel1) is different in the new page, in which case the code no longer applies to the previous component name.
For example if your new page already has Panel1 then the component may be pasted as Panel2.
Events are always specific to component names, page names, etc. For example if you copy a page then logically page events may be lost, while component events should be kept.

Though there were some bugs related to this functionality in the past, so there is still a chance that something may not work as it should.

_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
tcb

Posts: 34
Posted: 06/10/2009, 12:17 PM

Quote peterr:
this can happen if your component name (for example Panel1) is different in the new page, in which case the code no longer applies to the previous component name.

That's what the $Container and $Component objects are for, surely?

I'm not complaining - the copy support is quite good these days, compared with CCS 3.
View profile  Send private message
paulmason411


Posts: 127
Posted: 06/23/2009, 7:53 PM

I just copied a panel from one project to another and the custom code on the before show was removed. The code was using relative coding variables e.g. $Component, $Container so was perfectly correct. I don't think this code should be removed. If anything there should be a user prompt that says 'some of the custom code copied might need updating etc.'. It seems like a bug when things go missing without warning. Hope this can be a feature in the next update. Thanks.
_________________

http://paulmason.name - Web Development Blog

View profile  Send private message
tcb

Posts: 34
Posted: 07/06/2009, 11:02 AM

Totally agree, panels can be a problem. The "relative" variables were presumably introduced for the purpose of enhancing reusability. The main reason for copying a component at all is to reuse its assets, including custom code. If there were an alert that the custom code is being copied (or not), so much the better, but a copy should be an exact copy.
View profile  Send private message
jjrjr1


Posts: 942
Posted: 07/06/2009, 11:37 AM

I have never had this problem. When ever I copy a panel everything copies with it.

Maybe the difference is I nver try to do it from project to project.

If i have a page that has a panel or component I want, I move the ccp file into the new project. Then I open it in the new project, select and copy the component or panel, Then paste it into the new page.

Doing it like that, I have never lost custom code.


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

Posts: 34
Posted: 07/06/2009, 12:02 PM

Oops, missed the bit about copying between projects.

Personally I would not trust CCS to hold the contents of the copy buffer across a project change. In my experience, CCS is likely to lock up/shut down during complicated moves or copies. (Some people don't seem to have this problem.)

By all means "Save As" the page into the other project folder, then pick off your components from that copy, then delete the unused stuff.
View profile  Send private message
Waspman

Posts: 948
Posted: 07/06/2009, 2:50 PM

Yeah I have had problems copying, including sudden shutdowns with nothing saved.

The latest version seems to be OK. It crashes and hangs just like before, but I still luv it;-)
_________________
http://www.waspmedia.co.uk
View profile  Send private message
paulmason411


Posts: 127
Posted: 07/06/2009, 7:47 PM

Quote :
have never had this problem. When ever I copy a panel everything copies with it.

Just because it hasn't happened to you doesn't mean that it will never happen to you in the future. If you read above I have had the problem occur from copying panels within projects as well as from project to project.
_________________

http://paulmason.name - Web Development Blog

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.