Posts tagged "content assist"

Example on content assist w.r.t Application.cfc

Here’s an example on how scoped variables declared in onApplicationStart method will be available in content assist. Note the scoped variables set in Application.cfc (Application.obj1/obj2/obj4/obj7/qVar/Counter1 in this example) and try getting content assist on them in any file in the application (as shown in test.cfm in this example). Another thing to note here is the various types of CFC variables created. Yes, we have tried to cover some such common variable assignment scenarios. Do try them out and let us know if they work as desired.
— Application.cfc —
<cfset = “TestApplication”>
<cfset This.Sessionmanagement=true>
<cfset This.Sessiontimeout=”#createtimespan(0,0,10,0)#”>
<cfset This.applicationtimeout=”#createtimespan(5,0,0,0)#”>
<cffunction name=”onApplicationStart”>
<cfset Application.obj7 = new component_testing.cfcomponent.component_01()>
<cfset cfcNames.firstName = “component_testing.cfcomponent.component_01″>
<cfset Application.obj1 = createObject(“component”, cfcNames.firstName)>
cfcNameVar = “component_testing.cfcomponent.component_02″;
Application.obj2 = createobject(“component”, #cfcNamevar#);
foo = createObject(“component”, “com.adobe.coldfusion.mail”);
Application.obj4 = foo;
<cfquery name=”testDB” dataSource=”cfdocexamples” maxrows=”2″>
SELECT Emp_ID FROM employee
<cfset Application.qVar = “testDB”>
<cfcatch type=”database”>
<cfdump var=”#cfcatch#”>
<cflog file=”#This.Name#” type=”Information” text=”Application Started”>
— test.cfm —
<cfset Application.availableResources>
<cfset Application.counter1>
<cfset Application.qVar>
<cfset Application.obj1.method_01()>
<cfset Application.obj2.method_11()>
<cfset Application.obj4.addParam()>
<cfset Application.obj7.method_02()>