Call a function within the same CFC component

Hello
/ * Niewbie Question * /.
I have a strange problem. When I try to call one function on the other in the same CFC component, I get an error named: "Entity has incorrect type to be called as a function."
I looked on many forums and searched in Google groups. I have yet found a work around for this problem.
I thought I did caution o not use twice the same name...
Can someone tell me what I did wrong?

My sample code to reproduce this error is included

The full error message is:
Entity is of the wrong type to be called as a function.
The symbol you provided superfunction is not the name of a function.

The error occurred in C:\ColdFusion8\wwwroot\admin\_components\test.cfc: line 6

4: < cfinvoke
5: method = "superfunction".
6: returnVariable = "myReturn" >
7: < / cfinvoke >
8: < cfset some_text = myReturn >

OK, solved with all your advice!

A big thank you to everyone

Here is the final code for others...

Tags: ColdFusion

Similar Questions

  • How to call other functions within the ScriptableFunction class

    I am trying to create an extension of javascript class which will record audio, but the problem is that I can't call other methods in the class.

    clear explanation about my problem:

    It's my Scriptable class

    public final class OCNUtilsNamespace extends Scriptable
    {
        VoiceRecord vr;
    
        public OCNUtilsNamespace()
        {
            this.vr = new VoiceRecord();
        }
        public Object getField(String name) throws Exception
        {
            else if(name.equals("VoiceRecorder")){
                return this.vr;
            }
    
            else if (name.equals("stopRecording"))
            {
                this.vr.stopRecording();
                return new String("Stopped Recording");
            }
            else if (name.equals("startRecording"))
            {
                this.vr.startRecording();
                return new String("Started Recording");
            }
            return super.getField(name);
        }
    }
    

    and here's my ScriptableFunction class:

    public class VoiceRecord extends ScriptableFunction {
    
        String status = "start";
        public Object invoke(Object obj, Object[] args) throws Exception{
            if(status.equals("start"))
                return new String("Started Recording");
            if(status.equals("stop"))
                return new String("Stopped Recording");
            return new String("nothing");
        }
    
        public void stopRecording(){
            status = "stop";
            return;
        }
        public void startRecording(){
            status = "start";
            return;
        }
    }
    

    in my javascript every time I call

    alert(OCN.OCNUtils.VoiceRecorder());
    

    I get the response as "recording started"

    but whenever I tried to call

    alert(OCN.OCNUtils.startRecording());
    

    I don't get all respose and the script will stop working at that time here.

    Why is happening like that?

    I'm doing something wrong?

    I did not understand this concept of scriptablefunction anyone please explain what is happening?

    have to apply Runnble to the future because I have to record the sound of the microphone

    I suggest that you simply pass an argument of your javascript in your extension like this:

    public final class OCNUtilsNamespace extends Scriptable
    {
        VoiceRecord vr;
    
        public OCNUtilsNamespace()
        {
            this.vr = new VoiceRecord();
        }
        public Object getField(String name) throws Exception
        {
            if(name.equals("VoiceRecorder")){
                return this.vr;
            }
            return super.getField(name);
        }
    }
    

    and on your class that extends a ScriptableFunction,.

    public Object invoke(Object obj, Object[] args) throws Exception{
    
                   String param = args[0].toString(); // Cast a parameter from your js to a string
    
            if(param.equals("start"))
                return startRecording();
            if(status.equals("stop"))
                return stopRecording();
            return new String("nothing");
        }
    
        public String stopRecording(){
            status = "stop";
            return status;
        }
        public String startRecording(){
            status = "start";
            return status;
        }
    

    Finally, call your extension via javascript like this:

    alert(OCN.OCNUtils.VoiceRecord("start")); // Call the startRecording() on your VoiceRecord class
    alert(OCN.OCNUtils.VoiceRecord("stop")); // Call the stopRecording() on your VoiceRecord class
    

    Hope this helps

  • Execution of function in the main Application component

    Hi all.

    I have my main.mxml application, with a component inside.  The component is called < ns1:record / > wearing the id "rec".

    This component has a function named doConnect(event:MouseEvent) inside.

    Now, I want to be able to add an event listener to a button on the Main.mxml that will perform the function inside the item when you click on it.

    I managed to add an event listener to the Main.mxml that triggers a function which is held in the Main.mxml when a button clicked inside the element is clicked.

    I did it using this code.

                <ns1:record id="rec" x="9" y="6" camera="{camera}" microphone="{microphone}" creationComplete="makeEvent()">
                </ns1:record>

     

                //Event listener
                public function makeEvent():void {
                    rec.backbtn.addEventListener(MouseEvent.CLICK,swapstate);
                }
                protected function swapstate(event:MouseEvent):void {
                    viewstack1.selectedChild=config;
                }

    No matter what I try you can't get do this the other way around.

    I need help what - by clicking on a button in the Main.mxml to perform a function within the Record element.

    If anyone can help that would be great!

    Thanks in advance.

    Hi djh88ukwb,

    From your post if I understand you correctly, you want to listen for an event by calling record when a main mxml button is clicked... on this basis

    hypothesis, I propose you a solution...


    http://www.Adobe.com/2006/mxml"layout ="absolute"creationComplete =" onCreationComplete () ">"

        
    private void onButtonClicked(event:MouseEvent):void
    {
    Rec.swapstate (Event);
    }
    ]]>



    public void swapstate(event:MouseEvent):void {}
    viewstack1.selectedChild = config;
    }

    Please try this and let me know...

    Thank you

    Jean Claude

  • Error 1 occurred Armijo rule stepsize reduction failed to reduce the value of function within the maxiters

    Hello

    I try to use the VI of unconstrained optimization to fit a measured spectrum. However, each call VI, I get the error:

    Error 1 occurred Armijo rule stepsize reduction failed to reduce the value of function within the maxiters

    Possible reasons:

    LabVIEW: An input parameter is not valid. For example if the input is a path, the path can contain a character not allowed by the operating system such as? or @.
    =========================
    NOR-488: Command requires controller GPIB be in Charge.

    Does anyone know what I'm doing wrong and how I can fix this problem?

    The VI for the stepsize Armijo rule reduction can be found here:

    \vi.lib\gmath\NumericalOptimization\qn_armijo rule stepsize reduction.vi

    In the current implementation, the spectrum is able to a rectangular spectrum. This may be the cause of the error?

    I have attached the screw that I use. They are written in LabVIEW 2010.

    Thanks Marc67 for your quick reply, but I found the error.

    It was pretty stupid, that I used a bad vector of departure for the unconstrained optimization VI, which was too low values.

  • Link chart action for refreshing a report of region within the same page

    Gurus of the APEX

    As long as we have the graph and report region region on the same page and based on the action of graph link must be able to refresh the report region within the same page

    for example: I expense spend by category such as a pie chart and on the link of the action of which I want to refresh a report region by the right of it (in the same page) to show the details contained in this category spend - also I do not have to réactualisiez around the same page, just to refresh the region related to the category Click on the graph

    Any help would be great on this - I use APEX 4.2

    Thank you

    Shas

    Thanks Tom / Scott - sound now worked

    Following my code for the javascript function in the page section,

    function clickPie (pID) {}

    $x('P4_ITEM_CATEGORY').value = pID;

    $('#CategoryDetailsDD').trigger ('apexrefresh');

    }

    And here is my URL of the link graphic action section

    JavaScript:clickPie("#label#")

  • You can have two stored functions with the same name?

    Hi all

    You can have two stored functions with the same name?

    My version of DB - connected to Oracle Database 11g Enterprise Edition Release 11.2.0.1.0

    Thank you.

    You can have the same name as long as they are within a package and with different parameters

    create or replace package test_pkg

    as

    function my_func (p1 in number)

    return number;

    function my_func (at number p1, p2)

    return number;

    end test_pkg;

    /

    create or replace package body test_pkg

    as

    function my_func (p1 in number)

    Return number

    as

    Start

    return 0;

    end;

    function my_func (at number p1, p2)

    Return number

    as

    Start

    return 0;

    end;

    end test_pkg;

    /

  • Calling a function within a symbol?

    Hello

    I am one of these flash devs who try to get edge animate to do what I usually do in Flash, so I could do this the wrong way, but I have a symbol with an "inner" function on my scene, and I want to call this function from the scene.

    I tried to use () .getStage () sym.getComposition ().getSymbol("symbolName").functionName; but it does not work.

    I have no problem handling the symbol itself by calling the . play() or . hide() so I know the path work... someone can show me the proper syntax to call a function within a symbol?

    THX in advance

    Hi Abnesher,

    An important principle to grasp is that symbols (and the stadium is one of them) is located in parallel, despite instances of different symbols, nested one inside the other (and all ultimately nested in the scene).

    The consequence is that from the inside of your nested symbol, you have no direct visibility of the function defined inside the step symbol!

    Inside of the symbol of the step , in the document.compositionReady event handler:

    sym.yourGlobalFunction = function (firstParameter)

    {

    your stuff

    }

    Inside another symbol, in one of its event handlers:

    sym.getComposition () .getStage () .yourGlobalFunction (5);

    Gil

  • Can I call a function using the array index?

    I defined a table that stores the name of the function, like this:

    var aresetButtonTop:Array = new Array(resetTop1,resetTop2,resetTop3,resetTop4,resetTop5);

    Then I have a button named "btnresetTop" which, once clicked will be called one of the five functions stored in the array (aresetButtonTop) above. Functions are called at runtime depending on certain conditions. I need to figure out how I can call these functions using the array index. I use the following code to call the function. The value of i has already been calculated.


    btnresetTop.addEventListener (MouseEvent.CLICK, aresetButtonTop [i]);

    After doing this, I get the following error when I click on the button:

    TypeError: Error #2007: parameter listener must be non-null.
    at flash.events::EventDispatcher/addEventListener()
    at gallerytest_fla::MainTimeline/thumbTopClick()

    Note: thumbTopClick() is a function within which all these codes are written.

    I need to know if it is posible in AS3 to call a function name using array index or not. If so, could you afford ehelp me out.

    You can certainly do.

    In your case, it looks like i is out of range. Show your loop.

  • Different users calling different numbers for the same account

    Hello

    As a society, we have a single account which allows us to make phone calls. We know that more than one user, we can access the same account at the same time, however, could both users make calls at the same time? I mean the different calls.

    Example:

    The user has call + 39 02xxxxxxx

    User B calls + 44 95xxxxxx

    (both at the same time)

    Thanks in advance!

    Simone

    Hi, Simone1984, and welcome to the community,

    I recommend a careful review of the conditions of use of Skype and the policies of fair use for subscriptions, according to these apply to your business:

    If I were an anti-fraud filter and I detected mulitple calls taking place at the same time, I would immediately take action, thinking that the account has been abused...

    Kind regards

    Elaine

    __________________________________________________________________________________________________
    Your question has been answered? Please click on the link to accept as a Solutionfor everyone can quickly find what works! As a post or want to say, 'Thank You ' -? Click on the button of congratulations!
    Reliable information: Brian Krebs: 3 basic rules for online safety

  • A fatal bus error was detected on the function of the peripheral bus component 0 7 0

    Hi all

    I'm trying to diagnose a hardware problem with my Dell PowerEdge R410. The problem occurred after a kernel patch and reboot linux security (I'm under Ubuntu 14.04 and I'm on Linux 3.13.0 - 100-generic). Initially, the machine would crash when starting in the BONE, but I managed to do always start too.

    I see the following errors:

    --------------------------------------------------

    Severity: critical
    Date and time: Saturday 22 Oct 05:50:30 2016
    Description: A fatal bus error was detected on the function of the peripheral bus component 0 7 0.

    Severity: critical
    Date and time: Saturday 22 Oct 05:50:30 2016
    Description: A fatal bus error was detected on an element at location 1.

    ----------------------------------------------------

    I'm having a hard time figuring what component, it exactly. Here is the result of lspci:

    ------------------------------------------------------------------------------------------------

    00:00.0 Host bridge: Intel Corporation 5500 IO Hub port ESI (rev 13)
    00:01.0 PCI bridge: Intel Corporation 5520/5500 / X 58 i/o Hub PCI Express Root Port 1 (rev 13)
    00:03.0 PCI bridge: Intel Corporation 5520/5500 / X 58 i/o Hub PCI Express Root Port 3 (rev 13)
    00:07.0 PCI bridge: Intel Corporation 5520/5500 / X 58 i/o Hub PCI Express Root Port 7 (rev 13)
    00:14.0 PIC: Intel Corporation 7500/5520/5500 / X 58 i/o Hub System Management records (rev 13)
    00:14.1 PIC: Intel Corporation 7500/5520/5500 / X 58 i/o Hub GPIO and Notepad records (rev 13)
    00:14.2 PIC: Intel Corporation 7500/5520/5500 / X 58 control status of e / Hub and RAS records (rev 13)
    00:1 a. 0 USB controller: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #4
    00:1 a. 1 USB controller: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #5
    00:1 a. 7 USB controller: Intel Corporation 82801JI (ICH10 family) USB2 EHCI Controller #2
    00:1d.0 USB controller: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #1
    00:1d.1 USB controller: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #2
    00:1d.2 USB controller: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #3
    00:1d.3 USB controller: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #6
    00:1d.7 USB controller: Intel Corporation 82801JI (ICH10 family) USB2 EHCI Controller #1
    00:1E.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev 90)
    00:1F.0 ISA bridge: Intel Corporation 82801JIR (ICH10R) LPC Interface Controller
    00:1F.2 IDE interface: Intel Corporation 82801JI port (ICH10 Family) SATA IDE Controller #1 4
    00:1F.5 IDE interface: Intel Corporation 82801JI port (ICH10 family) SATA IDE Controller #2 2
    01: 00.0 Ethernet controller: Broadcom Corporation NetXtreme II BCM5716 Gigabit Ethernet (rev 20)
    01:00.1 Ethernet controller: Broadcom Corporation NetXtreme II BCM5716 Gigabit Ethernet (rev 20)
    Serial Attached SCSI 03:00.0 controller: LSI Logic / Symbios Logic SAS2008 PCI - Express Fusion - MPT SAS-2 [Falcon] (rev 03)
    04:03.0 VGA compatible controller: Matrox Electronics Systems Ltd. MGA G200eW WPCM450 (rev 0a)
    Fe: 00.0 Host bridge: Intel Corporation Xeon 5600 Series QuickPath Architecture generic Non-core records (rev 02)
    Fe: 00.1 Host bridge: Intel Corporation Xeon 5600 Series QuickPath Architecture system address Decoder (rev 02)
    Fe: 02,0 Host bridge: Intel Corporation Xeon 5600 Series QPI Link 0 (rev 02)
    Fe: 02.1 Host bridge: Intel Corporation Xeon 5600 Series physical QPI 0 (rev 02)
    Fe: 02.2 Host bridge: Intel Corporation Xeon 5600 Series Mirror Port link 0 (rev 02)
    Fe: 02.3 Host bridge: Intel Corporation Xeon 5600 Series mirror Port link 1 (rev 02)
    Fe: 02.4 Host bridge: Intel Corporation Xeon 5600 Series QPI Link 1 (rev 02)
    Fe: 02.5 Host bridge: Intel Corporation Xeon 5600 Series physical QPI 1 (rev 02)
    Fe: 03.0 Host bridge: Intel Corporation Xeon 5600 Series Integrated Memory Controller Registers (rev 02)
    Fe: 03.1 Host bridge: Intel Corporation Xeon 5600 Series Memory Controller target address decoder built-in (rev 02)
    Fe: 03.2 Host bridge: Intel Corporation Xeon 5600 Series Integrated Memory Controller RAS Registers (rev 02)
    Fe: 03.4 Host bridge: Intel Corporation Xeon 5600 Series integrated Memory Controller Test Registers (rev 02)
    Fe: 04.0 Host bridge: Intel Corporation Xeon 5600 Series memory controller channel 0 control integrated (rev 02)
    Fe: 04.1 Host bridge: Intel Corporation Xeon 5600 Series integrated controller channel 0 address memory (rev 02)
    Fe: 04.2 Host bridge: Intel Corporation Xeon 5600 Series integrated memory controller 0 (rev 02) grade channel
    Fe: 04.3 Host bridge: Intel Corporation Xeon 5600 Series integrated memory controller channel 0 control thermal (rev 02)
    Fe: 05.0 Host bridge: Intel Corporation Xeon 5600 Series integrated controller channel 1 controls memory (rev 02)
    Fe: 05.1 Host bridge: Intel Corporation Xeon 5600 Series integrated controller channel 1 (rev 02) memory address
    Fe: 05.2 Host bridge: Intel Corporation Xeon 5600 Series integrated memory controller channel 1 row (rev 02)
    Fe: 05.3 Host bridge: Intel Corporation Xeon 5600 Series integrated memory controller channel 1 control thermal (rev 02)
    Fe: 06.0 Host bridge: Intel Corporation Xeon 5600 Series integrated controller channel 2 controls memory (rev 02)
    Fe: 06.1 Host bridge: Intel Corporation Xeon 5600 Series integrated controller channel 2 (rev 02) memory address
    Fe: 06.2 Host bridge: Intel Corporation Xeon 5600 Series integrated memory controller channel 2 rank (rev 02)
    Fe: 06.3 Host bridge: Intel Corporation Xeon 5600 Series integrated memory controller channel 2 controls thermal (rev 02)

    ------------------------------------------------------------------------------------------------

    So, one of the components seems to be "00:07.0 PCI bridge: Intel Corporation 5520/5500 / X 58 hub of e/s PCI Express Root Port 7 (rev 13)", but I'm not clear as to what this component is
    and what it connects too. Crack, "a fatal bus was detected on an element at location 1." seems too vague. What is slot 1 in this case?

    My questions are:

    What components apply to critical errors?

    I have to do things in the following order:

    -Unplug the power cord and hold it for 20 seconds
    -Firmware updates
    -Try reinstalling components
    -Replace parts

    PS. I'm no longer under warranty

    Thank you

    Dave

    Hello

    Location 1 must reference slot PCie 1. It is very likely the slot in which the PERC controller is. Your order of troubleshooting is correct. If it's the only occurrence, resettlement and the firmware update are probably enough.

  • Practically in segregation a virtual machine within the same network

    We have a VMware ESXi 5.0.0 (504890) host that has physically 4 network cards. We run 3 VMs on that host and turning a new config. However, this new virtual machine will replace our old Windows DC, DNS, server DHCP etc., and we'd like to config it before going live - will not perform us a migration of swing. We are a little worried that it can interfere with our direct network and that's why I would like to somehow almost segegrate it.

    For the moment, we have a single vSwitch0 linked to all our VMs and management card:

    vSwtich0.png

    What is the best way to do this so that our new DC (with the same domain name and within the same network) can be configured without it interfering with the current network.

    Thanks for your comments.

    Oliver

    Hello

    You can create a second vSwitch without physical network interface cards. Create a VM Portgroup on this vSwitch.

    You can configure your new virtual machine to use the Portgroup. So, he won't have any connection to your network.

    The good thing is, when you want to test things with a customer, you can create a second VM and configure it to the same VM portgroup on the second vSwitch.

    Two virtual machines on this Portgroup can communicate with them because the traffic is handled internally by the host.

    Tim

  • Replying to a virtual machine within the same site

    I try to install vSphere replication v5.1.  I do this without SRM, but just the OVF appliance (s).  We currently have 8 guests distributed between two groups.  We have a vCenter control all this, and all is listed in a Data Center.  The second group is in our DR site and has different storage mapped to it.  I try to use vSphere replication as a means to keep our important VM replicated to our centre of DR disaster.  Is it possible to do so in the only current configuration?

    I'm having a hard time comes to work.  I have deployed two replication OVF devices and I'm stuck trying to replicate a virtual machine actually.  It gives me an error that the data object is not found.  I thought that I needed to 'Connect' from the local site to the remote site, but since this is all a time installing vCenter, I get an error indicating it cannot connect to itself.

    Is what I'm trying to do possible?  If not, could you let me know what I need to change to make it work properly.  Thank you.

    Hello

    The scenario you describe is supported - you can replicate virtual machines from one host to another within the same VC.

    To do this:

    -you will need to deploy vSphere 5.1 replication for a VC and no specific host

    -VR requires VC 5.1. If you liked VC - standalone VR will not work. If you have more recent VC, for example 5.5, you need RV 5.5

    -For replication within the VC even you don't need to link to the target site.

    -Simply select the computer virtual you want to replicate, when you opened a session in vSphere Web Client connected to the VC, point to the same location - must be available in the list, and select the appropriate data store and move through the wizard.

    Kind regards

    -Martin

  • Calling a function in the HTML window that course is located inside - 8 Captivate

    Hello

    I scoured the forums to answer this but still have developed in white.

    Our LMS is launching a course in a pop-up window and inside that the Captivate output file .htm lies.

    Currently this pop-up window has a button that performs a function.  The problem is this button is rather unsightly sitting above the price in the HTML window and I wish I could call this function inside the Captivate course itself.

    The function is called closeSCOContent() and it closes the window of course but basically sends the user to a page of comments.

    So, basically is it possible to call this function using the Javascript function in Captivate 8?

    I hope that I have explained that sufficient

    Thank you very much!

    You should be able to call the function, but you would need to know where he is regarding parents/children/opener. Looks like there's frameset inside the popup.

  • Peut funtion Vmotion and Storage Vmotion with Intel and AMD hosts within the same cluster

    Hi, I can do storage Vmotion OR Vmotion between Intel and AMD hosts within the same group?

    Thank you

    No, it is not possible to vmotion or storage vmotion between CPUs from different manufacturers - I heard rumors that two manufacturers are working on technology that will help in the future-

    If you find this or any other answer useful please consider awarding points marking the answer correct or useful

  • Calling a function in the main sequence of a loaded swf file

    I know this is probably a very basic question, but I loaded a SWF file in another film. Now, I want to call a function in the main SWF file. Is it possible to do? Otherwise, I have a custom class where I could put the function, but I was not able to understand how to call it from the SWF loaded either. Can I somehow associate the class with the main movie, or...?

    Nevermind - I did something very stupid and was not calling the function as a method of a clip. I was just calling checkTarget (event) and not event.currentTarget.checkTarget (event); that seems to work.

