Charly Crembil
|
| Posted: 08/22/2002, 6:29 PM |
|
Hi guys, I'm working with CCS 1.0.7 + Linux/Apache/PHP/mysql.
I have a super basic page. It has no grids or records, and it has no DB
access. It only has a two page-include inside it: one for a header and one
for a footer.
I want to execute a PHP's raw code in this page. This code generates a
multiline HTML output, that I want to insert in my page, just between my
header and my footer.
Help! I don't know where to go. First I try using it "echo" command. But the
information on CCS is buffered and my information appears before the header.
Then I've inserted a field. I tried to insert the returned value to this
field. But I don't know how to assign a value to this field. I've tried
defining a before show code, but, again, it doesn't work.
I've discover you can specify a source type of "Code Expression" in the data
property of a label. But I didn't find any comment about how to assign (or
how it works) in any manual.
Any comments of anyone? Please? 
Regards,
Carlos.
|
|
|
 |
Sixto Luis Santos
|
| Posted: 08/22/2002, 6:54 PM |
|
Hello Carlos,
You can deal with this several ways.
When you add a field outside a form, the field is defined as a "stand-alone"
object. So, to set its value from a custom event, say BeforeShow, you need
to set a global reference to the label, and assign its value using the
SetValue method. eg:
function Label1_BeforeShow() { //Label1_BeforeShow @4-4ABEF0EE
//Custom Code @5-2A29BDB7
// -------------------------
global $Label1;
$Label1->SetValue("This is my custom text");
// -------------------------
//End Custom Code
} //Close Label1_BeforeShow @4-FCB6E20C
An alternative would be to set the Default property of the label to whatever
expression you want. But, this is somewhat limited, as you need to either
assign a function returning the desired value (and define the function
elsewhere if it is a custom function), or assign a literal (eg: "This is the
new value").
Setting the Source Type to Code Expression (and setting the control source
to desired value) won't work because CCS generate code for this exclusivelly
when the label is being used as part of a form.
Regards,
Sixto
"Charly Crembil" <nouser@hotmail.com> wrote in message
news:ak4368$l60$1@news.codecharge.com...
> Hi guys, I'm working with CCS 1.0.7 + Linux/Apache/PHP/mysql.
>
> I have a super basic page. It has no grids or records, and it has no DB
> access. It only has a two page-include inside it: one for a header and one
> for a footer.
>
> I want to execute a PHP's raw code in this page. This code generates a
> multiline HTML output, that I want to insert in my page, just between my
> header and my footer.
>
> Help! I don't know where to go. First I try using it "echo" command. But
the
> information on CCS is buffered and my information appears before the
header.
>
> Then I've inserted a field. I tried to insert the returned value to this
> field. But I don't know how to assign a value to this field. I've tried
> defining a before show code, but, again, it doesn't work.
>
> I've discover you can specify a source type of "Code Expression" in the
data
> property of a label. But I didn't find any comment about how to assign (or
> how it works) in any manual.
>
> Any comments of anyone? Please? 
>
> Regards,
> Carlos.
>
>
>
|
|
|
 |
