ColdFusion Community

The online ColdFusion / CFML community website

I posted this question in a couple forums, but no answer in the past two days. Maybe it's just me that's to impatient. However this could be a nice test to see where (in which forum) can I start to bug people with my CF problems first. :))))

I am not a total rookie programmer and I've been programming in PHP for a couple of years, made some nice websites and I know all the basic concepts of programming (OOP, functions and so on)... but I recently started to discover CF I've been having some small problems on which I get stuck too much tome regarding how small the issues are.

I was able to make a recursive navigation menu all by myself a few days ago, but I am stuck on a stupid problem such as the following. :)

OK, I am confused... error says:

"The DATASOURCE parameter to the MakeBreadCrumb function is required but was not passed in. "

But I am passing it! Don't I? Is there another way I should be passing the needed variables (arguments)? Can anynone please help me solving this small problem?

Check out the code here (I cannot post code here on this forum as it seems):
The link to the code

Views: 36

Reply to This

Replies to This Discussion

You must have an argument for Datasource setup in the MakeBreadCrumb function that is required. You either have to pass datasource into the function. A quick example:
or make the argument not required.
Thank you very much, finally help from someone. :)

However I don't see any of the code you might have pasted in here. It would be nice if you could try to paste it again, because I am not really sure I understand what you mean by having a "datacource setup in the MakeBreadCrumb function". You see, I thought it is enough to pass it ftrough "cfargument" in the function definition and with an "cfinvokeargument" in the invoke definition, as I actually did in the code.

Also I already tried having the arguments in the function set on required="no", but even that didn't work - which for me as a programmer was quite logical, cause if there is no argument passed correctly, than the required field shouldn't make any difference if enabled or disabled in case that I am actually not passing any argument. I think it's a nice solution passing arguments like this, having the required field set as "yes"... only I have to figure out how to do it properly (if I would see your code example). If the argument would be passed correctly, then the required option could stay as it is: required="yes". Am I right?
Also now I see that in this forum we cannot paste any HTML or CF code, because it doesn't show it. Will have to suggest to the author of this comunity to add the [code][/code] tags possibility. Wouldn't that be great?
Opps I missed that it didn't add my example. Anyways the error that you are getting is typically related to required arguments that are not being passed in when the function is invoked. It is odd that you are getting the same error when setting the required="false" to the argument itself. Here when you invoke try this, I am not going to past the carrots so pretend they are there haha:

cfinvoke component="component" function="MakeBreadCrumb" datasource="value"
Hm... but I am doing exactly that, except that I think you meant "method" instead of "function". :)
I mean like this:

cfinvoke component="component" method="MakeBreadCrumb" datasource="value"

Have you checked my code here?

BTW, wouldn't it be nice that we could be able to post code in the same way as we can do it in some other forums, such as on the link I pasted above?
opps my bad yes I ment method not function. instead of doing this:

cfinvoke
component="cfdocs.Recursive Navigation.cfcomponents.navigation"
method="MakeBreadCrumb"
returnvariable="MakeBreadCrumbRet"
cfinvokeargument name="id" value="#URL.item#"/
cfinvokeargument name="cnt" value="1"/
cfinvokeargument name="dataSource" value="#databaseSource#"/
cfinvokeargument name="table" value="#sourceTable#"/
/cfinvoke

try this
cfinvoke
component="cfdocs.Recursive Navigation.cfcomponents.navigation"
method="MakeBreadCrumb"
returnvariable="MakeBreadCrumbRet"
id="#URL.item#"
cnt="1"
dataSource="#databaseSource#"
table="#sourceTable#"
/cfinvoke
Will do it now. Hey man, I apreciate your help. Hopefully will solve this stupid problem.
I am determined to figure this out haha. I am now trying to recreate issue on my local box. Maybe I can get it to break as well.
Also do you have a default value set for the argument that you are now set to not required? I know that Coldfusion doesn't like when an argument is not passed in and a default value is not set.
Nope, tried already to set up the default option in the function. It still doesn't find any argument from outside. I tried to set the default value to default="" and of course the error report says:

"Datasource '' could not be found."

So It is true that the arguments don't come from outside! If you will check my code, you will see that's really odd, cause it excepts the first two out of four arguments, but it doesn't "see" the last two:

cfargument name="dataSource" type="any" required="yes" default=""
cfargument name="dataTable" type="any" required="yes" default=""

So that's really odd.
Also, what version of Coldfusion are you running? It may help I suppose because now you can set this.datasource on the application page and you may be getting variable scope issues.

RSS


Latest Activity

Jelle Kralt updated their profile
Friday
CVgeek added a discussion to the group CF Contractors
Thumbnail

ColdFusion Developers (London)

ColdFusion Developers (London)The vacancy is with an established independent B2B industry leading online news, research and events business providing a combination of free –to-air news and subscription based market intelligence databases and services. The company also provides online best practice and professional communities and industry events, large and small.Role:They are looking for an experienced additional ColdFusion developer to join the small in-house team to support continued…See More
Sep 11
CVgeek added a discussion to the group Coldfusion Jobs
Thumbnail

ColdFusion Developers (London)

ColdFusion Developers (London)The vacancy is with an established independent B2B industry leading online news, research and events business providing a combination of free –to-air news and subscription based market intelligence databases and services. The company also provides online best practice and professional communities and industry events, large and small.Role:They are looking for an experienced additional ColdFusion developer to join the small in-house team to support continued…See More
Sep 11
kanth posted a blog post

ColdFusion Application Development by ColdFusion Programmers & Developers

ColdFusion application development is associated with the website development. With the unique features of the ColdFusion development along with the ColdFusion Makrup Language which resembles scripting components like JSP and PHP and even ASP but it bares the most resemblance to HTML syntax. The ColdFusion allows developers to develop content publishing systems, dynamic sites, ecommerce sites, self service application and much more.…See More
Jul 30
Isaac Dealey updated their profile
Jul 29
Thomas Bishop updated their profile
Jul 29
Profile IconBecky B, kanth, Jim Bossemeyer and 15 more joined ColdFusion Community
Jul 29
Dennis Matteson updated their profile
Jun 22

Members

Translate this page

© 2014   Created by Nick Tong.

Badges  |  Report an Issue  |  Terms of Service