Maybe you are looking for

  • How can I restore my favorites who disappeared when I uninstalled google?

    I took the time to learn the ASVG Nation removed toolbar. Directly after that, I got notification was the combination of Google/Firefox that I had used for incompatible yonks Google so removed and have now no old favorites. I was hoping that Firefox

  • Satellite P100 - 277 Linux LiveCD Boot from SD card?

    Hey there, my first ever post on these forums, and I had a question. It is possible to unwrap a Linux live CD (like Ubuntu or Mandriva) on a 1 GB SD card (inserted in the multimedia card reader integrated course ;)) and from it? I tried the boot opti

  • Executables LabVIEW 2016

    Hello I installed LabVIEW 2016 from 2015.  However, when I deploy my project it does not work. After some debugging, I found that it is because of the Application.Kind.  Instead of Application.Kind "Run-time" to return it now says "kind of applicatio

  • Security Update for SQL SP4 KB970892

    Windows Update continually try to download and install the above without success. I ran MS Fix It which says everything is fixed, but the problem persists. When I try to install the update (showing as 0Ko & 0Minutes) update intall just locking the sc

  • 80 GB SSD drive Alienware-only 11 display in concert.

    When I specced my laptop, I chose this for the HD option. 750 GB at 7200 RPM / MIN SATA 6 Gb/s + 80 GB SSD Caching mSATA Yet when I go to system information window it tells me that my SSD drive is Size 10.50 GB (11,271,139,328 bytes) I have an infest