How to call Flex app from Javascript in portal question

I've setup my flex 4 app with a callback function. The flex app is embedded in a Java portlet on a WebLogic Portal 10.3.2. How can I call the Flex app from the portlets javascript function? Code below shows how the flex app is embedded in the wrapper jsp.
<script language="JavaScript" type="text/javascript">
        AC_FL_RunContent(
                    "src", "<%= srcPath %>",
                    "id", "<%= (String)request.getAttribute("portlet_name") %>",
                    "name", "<%= (String)request.getAttribute("portlet_name") %>", 
                    "width", "<%= request.getAttribute("width") %>",
                    "height", "<%= request.getAttribute("height") %>",
                    "align", "middle",
                    "quality", "high",
                    "FlashVars", "PORTLET_WS=<%= request.getAttribute("window_state")%><%= wsrpEncodedChannel %>",
                    "allowScriptAccess","sameDomain",
                    "type", "application/x-shockwave-flash",
                    "pluginspage", "http://www.adobe.com/go/getflashplayer");         
</script>

Thanks for the response. I followed the instructions in the link, but it does not appear to work within a Weblogic 10.3.2 portal. My Flex app is wrapped in a Java JSR 286 portlet. Should this approach work or is there a different approach for the portlets wrapper JavaScript to call a Flex callback function?
thanks
Dan

