karen
Posts: 99
|
| Posted: 02/25/2005, 4:33 AM |
|
I am trying to place an include page into another CCS-generated page which doesn't contain any other forms, i.e., just static info. This seem to cause an error:
Fatal error: Call to a member function on a non-object in /usr/home/awes2001/watch/Common.php on line 361
and line 361 refers to:
$db->query($sql);
If I add a grid form on that page, then it is ok. It seems to have something to do with the db connection. It looks like the page doesn't have a valid db connection if there are no other forms on it. I suppose I could add something hidden to workaround it. But that would be my last resort.
Can someone pls help? Thanks in advance.
|
 |
 |
Damian Hupfeld
|
| Posted: 02/25/2005, 5:24 AM |
|
I have pages that use INCLUDES with absolutely NO database content on them.
*Sometimes* when CCS just doesnt work it means that there is a corruption in
the doc and you are better off just starting again.
Good luck.
|
|
|
 |
DonB
|
| Posted: 02/25/2005, 5:06 PM |
|
I'd expect you have something in the Include page named the same as
something else in the containing page.
--
DonB
http://www.gotodon.com/ccbth
|
|
|
 |
karen
Posts: 99
|
| Posted: 02/25/2005, 8:40 PM |
|
I've tried generating a new page using the application builder and then placing the include page there. It works alright until I remove the grid form that was originally there.
Apart from the include page, there's nothing else on the containing page.
Maybe I have to define the database connection somewhere. Is there anywhere on the page where I can specify that?
Thanks for any ideas.
|
 |
 |
peterr
Posts: 5971
|
| Posted: 02/25/2005, 11:06 PM |
|
Maybe you could try creating a new, empty page, without builders. You can right-click on "Pages" in the Project Explorer, then select "New Page". Once you have the new page you'd include that includable page there.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
 |
 |
karen
Posts: 99
|
| Posted: 02/26/2005, 3:35 AM |
|
Ok, I've tried a few things and I think I've narrowed down to a CCDLookUp function in the include page. If I left that out, there were no problems with the page being included anywhere.
I suppose I'm using the db connection object incorrectly. I've declared it as a global variable just like I would in a normal page. Should the CCDLookUp function be called differently? The custom code works alright if the page is a normal page rather than an include page.
Hope someone can tell me how to handle the CCDLookUp in the include page. I need that to work. Thanks.
|
 |
 |
Damian Hupfeld
|
| Posted: 02/26/2005, 10:00 PM |
|
Hi Karen,
If there is no Grid in your include page I think that you will have to have
one in the main page if you want to use the CCDLookup function.
Damian
"karen" <karen@forum.codecharge> wrote in message
news:542205f14cb3df@news.codecharge.com...
> Ok, I've tried a few things and I think I've narrowed down to a CCDLookUp
> function in the include page. If I left that out, there were no problems
> with
> the page being included anywhere.
>
> I suppose I'm using the db connection object incorrectly. I've declared
> it as
> a global variable just like I would in a normal page. Should the
> CCDLookUp
> function be called differently? The custom code works alright if the page
> is a
> normal page rather than an include page.
>
> Hope someone can tell me how to handle the CCDLookUp in the include page.
> I
> need that to work. Thanks.
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>
|
|
|
 |
karen
Posts: 99
|
| Posted: 02/26/2005, 11:02 PM |
|
Hi Damian,
There is a grid in my include page, just none on the main page. Anyway, I've decided to add an 'invisible' grid on my main page and it works fine like that.
Thanks everyone for all the advice.
|
 |
 |