Access CFC in Javascript

Okay, so I did the whole
<cfinvoke component="myCFC" method="init"
returnvariable="myObj">
Now is it at all possible to access this from
JavaScript?

it's no different than any other CF code.
you can do:
<script type="text/javascript">
var myVariable = "#myObj.foo()#";
</script>
(assuming the foo() method returns a string... and that the
code is within <cfoutput> blocks)
but whether it's a CFC or any other CF code, you still have
the client side (JS) / server side (CF) issues.

Similar Messages

  • Accessing Applet in javascript.

    I have an applet renedered using java plugin. thru object tag. I want to access public method of this applet thru javascript. Anybody has any idea or sample code please send it accross.
    following is the HTML code
    Regards
    <html>
    <head><title>Sostenuto</title><script language=javascript>
    function callme()
    alert(document.applets.length);
    alert(document.PumaApplet.jsp('testing'));
    </script></head>
    <body BGCOLOR="#ffffff" LINK="#000099" topmargin=0 leftmargin=0 SCROLL='auto' onload="callme()"><SCRIPT LANGUAGE="JavaScript"><!--
    var info = navigator.userAgent; var ns = false;var ie = (info.indexOf("MSIE") > 0 && info.indexOf("Win") > 0 && info.indexOf("Windows 3.1") < 0);
    //--></SCRIPT>
    <COMMENT><SCRIPT LANGUAGE="JavaScript1.1"><!--
    var ns = (navigator.appName.indexOf("Netscape") >= 0 && ((info.indexOf("Win") > 0 && info.indexOf("Win16") < 0 && java.lang.System.getProperty("os.version").indexOf("3.5") < 0) || (info.indexOf("Sun") > 0) || (_info.indexOf("Linux") > 0)));
    //--></SCRIPT></COMMENT>
    <SCRIPT LANGUAGE="JavaScript"><!--
    if (_ie == true)
    document.writeln('<OBJECT id="PumaApplet" classid="clsid:CAFEEFAC-0013-0001-0001-ABCDEFFEDCBA" WIDTH=1024 HEIGHT=768 codebase="http://java.sun.com/products/plugin/autodl/jinstall-1_3_1_01a-win.cab#Version=1,3,1,01"><NOEMBED><XMP>');
    else if (_ns == true)
    document.writeln('<EMBED type="application/x-java-applet;version=1.1.2" java_CODE="PumaApplet.class" java_CODEBASE="." ARCHIVE="/Client_Sostenuto.jar" WIDTH=1024 HEIGHT=768 pluginspage="http://java.sun.com/products/plugin/1.1.2/plugin-install.html"><NOEMBED><XMP>');
    //--></SCRIPT>
    <APPLET CODE="com.sunrisesw.puma.presentation.applet.PumaApplet.class" archive='Client_Sostenuto.jar' CODEBASE = 'http://163.122.39.142:8080/' WIDTH=1024 HEIGHT=768 ></XMP>
    <PARAM NAME=CODE VALUE="com.sunrisesw.puma.presentation.applet.PumaApplet">
    <PARAM NAME=CODEBASE VALUE="http://163.122.39.142:8080/">
    <PARAM NAME=ARCHIVE VALUE="Client_Sostenuto.jar"><PARAM NAME = SERVLETURL VALUE= /servlet/sostenuto><param name="serial_number" value=To1010mC8917201832472555At>
    <PARAM NAME="CENTRALTIME" VALUE=" 2003-04-01 19:50:13.855"><PARAM NAME="PWDREMINDER" VALUE=" ">
    </APPLET>
    </body >
    </html>

    PS: MAYSCRIPT (imho) is for the reverse - accessing javascript from java With IE6.0/NN7.02 and JRE1.4.2beta, I've found that html file no longer needs to be converted with htmlconverter. Furthermore:
    1) a simple <APPLET>...</APPLET> tag is all that is needed (i.e., no longer is there a need for <OBJECT>...</OBJECT> for IE, or <EMBED>...</EMBED> for NN).
    2) MAYSCRIPT="true" is all that's needed for Java<-->JavaScript communications via LiveConnect.
    For a demonstration, check out the link shown below:
    http://www.aokabc.com
    ;o)
    V.V.

  • Accessing jar inside  javascript

    Hi,
    Is there way to access a jar inside a javascript?

    BigDaddyLoveHandles wrote:
    anu1 wrote:
    HTML mailto has 255 character limit. I need to send more than 7000- characters in its body. Any advise how it can be done.
    Some body suggested me to use jar inside a javascript.Very good. Next time you ask a question, why not provide this sort of detail?Better still, next time you get ridiculous-sounding advice, ask the person who gave you that advice for more details. Or why you should do that. Or how you should do that. Because that particular piece of advice isn't just ridiculous-sounding, it's just plain ridiculous.
    Or it's possible you weren't really given ridiculous advice, it's possible you misunderstood. In which case asking the person who gave you the advice to clarify it would have been a good strategy too.

  • Access denied executing Javascript

    Hello all
    I need help please.
    I have programmed a portal application where I have used a Javascript Library (tinyMCE editor). Everything works fine in Internet explorer and Mozilla firefox when I execute it in the portal we use for development. When I execute this same development in the productive machine it works in firefox but in explorer i received a javascript error: Access Denied and the editor doesn´t show properly.
    Please, I need help with this. I don´t know where to look or what to do.
    Any help will be rewarded with points.
    Thanks in advance

    Hi,
    i want to replace the standdard html editor in the Web Page Composer with the tinyMCE. I followed the steps explained in this [document|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f04b5c5d-3fd2-2a10-8ab0-8fa90e3ac162]. When I launch the editor, for example by creating a new paragraph, I see the TinyMCE UI in the popup window but I can't access the functionality. A Javascript Error is also appearing : Access denied... So I tried to locate the error. I copied the source text of the popup window and created a new html file in km-content with the source code. When I am deleting the function call EPCM relaxDocumentDomain everything works fine. So I tried to implement the following code into the function relaxDocumentDomain:
    EPCM.relaxDocumentDomain = function(){
    try {
      if(noDomainRelaxation == 'true') {
          //Don't Relax the domain
    } catch(err)
      var newDomain = this.getRelaxedDomain();
        if( newDomain != document.domain ){
          document.domain = newDomain;
        this.calculateDynamicTop();
    and changed the following code in the tiny_mce.js from
    document . write('< script id=__ie_onload defer src= \ 'java script:"" \ ';> < \ / script>');
    to
    document . write('< script id=__ie_onload defer src= \ 'java script:"" \ ';>noDomainRelaxation = 'true' < \ / script>');
    But that does not work, because the the variable noDomainRelaxation is declared after the check in the relaxDocumentDomain function. Does anybody have an idea how to solve this problem? Is it perhaps possible to set the right document domain in the tinymce itself? Thanks.
    Edit: Problem solved by using the latest TinyMCE Version.

  • Access denied in javascript

    Hi all
    I have made additional software for the editor of the email bsp of the SAP CRM system.
    This new software is called in an popup from without the default SAP CRM email editor.
    Via an custom button.
    In the default SAP CRM email editor there are several javascript libraries available which are used in that BSP page.
    When i try to access them from without the new software within the popup. What should be possible.
    The parent window can always be found via the 'WINDOW.OPENER'
    It returns to me a javascript error : Access Denied.
    I have checked if everything is in the same domain, and that is the case.
    Also i made a custom bsp which opens the new software in a popup, and in that case it works.
    What could it be?
    Kind regards,
    Anton Pierhagen

    Hello,
    I have the same issue.
    I have relaxed the domain from my iframe so as I could launch some functions but when I try to click on an input field type Date, the popup cannot be displayed.
    From my parent :
    <script>
      function resizeIframe(width,height)
        document.getElementById('id_mon_iframe').width = width;
        document.getElementById('id_mon_iframe').height = height;
    </script>
    <iframe
    width="100%"
    name="frame_object"
    src="/sap/bc/bsp/sap/my_test/index.do"
    frameborder="0"
    id='id_mon_iframe'>
    </iframe>
    From my iframe :
          <script type="text/javascript" language="JavaScript">
           function relaxDomain(input)
             if (input.search(/^\\d+\\.\\d+\\.\\d+\\.\\d+$/) >=0 )
               return input;
             var lnDotPos = input.indexOf(".");
             return (lnDotPos >= 0) ? input.substr( lnDotPos + 1 ) : input;
           function oniframeload()
             var result = relaxDomain(document.domain);
             var width = 2100;
             var height = document.body.scrollHeight + 50;
             if(result != document.domain)
               document.domain = result;
             parent.resizeIframe(width,height);
           </script>
         </htmlb:form>
       </htmlb:page>
    </htmlb:content>
    JS Error message :
    Détails de l’erreur de la page Web
    Agent utilisateur : Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E)
    Horodateur : Sun, 21 Dec 2014 15:10:28 UTC
    Message : Accès refusé (Access Denied).
    Ligne : 125
    Caractère : 3
    Code : 0
    URI : http://xxxxx.xxxxx.xxx:xxxx/sap/public/bc/ur/Design2002/js/popup_ie6.js?6.0.17.0.0
    Anyone with an idea?
    Thx.

  • Access java from javascript in firefox

    Hi,
    I am trying to access java method from javascript.
    It works fine with ie, but firefox somehow brings up the error
    saying the method defined in java is not a function.
    I am calling like.
    document.applets["myapp"].soundAlarm();
    I have put MAYSCRIPT in the applet tag.
    still not works.
    Does anyone have idea ?
    Thanks

    Try with
    document.myapp.soundAlarm();I assume that the name attribute of the APPLET is myapp.
    Note the MAYSCRIPT is useless in your context. MAYSCRIPT is used when from Java you need to access the JSObject.
    See http://www.rgagnon.com/topics/java-js.html for examples.
    Bye.

  • Accessing OAMessageStyledTextBean in javascript

    There is a requirement which goes like this:
    there are three fields (they are the items of an AdvancedTable)
    Field 1 Field 2 Field 3.
    Field 3 is readonly (of type OAMessageStyledTextBean).
    Field 1 & 2 (of type OAMessageTextInputean).
    If there is a change in Field 1 then Field 2 = Field 1 + Field 3.
    I have written a javascript with setOnchange event on Field 1.
    The Problem is ,I am not able to access the Field 3 that is readonly,,
    I have tried this using document.getElementById(AdvancedTableRN:Field3:0)
    0 corresponds to the first row.
    For this readonly field alone,,, i get value as 'undefined' when tried to see the value in alert.
    But the above holds good for other two fields.
    Can anyone suggest on how to proceed? Also, it would be greatly appreciated, if anyone could name a book or doc that has javascripts related to OAF.

    Hi Elmer,
    Actually I wrote code that was firing for evry row in the VO those are being dispalyed, so you can modify it and it also validates a few condition so just refer it as Pseudo code let me know if I can help you
    public String calculate()
    XXEGASRLinesVOImpl pervo = getXXEGASRLinesVO1();
    Row row[] = pervo.getAllRowsInRange();
    String Flag = "NO ERROR";
    for (int i=0;i<row.length;i++)
    XXEGASRLinesVORowImpl rowi = (XXEGASRLinesVORowImpl)row;
    //System.out.println("xxDebug Checking to delete PersonId => "+rowi.getLineId());
    if(rowi.getShipQty()==null)
    rowi.setTotal(null);
    if(rowi.getUnitPrice()== null)
    rowi.setTotal(null);
    if(rowi.getShipQty()!= null)
    if(rowi.getShipQty().compareTo(0)<=0)//|| rowi.getShipQty().compareTo(0)== 1)
    System.out.println("Testing"+rowi.getShipQty());
    Flag = "Line: "+(i+1)+ " Qty";
    rowi.setShipQty(null);
    rowi.setTotal(null);
    if(rowi.getUnitPrice()!= null)
    if(rowi.getUnitPrice().compareTo(0)<0)
    Flag = "Line: "+(i+1)+" Unit Price";
    rowi.setUnitPrice(new Number(0));
    rowi.setTotal(new Number(0));
    if (rowi.getShipQty()!= null&& rowi.getUnitPrice() !=null)// && rowi.getSelectFLag().equals("Y"))
    if(rowi.getUnitPrice().compareTo(0)>0 && rowi.getShipQty().compareTo(0)>0 ){
    System.out.println(rowi.getShipQty().toString());
    oracle.jbo.domain.Number Total = rowi.getShipQty();
    //Total = Total * 2;//rowi.getUnitPrice();
    Total =rowi.getShipQty().multiply(rowi.getUnitPrice());
    rowi.setTotal(Total);
    Regards,
    Reetesh Sharma

  • Accessing LOV in Javascript

    Hi Everyone,
    I'm on Apex 4.1.1 and I have this requirement.
    I have a form where there are multiple select lists and radio buttons which the user uses to configure features of a particular object being created using that form.
    I also have to show a text string that changes dynamically based on the currently made selections to give the users a description of what they have selected.
    I have used javascript to do this and it works fine. However I need help in one feature.
    I have 4 select lists that list colours. Now these colours have abbreviations (for e.g. WHITE -> WHT) which I need to add in the text description. But these abbreviations are available only in a table. I have to get these to the front end for which I thought I'll use a LOV which gets it from the table.
    I want to know if there is a way to access this LOV in a page javascript. If so then how do I do it?
    Any help would be appreciated.
    Regards,
    Arijit
    Edited by: Arijit Kanrar on Feb 7, 2013 12:24 PM
    Edited by: Arijit Kanrar on Feb 7, 2013 12:25 PM

    Example for EMP/DEPT:
    Create a PLSQL region with source:
    htp.p('<script type="text/javascript">');
    htp.p('var gaDepartments = ');
    apex_util.json_from_sql(q'!
    select deptno, dname, loc
    from dept
    htp.p(';');
    htp.p('</script>');This will create an array stored in a global variable.
    I have a tabular form with sql
    select
    "EMPNO",
    "EMPNO" EMPNO_DISPLAY,
    "ENAME",
    "HIREDATE",
    "SAL",
    "DEPTNO"
    from "#OWNER#"."EMP"I changed column "DEPTNO" to be based on an LOV so that a select list is generated and the DNAME column is used as display column.
    I then bind to the onchange event
    $("td[headers='DEPTNO'] select").change(function(){
       var lFind = $(this).val();
       $(gaDepartments.row).each(function(){
          if(this.DEPTNO==lFind){
             alert(this.DNAME + ' is located in ' + this.LOC);
             return false;
    });This will iterate over the objects in the array until it has found the entry associated with the value now selected in the list and alert the dname and loc. Mind the capitalised member names as they are case sensitive.
    Let's say i did this on a page item select list and want to affect another page item. I'd create a dynamic action which fires on change of the select list item. Execute javascript as true action:
       var lFind = $(this.triggeringElement).val();
       $(gaDepartments.row).each(function(){
          if(this.DEPTNO==lFind){
             alert(this.DNAME + ' is located in ' + this.LOC);
             $(this.affectedElements).val(this.DNAME);
             return false;
       });Set the item to be affected in the affected elements region.
    This should allow you to set it up, given that you understand a bit of javascript/jquery and dynamic actions. Otherwise, set up an example on apex.oracle.com!

  • Accessing HTMLB from javascript

    Hi expert,
    Can someone explain how to access the attributes,methods avialable in javascript to access htmlb objects in a page,
    Like for e.g.,
    htmlbSL(this,2,'SUBMITVALUES:HandleSubmit')
    Is there any document available?
    Thank you
    AP

    Hi AP,
    I believe there is no documentation avaliable about this.
    Maybe because this accessing method is not right to do
    but I can explaint about the function htmlbSL
    function htmlbEL(this,2,'SUBMITVALUES:HandleSubmit');
    this                      = HTML element.
    2                         = event type index.
    SUBMITVALUES:HandleSubmit = objectID:eventName
    if you want to know list of event type index.
    here the list:
    <b>EVENT TYPE                  INDEX</b>
    'htmlb:breadCrumb:click'      1
    <b>'htmlb:button:click'          2</b>
    'htmlb:checkbox:click'        3
    'htmlb:image:click'           4
    'htmlb:link:click'            5
    'htmlb:radioButton:click'     6
    'htmlb:tabStrip:click'        7
    'htmlb:tree:click'            8
    hope this can help you.
    respeck,
    -adyt-

  • Error while accessing App_Session in javascript.

    Hi All,
    I had wrote a Jquery function, before fetching the data from applciation iam trying to check the APP_Session variable but syntax is the problem could you please help me
    how we can resolve the problem.
    <script type="text/javascript">
    $( function() {
        $("#P1_ENG_PART1").autocomplete({
            source : function( request , response) {
                            data = getJParticipant(request.term);
                            response( data );
            focus  : function(event , ui){
                        event.preventDefault();
    function getJParticipant(key)
       // Here i want to check the App_session logic code and hence i had implmented which is not working.
           Can any one help me how we can resolve the below problem.
         if (&APP_SESSION.) is not null then
          var ajaxRequest = new htmldb_Get( null , '&APP_ID.' , 'APPLICATION_PROCESS=GET_JPARTICIPANT' , 0);
       ajaxRequest.add( 'G_MX01' , key);
       ajaxResult = ajaxRequest.get();
       return ((ajaxResult.length>0)? ajaxResult.split( '~' ):null);
    end if;
    </script>Thanks,
    Anoo..

    Hi Anoo,
    you can use app_id,page id ,session in javascript function,see the code given below
    $v('pFlowId') // APP_ID
    $v('pFlowStepId') // APP_PAGE_ID
    $v('pInstance') // SESSIONEdited your code, try it.
    <script type="text/javascript">
    $( function() {
        $("#P1_ENG_PART1").autocomplete({
            source : function( request , response) {
                            data = getJParticipant(request.term);
                            response( data );
            focus  : function(event , ui){
                        event.preventDefault();
    function getJParticipant(key)
       // Here i want to check the App_session logic code and hence i had implmented which is not working.
           Can any one help me how we can resolve the below problem.
         if ($v('pInstance')) is not null then
          var ajaxRequest = new htmldb_Get( null , '&APP_ID.' , 'APPLICATION_PROCESS=GET_JPARTICIPANT' , 0);
       ajaxRequest.add( 'G_MX01' , key);
       ajaxResult = ajaxRequest.get();
       return ((ajaxResult.length>0)? ajaxResult.split( '~' ):null);
    end if;
    </script>Regards,
    Jitendra

  • Accessing CFC in a different folder - no mappings

    Hello, everyone,
    I've got a project that I'm working on that has (basically) the following folder structure:
    /       (webroot)
    -main
    ----qry
    ----disp
    -org
    ----qry
    ----disp
    I've got a form in /org/disp that has a CFSELECT that I need to bind to a CFC in /main/qry.  I've tried "cfc:main.qry.cfcName.functionName(param)", and "cfc:/.main.qry.cfcName.functionName(param)", and I keep getting the "component cannot be found" error message.  How can I get this to work?
    V/r,
    ^_^

    Okay.. no one, here, told me that application.cfc is loading a variable for the web root, so using that did find the component.
    HOWEVER, I am having another issue, now.
    When the page loads, the select (which is supposed to populate based upon the value of another select) isn't populating, and F12 shows that there is an issue with a throw being uncaught.  The throw is NOT part of the try/catch in cfajax.js, apparently.  Is there a fix for this?
    V/r,
    ^_^

  • Can I access servlet from javascript

    Hello everybody,
    I am trying to write on servlet in which first user add name and two Date
    [ fromDate and toDate] for this i used javascript Calendor control which show me
    the date calendor.
    Now i want to send request to server for checking date different when user click on
    day of that fromDate Calendor.
    How can i send request ? As using submit button it possible to send request.
    but using tht Calendor [JavaScript ] control How i submit request or is
    any javascript code i have to add ?
    waiting for reply,
    Thanks,
    Nil

    Hi razoredge,
    thank for reply,You right request go to server when i click on submit button.
    I want that action when user click in day of fromDate Calendor object [javascript].
    this show one calendor control and user select day,
    when user select day that window close and selected date display on textbox,
    I want after close that popup window,request goes to that submit request directly instead of
    user has to click on submit button,
    Can this work ?
    Thanks
    Nil

  • Access javabean from javascript

    Hi all,
    I have learned this code to generate a progress bar using javascript. However, whithin javascript, I can only simulate a constant time for the progress bar.
    In my web page, when the user click submit....a logic takes place in the back end for sometimes to finish. How do I tight that logic to my javascript to retrieve real time?
    Thank you very much for your time and assistance

    You have to call code on the server.
    See here for an example using Perl. You can use any server-side tech you want.
    http://www.ipwebdesign.net/kaelisSpace/useful_serverClientValidation.html

  • Using JavaScript to access Database

    Hi all,
    I am using JSP and Tomcat for my web application.
    Now i need to use Javascript to access the MS Access database. Can anyone please tell me the class and command for accessing database from javascript.
    Please give me an example and that will help me. I know it is not good to access database using JavaScript. But in this situation i have to use it anyhow.
    Thatnks

    Hi all,
    Thanks very much for your help. Now some of you said that it is not possible in JSP to access database using JavaScript, some of you said yes it is possible but not secure, I understand the both concepts.
    Now my problem is last year i built a web application for my company and the scenario is like this:
    The staff records their working time in that application. Now when they click a button it creates a drop down list of all clients they have and that list is in HTML as SELECT TAG. So the select tag includes 100+ client name.
    Now they can add as many client as they want for example if i have worked with 10 clients i will create 10 drop down list by pressing button called ADD CLIENT and will record their hours.
    Now from the description above you guys can understand that an OnClick Javascript event in involved to create multiple dropdown list.
    Now what i want is that i want those 100+ client list to come from database rather than typing them in the SELECT TAG. and please remember the SELECT tag is implemented in Javascript using innerHTML event.
    Now for those of you who suggested that it is not possible to use Javascript in accessing database, can you please tell me how can i implement Onclick event using JSP/Serverlet and can create dynamic drop downlist?
    Thanks for your time to read this long message.

  • Accessing JavaScripts in Share Components

    Hi.
    I am trying to access/use a javascript I created under the path in portal:provider--&gt;shared components--&gt; javascripts. I called this function "test".
    The Javascript works when I test it, but when I try to call the function "test" from an onChange() event handler portal can't find the function. When I view source the javascript function isn't loaded into the source.
    I am calling the function from the onChange event handler like so: test();
    Is there a specific way in which I have to call the shared components javascripts from an onChange event handler?
    I know I can add my javascript function to the pl/sql additional code page using htp.p('...'); but I would really like to keep it in the share components so the code is accessible to everyone.
    Any suggestions would be greatly appreciated. :)
    Thanks,
    McKell

    Thanks for the reply. I appreciate your input.
    You mentioned the shared components where available for form level and field level validation. Can I use the javascript in the shared components for a combobox?
    Thank you again,
    McKell

Maybe you are looking for