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

 "myself" in php and JS

Print topic Send  topic

Author Message
greg
Posted: 10/04/2004, 8:39 AM

Unless I miss something, there's no "myself" in php and JS... let me
explain.

Let's say I have a grid, and in the row I have a label object. I can
"add code" to, let's say ,"before show". Because of the way CCS link
this code to the object, I have to go through a global to fetch the
object reference...

Same in JS: a JS code doesn't have a clue why it's been called...

Of course I have ways to workaround these problems, but I'm interested
of why it is that way, and how you people deal with them.

Greg
Karsten


Posts: 57
Posted: 10/08/2004, 4:15 PM

hi greg,

by software architecture logic, any object can call itself and ONLY itself
can call itself.
what it mean is, you can only say "myself" from yourself.

the events in CCS are not encapsulated into the objects/classes ITSELF, this means
any object dont has "own member function for eventhandling"
this is why you cannot use "myself" ($this) in CCS event functions this has some benefits in software architecture especially for scriptinglanguages, but i wont go to much into detail.

however, personally i dont have a problem using the variables perfectly given by CCS just use

global $myformname
$myformname->etc.

Karsten from germany

_________________
If one gives up, he told himself he failed.
View profile  Send private message
greg
Posted: 10/11/2004, 9:56 AM

I completly agree with you, my point is not technical, it's practical:
I'd like CCS to declare $myself for me, so I can use directly without
having to wonder how the different elements are called, or having to
browse all my code each time I rename something...

Greg

Karsten wrote:
> hi greg,
>
> by software architecture logic, any object can call itself and ONLY itself
> can call itself.
> what it mean is, you can only say "myself" from yourself.
>
> the events in CCS are not encapsulated into the objects/classes ITSELF, this
> means
> any object dont has "own member function for eventhandling"
> this is why you cannot use "myself" ($this) in CCS event functions this has
> some benefits in software architecture especially for scriptinglanguages, but i
> wont go to much into detail.
>
> however, personally i dont have a problem using the variables perfectly given
> by CCS just use
>
> global $myformname
> $myformname->etc.
>
> Karsten from germany
>
> _________________
> If one gives up, he told himself he failed.
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>
Karsten


Posts: 57
Posted: 10/11/2004, 5:00 PM

hmmm greg,
this would be nothing more than global $myself=$actualform
i think its possible by "hacking" the XML codewriter

there are some threads in this forum about "extending CCS"
i'm sure it would be a not so hard problem to tell the codewriterengine
to write global $myself=$actualform
instead of just write global $actualform

but however, if you start to write an event in CCS it writes
you the name as global $actualform so why need $myself, you
see it in the eventcode what to use.

Karsten


_________________
If one gives up, he told himself he failed.
View profile  Send private message
klwillis


Posts: 428
Posted: 10/14/2004, 8:12 AM

You can use '$this' like:
$this->firstname->SetValue("Greg");

It comes in handy when initializing field expressions, but
I usually use the globally defined variables as Karsten states. ;-)


Quote greg:
I completly agree with you, my point is not technical, it's practical:
I'd like CCS to declare $myself for me, so I can use directly without
having to wonder how the different elements are called, or having to
browse all my code each time I rename something...

Greg

Karsten wrote:
> hi greg,
>
> by software architecture logic, any object can call itself and ONLY itself
> can call itself.
> what it mean is, you can only say "myself" from yourself.
>
> the events in CCS are not encapsulated into the objects/classes ITSELF, this
> means
> any object dont has "own member function for eventhandling"
> this is why you cannot use "myself" ($this) in CCS event functions this has
> some benefits in software architecture especially for scriptinglanguages, but i
> wont go to much into detail.
>
> however, personally i dont have a problem using the variables perfectly given
> by CCS just use
>
> global $myformname
> $myformname->etc.
>
> Karsten from germany
>
> _________________
> If one gives up, he told himself he failed.
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>
;-)
_________________
Kevin Willis, VP/CIO
HealthCare Information Technology Specialist
http://www.nexushealthcare.com
"Fast - Convenient - Quality-Care"

Medical Software Consulting Services
Email : klwillis@nexushealthcare.com
Skype : klwillis2006
View profile  Send private message
greg
Posted: 10/14/2004, 8:16 PM

The idea would be the have a "not changing" variable, that CSS would set
correctly even when you change the name of an object, because when your
project becomes heavy, it can be a heavy task to rename everything.

And it would be cleaner from the OOP abstration point of view.

Of course it's just a wish, I can live without it, but I'd live better
with it ;)

Greg


Karsten wrote:
> hmmm greg,
> this would be nothing more than global $myself=$actualform
> i think its possible by "hacking" the XML codewriter
>
> there are some threads in this forum about "extending CCS"
> i'm sure it would be a not so hard problem to tell the codewriterengine
> to write global $myself=$actualform
> instead of just write global $actualform
>
> but however, if you start to write an event in CCS it writes
> you the name as global $actualform so why need $myself, you
> see it in the eventcode what to use.
>
> Karsten
>
>
> _________________
> If one gives up, he told himself he failed.
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>

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.