CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> CodeChargeStudio.Discussion

 Dynamicly Change Page Title - Not Working??

Print topic Send  topic

Author Message
Chris Moore
Posted: 08/26/2003, 9:30 AM

I have read the comments on how to change the page title dynamicly on the
CodeCharge Community board. Why doesn't this work? I changed my page
title (via editing the HTML manually) to llok like this:

<title>{Page_Title}</title>

When I try to change the title using this code:

Phone_List.Page_Title.Value = "new title"

from the Page_Before show event, ASP returns the error:

Variable is undefined: 'Phone_List'
/dblayout/Phone_List_events.asp, line 99

Phone_List is the name of my Page.

What am I doing wrong? It shouldn't be this hard so I know I am missing
something.

Thanks.
Robert Rodgers
Posted: 08/26/2003, 9:45 AM

Chris,

Look in the help for the SetVar method. It should do what you want. Or
you can use the Action "Set Tag" in the page.beforeshow event.



rob
"Chris Moore" <chris@dblayout.com> wrote in message
news:Xns93E37566B768Fcabubba@66.180.229.147...
> I have read the comments on how to change the page title dynamicly on the
> CodeCharge Community board. Why doesn't this work? I changed my page
> title (via editing the HTML manually) to llok like this:
>
> <title>{Page_Title}</title>
>
> When I try to change the title using this code:
>
> Phone_List.Page_Title.Value = "new title"
>
> from the Page_Before show event, ASP returns the error:
>
> Variable is undefined: 'Phone_List'
> /dblayout/Phone_List_events.asp, line 99
>
> Phone_List is the name of my Page.
>
> What am I doing wrong? It shouldn't be this hard so I know I am missing
> something.
>
> Thanks.

Chris Moore
Posted: 08/26/2003, 12:25 PM

Well, the Set Action did the trick. Its frustrating when there is a
different way to alter a variable depending on where the code is & where
the variable is.

Thanks again.


"Robert Rodgers" <robert@sylvancomputing.com> wrote in
news:big2rt$79a$1@news.codecharge.com:

> Chris,
>
> Look in the help for the SetVar method. It should do what you want.
> Or you can use the Action "Set Tag" in the page.beforeshow event.
>
>
>
> rob
> "Chris Moore" <chris@dblayout.com> wrote in message
>news:Xns93E37566B768Fcabubba@66.180.229.147...
>> I have read the comments on how to change the page title dynamicly on
>> the CodeCharge Community board. Why doesn't this work? I changed my
>> page title (via editing the HTML manually) to llok like this:
>>
>> <title>{Page_Title}</title>
>>
>> When I try to change the title using this code:
>>
>> Phone_List.Page_Title.Value = "new title"
>>
>> from the Page_Before show event, ASP returns the error:
>>
>> Variable is undefined: 'Phone_List'
>> /dblayout/Phone_List_events.asp, line 99
>>
>> Phone_List is the name of my Page.
>>
>> What am I doing wrong? It shouldn't be this hard so I know I am
>> missing something.
>>
>> Thanks.
>
>
>
DonB
Posted: 08/26/2003, 5:42 PM