Charly Crembil
|
| Posted: 08/22/2002, 7:24 PM |
|
Thanks, Sixto!
I've referenced as a global and is working now!
Regards,
Carlos.
"Sixto Luis Santos" <sixto@tecnoapoyo.com> escribió en el mensaje
news:ak44l6$no8$1@news.codecharge.com...
> Hello Carlos,
>
> You can deal with this several ways.
>
> When you add a field outside a form, the field is defined as a
"stand-alone"
> object. So, to set its value from a custom event, say BeforeShow, you need
> to set a global reference to the label, and assign its value using the
> SetValue method. eg:
>
> function Label1_BeforeShow() { //Label1_BeforeShow @4-4ABEF0EE
>
> //Custom Code @5-2A29BDB7
> // -------------------------
> global $Label1;
>
> $Label1->SetValue("This is my custom text");
>
> // -------------------------
> //End Custom Code
>
> } //Close Label1_BeforeShow @4-FCB6E20C
>
>
> An alternative would be to set the Default property of the label to
whatever
> expression you want. But, this is somewhat limited, as you need to either
> assign a function returning the desired value (and define the function
> elsewhere if it is a custom function), or assign a literal (eg: "This is
the
> new value").
>
> Setting the Source Type to Code Expression (and setting the control source
> to desired value) won't work because CCS generate code for this
exclusivelly
> when the label is being used as part of a form.
>
> Regards,
>
> Sixto
>
> "Charly Crembil" <nouser@hotmail.com> wrote in message
>news:ak4368$l60$1@news.codecharge.com...
> > Hi guys, I'm working with CCS 1.0.7 + Linux/Apache/PHP/mysql.
> >
> > I have a super basic page. It has no grids or records, and it has no DB
> > access. It only has a two page-include inside it: one for a header and
one
> > for a footer.
> >
> > I want to execute a PHP's raw code in this page. This code generates a
> > multiline HTML output, that I want to insert in my page, just between my
> > header and my footer.
> >
> > Help! I don't know where to go. First I try using it "echo" command. But
> the
> > information on CCS is buffered and my information appears before the
> header.
> >
> > Then I've inserted a field. I tried to insert the returned value to this
> > field. But I don't know how to assign a value to this field. I've tried
> > defining a before show code, but, again, it doesn't work.
> >
> > I've discover you can specify a source type of "Code Expression" in the
> data
> > property of a label. But I didn't find any comment about how to assign
(or
> > how it works) in any manual.
> >
> > Any comments of anyone? Please? 
> >
> > Regards,
> > Carlos.
> >
> >
> >
>
>
|
|
|
 |
Charly Crembil
|
| Posted: 08/22/2002, 9:23 PM |
|
Hi again, Sixto...
I'm having the same trouble in another context. I have a main page, that
contains a header page. On the header page I want to display the name of the
user currently logged in. So, I've put a label, inserted the code, but in
this case, the label's name is not accesible, because it is on the header,
not in the page.
The code I've inserted here is:
global $userName;
$userName->SetValue( CCGetLoginUser() );
I think I need to change this to something like this:
global $something;
$something->userName->SetValue( CCGetLoginUser() );
But I don't know what "something" is.
Any comment?
Regards,
Carlos.
"Sixto Luis Santos" <sixto@tecnoapoyo.com> escribió en el mensaje
news:ak44l6$no8$1@news.codecharge.com...
> Hello Carlos,
>
> You can deal with this several ways.
>
> When you add a field outside a form, the field is defined as a
"stand-alone"
> object. So, to set its value from a custom event, say BeforeShow, you need
> to set a global reference to the label, and assign its value using the
> SetValue method. eg:
>
> function Label1_BeforeShow() { //Label1_BeforeShow @4-4ABEF0EE
>
> //Custom Code @5-2A29BDB7
> // -------------------------
> global $Label1;
>
> $Label1->SetValue("This is my custom text");
>
> // -------------------------
> //End Custom Code
>
> } //Close Label1_BeforeShow @4-FCB6E20C
>
>
> An alternative would be to set the Default property of the label to
whatever
> expression you want. But, this is somewhat limited, as you need to either
> assign a function returning the desired value (and define the function
> elsewhere if it is a custom function), or assign a literal (eg: "This is
the
> new value").
>
> Setting the Source Type to Code Expression (and setting the control source
> to desired value) won't work because CCS generate code for this
exclusivelly
> when the label is being used as part of a form.
>
> Regards,
>
> Sixto
>
> "Charly Crembil" <nouser@hotmail.com> wrote in message
>news:ak4368$l60$1@news.codecharge.com...
> > Hi guys, I'm working with CCS 1.0.7 + Linux/Apache/PHP/mysql.
> >
> > I have a super basic page. It has no grids or records, and it has no DB
> > access. It only has a two page-include inside it: one for a header and
one
> > for a footer.
> >
> > I want to execute a PHP's raw code in this page. This code generates a
> > multiline HTML output, that I want to insert in my page, just between my
> > header and my footer.
> >
> > Help! I don't know where to go. First I try using it "echo" command. But
> the
> > information on CCS is buffered and my information appears before the
> header.
> >
> > Then I've inserted a field. I tried to insert the returned value to this
> > field. But I don't know how to assign a value to this field. I've tried
> > defining a before show code, but, again, it doesn't work.
> >
> > I've discover you can specify a source type of "Code Expression" in the
> data
> > property of a label. But I didn't find any comment about how to assign
(or
> > how it works) in any manual.
> >
> > Any comments of anyone? Please? 
> >
> > Regards,
> > Carlos.
> >
> >
> >
>
>
|
|
|
 |
Sixto Luis Santos
|
| Posted: 08/22/2002, 11:36 PM |
|
Hello,
This is actually easier to deal with. Just set the label's default value to
CCGetLoginUser()
But, if you must change the label programatically, use something like this:
global $Header;
$Header->userName->SetValue(CCGetLoginUser() );
Regards,
Sixto
"Charly Crembil" <nouser@hotmail.com> wrote in message
news:ak4dcj$6mr$1@news.codecharge.com...
> Hi again, Sixto...
>
> I'm having the same trouble in another context. I have a main page, that
> contains a header page. On the header page I want to display the name of
the
> user currently logged in. So, I've put a label, inserted the code, but in
> this case, the label's name is not accesible, because it is on the header,
> not in the page.
>
> The code I've inserted here is:
>
> global $userName;
> $userName->SetValue( CCGetLoginUser() );
>
> I think I need to change this to something like this:
>
> global $something;
> $something->userName->SetValue( CCGetLoginUser() );
>
> But I don't know what "something" is.
>
> Any comment?
>
> Regards,
> Carlos.
>
> "Sixto Luis Santos" <sixto@tecnoapoyo.com> escribió en el mensaje
>news:ak44l6$no8$1@news.codecharge.com...
> > Hello Carlos,
> >
> > You can deal with this several ways.
> >
> > When you add a field outside a form, the field is defined as a
> "stand-alone"
> > object. So, to set its value from a custom event, say BeforeShow, you
need
> > to set a global reference to the label, and assign its value using the
> > SetValue method. eg:
> >
> > function Label1_BeforeShow() { //Label1_BeforeShow @4-4ABEF0EE
> >
> > //Custom Code @5-2A29BDB7
> > // -------------------------
> > global $Label1;
> >
> > $Label1->SetValue("This is my custom text");
> >
> > // -------------------------
> > //End Custom Code
> >
> > } //Close Label1_BeforeShow @4-FCB6E20C
> >
> >
> > An alternative would be to set the Default property of the label to
> whatever
> > expression you want. But, this is somewhat limited, as you need to
either
> > assign a function returning the desired value (and define the function
> > elsewhere if it is a custom function), or assign a literal (eg: "This is
> the
> > new value").
> >
> > Setting the Source Type to Code Expression (and setting the control
source
> > to desired value) won't work because CCS generate code for this
> exclusivelly
> > when the label is being used as part of a form.
> >
> > Regards,
> >
> > Sixto
> >
> > "Charly Crembil" <nouser@hotmail.com> wrote in message
> >news:ak4368$l60$1@news.codecharge.com...
> > > Hi guys, I'm working with CCS 1.0.7 + Linux/Apache/PHP/mysql.
> > >
> > > I have a super basic page. It has no grids or records, and it has no
DB
> > > access. It only has a two page-include inside it: one for a header and
> one
> > > for a footer.
> > >
> > > I want to execute a PHP's raw code in this page. This code generates a
> > > multiline HTML output, that I want to insert in my page, just between
my
> > > header and my footer.
> > >
> > > Help! I don't know where to go. First I try using it "echo" command.
But
> > the
> > > information on CCS is buffered and my information appears before the
> > header.
> > >
> > > Then I've inserted a field. I tried to insert the returned value to
this
> > > field. But I don't know how to assign a value to this field. I've
tried
> > > defining a before show code, but, again, it doesn't work.
> > >
> > > I've discover you can specify a source type of "Code Expression" in
the
> > data
> > > property of a label. But I didn't find any comment about how to assign
> (or
> > > how it works) in any manual.
> > >
> > > Any comments of anyone? Please? 
> > >
> > > Regards,
> > > Carlos.
> > >
> > >
> > >
> >
> >
>
>
|
|
|
 |
|