Similar Messages

  • How to call SOAP API from JavaScript

    Hi,
    I'm trying to call the SOAP API to get statistics about emails. Are there any examples on how to call the API from JavaScript?
    Here is a link to my original question about using the REST API. REST API URL for email statistics
    Thanks,
    Tim

    Tim,
    In order to consume a SOAP API I recommend you use something other than JavaScript.
    Any platform can offer you a good SOAP client should be OK. (.Net, Java, php, Ruby, python).
    I didn't see anyone successfully used javascript and consume the Eloqua SOAP API.
    I know you can create a SOAP client in Java script but it will be too much work to handle the Eloqua response in some cases.
    Regards,
    Daniel

  • How to call java classes from javascript?

    i have a button which calls javascript i need to access a class to update the values in the database.. how do you call the java code from within the javascript?
    the class is stored under tomcats classes directory and is accessed:
    com.Database.Employee
    the method is called : UpdateEmployeeDetails
    the button
    <input type="button" value="Save" onclick="submitForm('save')" />the javascript
    <script language="javascript">
            function submitForm(process){    
                document.myForm.action="update.jsp";
                document.myForm.submit();
    </script>

    is it not possible?
    do i have to refresh the page and read in the values like...
    <%
    String ename = request.getParameter( "EmployeeName");
         session.setAttribute( "ename", ename);
    %>and then call the class from here?
    looking around ive come across ajax but i dont know how to use it and what you need to install and if its compatable with tomcat and jsp?
    is ajax better or not really worth it?
    i have anything up to 100 fields that need saving at one save click

  • How to call java program from javascript

    Hi,
    I have an java program which will transform one xml to another xml using XSLT.
    I want to call this java program from Javascript? Is this possible? Please suggest me.
    Thanks,
    Gopal

    is it not possible?
    do i have to refresh the page and read in the values like...
    <%
    String ename = request.getParameter( "EmployeeName");
         session.setAttribute( "ename", ename);
    %>and then call the class from here?
    looking around ive come across ajax but i dont know how to use it and what you need to install and if its compatable with tomcat and jsp?
    is ajax better or not really worth it?
    i have anything up to 100 fields that need saving at one save click

  • Getting Error while calling Flex function from JavaScript

    Hi,
    I have an aspx page, which shows charts as per dropdown selection,
    I am using flex charts for flex.In aspx page, i am calling an mxml function using javascript.below is the code for javascript in aspx.
    Javascript  code in aspx page:
    <script type="text/javascript">     
    function callApp(formid) {
        try {
                var objectChart = document.getElementById("statisticsChart");
                alert(objectChart.id);               
                objectChart.myFlexFunction(formid,get('<%=HiddenDashboardWS.ClientID %>').value);
        catch (e) {
            alert(e.message);
    function getDropDownListvalue() {
        var IndexValue = $get('<%=FormDropDownList.ClientID %>').selectedIndex;
        var SelectedVal = $get('<%=FormDropDownList.ClientID %>').options[IndexValue].value;
        //  alert(SelectedVal);
        callApp(SelectedVal);
    </script>
    Html code where dropdown control is placed
    <asp:DropDownList CssClass="combo" ID="FormDropDownList" runat="server" AutoPostBack="false"></asp:DropDownList>
    <object id="statisticsChart" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
    codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0"
    height="220" width="680">
        <param name="src" value="../swf/DashboardStatisticChart.swf" />
        <param name="flashVars" value="" />
        <embed name="statisticsChart" src="../swf/DashboardStatisticChart.swf" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" height="220" width="680" flashvars=""></embed>
    </object>
    Mxml code:
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"  backgroundColor="white" creationComplete="initApp();" >
    <mx:script>
      public function initApp():void {
    ExternalInterface.addCallback("myFlexFunction",myFunc);
      public function myFunc(s:String,wsurl:String):void {
         Formid.text = s;
         webService.wsdl = wsurl;
         Alert.show("webservice");
    //Getdata calls webservice and gets xml data    
    GetData();
    //showchart() will draw chart
                     ShowChart();
    </mx:script>
    </mx:Application>
    Above code works perfect in ie, but in firefox, it gives An error saying “chartObject.MyFlexFunction is not a function”.
    I am getting the object in javascript in all the browsers, but not the functions!
    Does anyone has worked with this?
    Any help will be highly appreciated.
    Regards,
    Nirav Patel

    Found the solution from here... http://74.125.153.132/search?q=cache:4BC9BY04B5EJ:livedocs.adobe.com/flash/8/main/00002201 .html+externalinterface.addcallback+not+working&cd=1&hl=en&ct=clnk&gl=in
    Hope it will help others...
    Regards,

  • How to call stored procedure from javascript? (about Google Suggest, AJAX)

    Hi I want to implement a text field so that it behaves like [Google Suggest|http://www.google.com/webhp?complete=1&hl=en] .
    I read this post .
    Now I've setup everything according to that document. But it just doesn't work. And I don't know why.
    I think problems may fall into the following three categories:
    1. Does the text field and the page invoke the proper javascript?
    2. Does the javascript successfully call the stored procedure?
    3. Can the stored procedure correctly return the formatted result?
    I am affirmative for 1 and 3, but I'm not sure about 2. Because I don't know how to tell if a stored procedure has been called? Is there a PL/SQL statement that I can query in SQL*Plus?
    Also, I would to know how to debug AJAX in APEX. It involves many things.
    Last, I used APEX 3.2 and Oracle XE. I cannot find either dads.conf or marvel.conf file. Is "/apex/" the virtual directory for APEX?
    Thanks a lot!

    Hello,
    I recently also ran into problems with this and I will post my solution here:
    1) if you need to pass parameters to your procedure, create it using "Flexible Parameter Passing". Then parse the parameters out of the array and put them in local variables inside your PL/SQL procedure.
    Example:
    CREATE OR REPLACE PROCEDURE MATTHIASH.incsearch(name_array IN owa.vc_arr,
         value_array IN owa.vc_arr) as
      l_List1 varchar2(4000);
      l_List2 varchar2(4000);
      l_query varchar2(255);
      l_separator varchar2(10) default '';
      qu varchar2(4000) default '';
      hl varchar2(4000) default '';
    BEGIN
      FOR i IN 1 .. name_array.COUNT 
      LOOP
           IF name_array(i) = 'qu' THEN
                qu := value_array(i);
           ELSIF name_array(i) = 'hl' THEN
                hl := value_array(i);
           END IF;
      END LOOP;
      l_query := qu||'%';
      FOR x IN (
      select object_name, object_id from user_objects
      where upper(object_name) like upper(l_query) and upper(object_type) = upper(hl) order by 1 asc)
      LOOP
        l_list1 := l_List1 || l_separator || '"' || x.object_name || '"';
        l_list2 := l_List2 || l_separator || '"' || x.object_id || '"';
        l_separator := ',';
      END LOOP;
      owa_util.mime_header('text/html', false);
      owa_util.http_header_close;
      --htp.p('sendRPCDone(frameElement, "'|| qu ||'", new Array(' || l_List1 || '), new Array(' || l_List2 || '), new Array(""));');
      htp.p('sendRPCDone(frameElement, "' || qu || '", new Array(' || l_List1 || '), new Array(' || l_List2 || '), new Array(""));');
    END;
    /2) grant EXECUTE rights to APEX_PUBLIC_USER (the user APEX uses to connect to the database) on the procedure
    grant execute on incsearch to apex_public_user;3) upload the ac.js file as static file to your application
    4) put the following javascript code in the HTML Header of your APEX page:
    <script src="#WORKSPACE_IMAGES#ac.js" type="text/javascript"></script>
    <script language="JavaScript" type="text/javascript">
    function iac()
    InstallAC(document.wwv_flow,document.getElementById('P1_X'),"","!MATTHIASH.incsearch","&P1_OBJECT_TYPE.");
    </script>In my example, P1_X is a text field and P1_OBJECT_TYPE is a dropdown list with all user object types.
    Good luck,
    Matthias Hoys

  • How to call Abap Program from Javascript or html ?

    Hi All,
        I have developed a program using html, abap and javascript. I want to call an abap program while clicking on the button.
    How can I do it ?

    Hi Rajesh,
    What kind of program it is? is it a report or a transaction?
    If it's transaction, you can call the transaction as below from a link or button.
    http://<host>:<port>/sap/bc/gui/sap/its/webgui?~transaction=<transaction>
    Please replace the parameters in <..> with appropriate values before testing.
    Regards,
    Ravi

  • How to call autoSubmit programatically from javascript

    Is there a way to call autoSubmit programatically, i.e. not after every value change?
    The use case is, that I have three input boxes and only after all of them are filled out the autoSubmit should occur (and then always, if any of them is changed). This will prevent two unneccessary roundtrips to the server after filling first and second input box.
    I can think of two ways of doing this:
    1. set component's autoSubmit='false' and call autoSubmit from onChange listener, when contitions are met
    2. set component's autoSubmit='true' and prevent autoSubmit from onChange listener, when conditions are not met
    Thanks in advance,
    Viliam

    Tim,
    In order to consume a SOAP API I recommend you use something other than JavaScript.
    Any platform can offer you a good SOAP client should be OK. (.Net, Java, php, Ruby, python).
    I didn't see anyone successfully used javascript and consume the Eloqua SOAP API.
    I know you can create a SOAP client in Java script but it will be too much work to handle the Eloqua response in some cases.
    Regards,
    Daniel

  • Calling a procedure from Javascript

    Hello
    I have created a procedure with two input paprameters.
    I have gratted access to public ... and all works well
    I would now like to call this from a Javascript where I supply the input paameters. The procedure has a redirect to another URL so there is no output
    Currently I used "window.location" with the prodcedure URL ... I must beable to call the produced directly?
    Thanks for taking the time to look at this request
    Regards
    Pete

    Pete,
    Have a look at this thread:
    How to call stored procedure from javascript? (about Google Suggest, AJAX)
    Regards,
    Dan
    http://danielmcghan.us
    http://sourceforge.net/projects/tapigen
    http://sourceforge.net/projects/plrecur
    You can reward this reply by marking it as either Helpful or Correct ;-)

  • How to call oracle function from ejb3

    i'm trying to call an oracle query-function from ejb3.
    The oracle function:
    create or replace FUNCTION getSecThreadCount(secId in NUMBER,avai in NUMBER)
    RETURN SYS_REFCURSOR is cur SYS_REFCURSOR;
    m_sql VARCHAR2(250);
    BEGIN
    m_sql:='select count(thrId) from thread where secId='|| secid||'
    and thrAvai='|| avai;
    open cur for m_sql;
    return cur;
    END;
    I'v tried several ways to call it,but all failed:
    1. the calling code:
    public Object getSectionThreadCount(int secId,int avai){
              Query query=manager.createNativeQuery("{call getSecThreadCount(?,?) }");     
              query.setParameter(1, secId);
              query.setParameter(2, avai);
              return query.getSingleResult();
    but i got the exception:
    Exception in thread "main" javax.ejb.EJBException: javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not execute query; nested exception is: javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not execute query
    javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not execute query
    Caused by: java.sql.SQLException: ORA-06550: row 1, col 7:
    PLS-00221: 'GETSECTHREADCOUNT' not procedure or not defined
    ORA-06550: row 1, col 7:
    PL/SQL: Statement ignored
    2. the calling code:
    @SqlResultSetMapping(name = "getSecThreadCount_Mapping")
    @NamedNativeQuery(name = "getSecThreadCount",
    query = "{?=call getSecThreadCount(:secId,:avai)}",
    resultSetMapping = "getSecThreadCount_Mapping",
    hints = {@QueryHint(name = "org.hibernate.callable", value = "true"),
              @QueryHint(name = "org.hibernate.readOnly", value = "true")})
    public Object getSectionThreadCount(int secId,int avai){
              Query query=manager.createNamedQuery("getSecThreadCount");     
              query.setParameter("secId", secId);
              query.setParameter("avai", avai);
              return query.getSingleResult();
    but i run into the exception:
    Exception in thread "main" javax.ejb.EJBException: javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not execute query; nested exception is: javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not execute query
    javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not execute query
    Caused by: java.sql.SQLException: lost in index IN or OUT parameter:: 3
    By the way, i have successfully called the function from hibernate. And i use oracle 11g, JBoss5 RC1.
    Could anyone tell me how to call the function from EJB3?
    Thanks.

    Here's a working model:
    package.procedure: (created in example schema scott)
    CREATE OR REPLACE package  body data_pkg as
      type c_refcursor is ref cursor;
      -- function that return all emps of a certain dept
      function getEmployees ( p_deptId in number
      return c_refcursor
      is
        l_refcursor c_refcursor;
      begin
         open l_refcursor
        for
              select e.empno as emp_id
              ,        e.ename as emp_name
              ,        e.job   as emp_job
              ,        e.hiredate as emp_hiredate
              from   emp e
              where  e.DEPTNO = p_deptId;
        return l_refcursor;
      end getEmployees;
    end data_pkg;
    /entity class:
    package net.app.entity;
    import java.io.Serializable;
    import java.util.Date;
    import javax.persistence.Column;
    import javax.persistence.Entity;
    import javax.persistence.GeneratedValue;
    import javax.persistence.GenerationType;
    import javax.persistence.Id;
    import javax.persistence.NamedNativeQuery;
    import javax.persistence.QueryHint;
    import javax.persistence.SequenceGenerator;
    import javax.persistence.Table;
    @SuppressWarnings("serial")
    @Entity
    @Table (name="emp")
    @SequenceGenerator(name = "EmployeeSequence", sequenceName = "emp_seq")
    @NamedNativeQuery( name = "getEmpsByDeptId"
                   , query = "{ ? = call data_pkg.getEmployees(?)}"
                   , resultClass = Employee.class
                   , hints = { @QueryHint(name = "org.hibernate.callable", value = "true")
                          , @QueryHint(name = "org.hibernate.readOnly", value = "true")
    public class Employee implements Serializable
        @Id
        @Column(name="emp_id")
        @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "EmployeeSequence")
        private int id;
        @Column(name="emp_name")
        private String name;
        @Column(name="emp_job")
        private String job;
        @Column(name="emp_hiredate")
        private Date hiredate;
        // constructor
        public Employee (){}
        // getters and setters
        public int getId()
         return id;
    etc...session bean:
    package net.app.entity;
    import java.util.ArrayList;
    import java.util.List;
    import javax.ejb.Stateless;
    import javax.persistence.EntityManager;
    import javax.persistence.PersistenceContext;
    import javax.persistence.Query;
    import net.app.entity.Employee;
    import net.app.iface.ScottAdmin;
    @Stateless
    public class ScottAdminImpl implements ScottAdmin
        @PersistenceContext
        private EntityManager entityManager;
        @SuppressWarnings("unchecked")
        public List<Employee> getEmployeesByDeptId(int deptId)
         ArrayList<Employee> empList;
         try
             Query query = entityManager.createNamedQuery("getEmpsByDeptId");
             query.setParameter(1, deptId);
             empList = (ArrayList<Employee>) query.getResultList();
             return empList;
         catch (Exception e)
             e.printStackTrace(System.out);
             return null;
    }client:
    package net.app.client;
    import java.util.List;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    import net.app.entity.Employee;
    import net.app.iface.ScottAdmin;
    public class ScottClient
        public static void main(String[] args)
         try
             // create local interface
             InitialContext ctx = new InitialContext();
             ScottAdmin adminInterface = (ScottAdmin) ctx.lookup("ScottAdminImpl/remote");
             // select employees by deptno
             int deptno = 20;
             List<Employee> empList = adminInterface.getEmployeesByDeptId(deptno);
             // output
             System.out.println("Listing employees:");
             for (Employee emp : empList)
              System.out.println(emp.getId() + ": " + emp.getName() + ", " + emp.getJob() + ", " + emp.getHiredate());
         catch (NamingException e)
             e.printStackTrace(System.out);
    }Basically you just ignore the refcursor outbound parameter.
    This is a stored function, have yet to try outbound refcursor parameters in stored procedures...
    Edited by: _Locutus on Apr 2, 2009 2:37 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How to call java function in javascript

    Hello Everyone,
    Can anyone tell me solution that:
    How to call java function in javascript?
    Thanks,
    VIDs

    You can't since Java is running on the server and javascript is running in the browser long after the Java side of things has finished executing. Assuming you're not talking about an applet here.
    But you can make calls back to the server through Ajax. All you need is something like a servlet on the receiving end which you can invoke through Ajax; from that point you can execute any Java code you want.

  • How to call a xmlform from KM doc iview

    hi all ,
    can any one explain how to call the xmlform from KM document iview . and my document is in content management ->document ->folder ->app.xml.

    Hi,
    If you want to look at XML form like the are designed in your form builder you need to work with a navigation iview to the folder that contains you XML forms. You need to set the layout of the navigation iview to Newsbrowser or NewsExplorer or a derived layout.
    From here the form is renderer as a form.
    If you only want to show this one form I would suggest to open it in this last view in the described navigation iview and use the url in for example an url iview. This will be the quickest.
    Kind,
    Frederik

  • How to Call HTML Layers from Flash?

    how to Call HTML Layers from Flash? i need a help on example
    or script.

    What do you mean html layers? You can call JavaScript on the
    page using the
    ExternalInterface class. There's examples in Help if you look
    up the EI
    class, and it's call method.
    Dave -
    Head Developer
    http://www.blurredistinction.com
    Adobe Community Expert
    http://www.adobe.com/communities/experts/

  • How do I delete apps from my app store on my Iphone? not talking about holding down the app and hiting X to delete. talking about cmpletely deleting from the app store on the phone. Under 'PURCHASED" and "NOT ON THIS IPHONE" ?

    How do I delete apps from my app store on my Iphone? not talking about holding down the app and hiting X to delete. talking about cmpletely deleting from the app store on the phone. Under 'PURCHASED" and "NOT ON THIS IPHONE" ?

    Also having the same problems here.
    Yesterday, I have downloaded the APPSGONEFREE and there is one App called the Victorian Mystery that is still free and i downloaded it. After a few minutes it pop up on my iphone homescreen,  it can't be loaded. So I tried to delete it but it cant be deleted. (there is no x mark on top of it). I then use my itunes to synchronize it  through my iphone but it wasnt able to delete it. I then bought the apps at apsstore ( Victorian Mystery), which is not free for today and I synchronize and it cant be installed on my Iphone. I just cant delete the APP. I need help.

  • How do I transfer app from computer to IPad?

    How do I transfer app from computer to IPad?

    connect your ipad to your computer using the usb cable
    you then start up itunes on the computer
    then you click on the ipad in devices in the left side panel
    then you click on the application tab on the ipad content panel where you can chooes which apps you want on the ipad
    then you press the button called sync

Maybe you are looking for