It does seem to be a conflict, but there are forces at work that you have
not quite mastered (I'm not sure that I have either, so this is no putdown).
Once you understand these forces, it all makes sense.

By putting {Page_Title} in the HTML you have defined a template tag. The
problem is, you have not informed CCS of its existence in the template.
There is a chunk of code that starts with the comment "Page Controls".
Below that are variables that hold the values that eventually replace the
template tags when the template is parsed (I think that's correct
terminology - at any rate, it's when the placeholder we call a tag gets
replaced with the actual value the browser sees). Every Control has a
variable declared here. You won't see one for "Page_Title".

In addition, there is no call to CCCreateControl, which instantiates a
Control object, which is where the .Value property exists. So now you can
probably see why your first attempt failed. You attempted to assign a value
to a nonexistent label control.

The "Action" works at a more atomic level, by directly affecting the
template (where the tag is) - rather than operating through the interface
exposed by a Control object. The Action results in a call to the SetVar
("set variable") method of the page's template, specifying the name of a
template tag (i.e., something enclosed in braces in the HTML file) and the
value to replace it with. Eventually, a Control object would do exactly the
same thing. By implementing Control objects, CCS provides us with a
published way to work with the template and do things at a higher level,
like showing/hiding bits and pieces of the template under program control.

As to why the instructions on the Community board did not work, well there's
a fair amount of that from what I've seen (unfortunately). Adding to the
confusion is the fact there are both CC and CCS items and the two products
do things differently.

--
DonB

http://www.gotodon.com/ccbth


"Chris Moore" <chris@dblayout.com> wrote in message
news:Xns93E3931F2468Fcabubba@66.180.229.147...
> Well, the Set Action did the trick. Its frustrating when there is a
> different way to alter a variable depending on where the code is & where
> the variable is.
>
> Thanks again.
>
>
> "Robert Rodgers" <robert@sylvancomputing.com> wrote in
>news:big2rt$79a$1@news.codecharge.com:
>
> > Chris,
> >
> > Look in the help for the SetVar method. It should do what you want.
> > Or you can use the Action "Set Tag" in the page.beforeshow event.
> >
> >
> >
> > rob
> > "Chris Moore" <chris@dblayout.com> wrote in message
> >news:Xns93E37566B768Fcabubba@66.180.229.147...
> >> I have read the comments on how to change the page title dynamicly on
> >> the CodeCharge Community board. Why doesn't this work? I changed my
> >> page title (via editing the HTML manually) to llok like this:
> >>
> >> <title>{Page_Title}</title>
> >>
> >> When I try to change the title using this code:
> >>
> >> Phone_List.Page_Title.Value = "new title"
> >>
> >> from the Page_Before show event, ASP returns the error:
> >>
> >> Variable is undefined: 'Phone_List'
> >> /dblayout/Phone_List_events.asp, line 99
> >>
> >> Phone_List is the name of my Page.
> >>
> >> What am I doing wrong? It shouldn't be this hard so I know I am
> >> missing something.
> >>
> >> Thanks.
> >
> >
> >
>

Chris Moore
Posted: 08/27/2003, 8:17 AM

Dude, awesome explanation. This sounds like a potential article for your
website. I am going to print this an re-read it about 10 times so I
understand what you have written better.

Again, thanks a bunch.

Chris

"DonB" <~ccbth~@gotodon.com> wrote in
news:biguos$oh5$1@news.codecharge.com:

> It does seem to be a conflict, but there are forces at work that you
> have not quite mastered (I'm not sure that I have either, so this is
> no putdown). Once you understand these forces, it all makes sense.
>
> By putting {Page_Title} in the HTML you have defined a template tag.
> The problem is, you have not informed CCS of its existence in the
> template. There is a chunk of code that starts with the comment "Page
> Controls". Below that are variables that hold the values that
> eventually replace the template tags when the template is parsed (I
> think that's correct terminology - at any rate, it's when the
> placeholder we call a tag gets replaced with the actual value the
> browser sees). Every Control has a variable declared here. You
> won't see one for "Page_Title".
>
> In addition, there is no call to CCCreateControl, which instantiates a
> Control object, which is where the .Value property exists. So now
> you can probably see why your first attempt failed. You attempted to
> assign a value to a nonexistent label control.
>
> The "Action" works at a more atomic level, by directly affecting the
> template (where the tag is) - rather than operating through the
> interface exposed by a Control object. The Action results in a call
> to the SetVar ("set variable") method of the page's template,
> specifying the name of a template tag (i.e., something enclosed in
> braces in the HTML file) and the value to replace it with.
> Eventually, a Control object would do exactly the same thing. By
> implementing Control objects, CCS provides us with a published way to
> work with the template and do things at a higher level, like
> showing/hiding bits and pieces of the template under program control.
>
> As to why the instructions on the Community board did not work, well
> there's a fair amount of that from what I've seen (unfortunately).
> Adding to the confusion is the fact there are both CC and CCS items
> and the two products do things differently.
>
Dave Rexel
Posted: 08/27/2003, 12:48 PM

::
a simple way of doing this is to put a control component [optional Hidden]
in your page in the scope where you want to retrieve your {Page_Title}, just
name this the same eg Page_Title and it works with any of the CCS supported
technologies.

Here's an example
http://www.rexdesign.com/ccs/kb.php?category_id=51&lang...d=1&event_id=43
: browsing the Tutorials shows you the current Tutorial name as Page Title.

Yes Software did not invent this templating technology, it's been around for
a long time in many open source projects and has been brilliantly
implemented here.

Dave

"Chris Moore" <chris@dblayout.com> wrote in message
news:Xns93E46910E813Acabubba@66.180.229.147...
> Dude, awesome explanation. This sounds like a potential article for your
> website. I am going to print this an re-read it about 10 times so I
> understand what you have written better.
>
> Again, thanks a bunch.
>
> Chris
>
> "DonB" <~ccbth~@gotodon.com> wrote in
>news:biguos$oh5$1@news.codecharge.com:
>
> > It does seem to be a conflict, but there are forces at work that you
> > have not quite mastered (I'm not sure that I have either, so this is
> > no putdown). Once you understand these forces, it all makes sense.
> >
> > By putting {Page_Title} in the HTML you have defined a template tag.
> > The problem is, you have not informed CCS of its existence in the
> > template. There is a chunk of code that starts with the comment "Page
> > Controls". Below that are variables that hold the values that
> > eventually replace the template tags when the template is parsed (I
> > think that's correct terminology - at any rate, it's when the
> > placeholder we call a tag gets replaced with the actual value the
> > browser sees). Every Control has a variable declared here. You
> > won't see one for "Page_Title".
> >
> > In addition, there is no call to CCCreateControl, which instantiates a
> > Control object, which is where the .Value property exists. So now
> > you can probably see why your first attempt failed. You attempted to
> > assign a value to a nonexistent label control.
> >
> > The "Action" works at a more atomic level, by directly affecting the
> > template (where the tag is) - rather than operating through the
> > interface exposed by a Control object. The Action results in a call
> > to the SetVar ("set variable") method of the page's template,
> > specifying the name of a template tag (i.e., something enclosed in
> > braces in the HTML file) and the value to replace it with.
> > Eventually, a Control object would do exactly the same thing. By
> > implementing Control objects, CCS provides us with a published way to
> > work with the template and do things at a higher level, like
> > showing/hiding bits and pieces of the template under program control.
> >
> > As to why the instructions on the Community board did not work, well
> > there's a fair amount of that from what I've seen (unfortunately).
> > Adding to the confusion is the fact there are both CC and CCS items
> > and the two products do things differently.
> >
>

Chris Moore
Posted: 08/27/2003, 9:20 PM

Thanks Dave, I'll check it out.

Chris


"Dave Rexel" <therex_spamenot@hotmail.com> wrote in
news:bij1v2$ebp$1@news.codecharge.com:

>::
> a simple way of doing this is to put a control component
[optional
> Hidden] in your page in the scope where you want to retrieve
your
> {Page_Title}, just name this the same eg Page_Title and it
works with
> any of the CCS supported technologies.
>
> Here's an example
> http://www.rexdesign.com/ccs/kb.php?category_id=51&language_id=
1&event_
> id=43
>: browsing the Tutorials shows you the current Tutorial name as
Page
>: Title.
>
> Yes Software did not invent this templating technology, it's
been
> around for a long time in many open source projects and has
been
> brilliantly implemented here.
>
> Dave
>
> "Chris Moore" <chris@dblayout.com> wrote in message
>news:Xns93E46910E813Acabubba@66.180.229.147...
>> Dude, awesome explanation. This sounds like a potential
article for
>> your website. I am going to print this an re-read it about 10
times
>> so I understand what you have written better.
>>
>> Again, thanks a bunch.
>>
>> Chris
>>
>> "DonB" <~ccbth~@gotodon.com> wrote in
>>news:biguos$oh5$1@news.codecharge.com:
>>
>> > It does seem to be a conflict, but there are forces at work
that
>> > you have not quite mastered (I'm not sure that I have
either, so
>> > this is no putdown). Once you understand these forces, it
all makes
>> > sense.
>> >
>> > By putting {Page_Title} in the HTML you have defined a
template
>> > tag. The problem is, you have not informed CCS of its
existence in
>> > the template. There is a chunk of code that starts with the
comment
>> > "Page Controls". Below that are variables that hold the
values that
>> > eventually replace the template tags when the template is
parsed (I
>> > think that's correct terminology - at any rate, it's when
the
>> > placeholder we call a tag gets replaced with the actual
value the
>> > browser sees). Every Control has a variable declared here.
You
>> > won't see one for "Page_Title".
>> >
>> > In addition, there is no call to CCCreateControl, which
>> > instantiates a Control object, which is where the .Value
property
>> > exists. So now you can probably see why your first attempt
>> > failed. You attempted to assign a value to a nonexistent
label
>> > control.
>> >
>> > The "Action" works at a more atomic level, by directly
affecting
>> > the template (where the tag is) - rather than operating
through the
>> > interface exposed by a Control object. The Action results
in a
>> > call to the SetVar ("set variable") method of the page's
template,
>> > specifying the name of a template tag (i.e., something
enclosed in
>> > braces in the HTML file) and the value to replace it with.
>> > Eventually, a Control object would do exactly the same
thing. By
>> > implementing Control objects, CCS provides us with a
published way
>> > to work with the template and do things at a higher level,
like
>> > showing/hiding bits and pieces of the template under program
>> > control.
>> >
>> > As to why the instructions on the Community board did not
work,
>> > well there's a fair amount of that from what I've seen
>> > (unfortunately). Adding to the confusion is the fact there
are both
>> > CC and CCS items and the two products do things differently.
>> >
>>
>
>
>

   


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

MS Access to Web

Convert MS Access to Web.
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.