Last active
August 29, 2015 13:56
-
-
Save iknowkungfoo/9082836 to your computer and use it in GitHub Desktop.
A parent CFC uses implicit getters and setters with the property "data". A child CFC extends the parent with a defined setter for "data", which calls super.setData(). setData() is not found.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--- Child CFC, extends Parent ---> | |
<cfcomponent displayName="ChildTag" output="false" accessors="true" extends="ParentTag"> | |
<cfproperty name="wibble" type="string" required="true" /> | |
<cffunction name="setData" output="false" returntype="void"> | |
<cfargument name="data" type="string" required="true" /> | |
<cfset super.setData(arguments.data & " via Child.") /> | |
</cffunction> | |
</cfcomponent> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--- Parent CFC ---> | |
<cfcomponent displayname="ParentTag" output="false" accessors="true"> | |
<cfproperty name="data" type="string" required="true" /> | |
<cfproperty name="foo" type="string" required="true" /> | |
</cfcomponent> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The setData method was not found. | |
Either there are no methods with the specified method name and argument types or the setData method is overloaded with argument types that ColdFusion cannot decipher reliably. ColdFusion found 0 methods that match the provided arguments. If this is a Java object and you verified that the method exists, use the javacast function to reduce ambiguity. | |
The error occurred in /ChildTag.cfc: line 8 | |
<cffunction name="setData" output="false" returntype="void"> | |
<cfargument name="data" type="string" required="true" /> | |
<cfset super.setData(arguments.data & " via Child.") /> | |
</cffunction> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h2>Child Tag CFC</h2> | |
<cfset x = new ChildTag() /> | |
<cfset x.setData("My Data.") /> | |
<cfset x.setFoo("My Foo.") /> | |
<cfset x.setWibble("My Wibble") /> | |
<cfoutput> | |
Data: #x.getData()# | |
<br/> | |
Foo: #x.getFoo()# | |
<br /> | |
Wibble: #x.getWibble()# | |
</cfoutput> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h2>Parent Tag CFC</h2> | |
<cfset x = new ParentTag() /> | |
<cfset x.setData("My data.") /> | |
<cfset x.setFoo("My Foo.") /> | |
<cfoutput> | |
#x.getData()# | |
<br/> | |
#x.getFoo()# | |
</cfoutput> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment