Call objective c Method using javascript

how can i call objective c mehod using javascript..........

If the JavaScript is running in a browser or UIWebView on iOS, you cannot. Allowing direct access to the native API would be a huge security vulnerability.
As an alternative, there are development frameworks such as PhoneGap that allow developers to access some native iOS features (such as Contacts, Camera) from JavaScript by using a runtime that includes a foreign function interface. The app must be deployed to the device, bundled with the runtime.

Similar Messages

  • How to call a bean method through javascript?

    Hi,
    i want to call a bean method using the javascript.
    thansk in advance.

    hi
    i want to call a backing bean method thought javscript on the button click.
    i am inplementing addition of textbox at runtime.i wrote method and i am calling that on the button click.but the textbox is not created.
    the code is bleow
    public String doAction() {
         tryStuff1();
    return "samplejsf";
    public void tryStuff1()
    System.out.println("Enter the trystuff method");
         FacesContext facesContext = FacesContext.getCurrentInstance();
    UIViewRoot uIViewRoot = facesContext.getViewRoot();
    Application application = facesContext.getApplication();
    UIComponent formComp=uIViewRoot.findComponent("subbody:form1");
    HtmlPanelGrid grid= new HtmlPanelGrid();
    grid.setId("panelgrid2");
    grid.setColumns(2);
    grid.setBorder(2);
    //UIComponent panelGridComp=formComp.findComponent("subbody:panelgrid1");
    //UIComponent panelGroupComp=panelGridComp.findComponent("panelgroup2");
         HtmlOutputText output = new HtmlOutputText();
    output.setValue("dynamic jsf text2");
    System.out.println("hello output text2");
    output.setRendered(true);
    grid.getChildren().add(output);
    HtmlInputText input = new HtmlInputText();
    input.setSize(40);
    input.setValueBinding("value", (ValueBinding) application.createValueBinding("#{sample.text2}"));
    input.setRendered(true);
    grid.getChildren().add(input);
    System.out.println("hello output text1");
    grid.setRendered(true);
    formComp.getChildren().add(grid);
    System.out.println("hello output text3:");
    formComp.getRendersChildren();
    formComp.setRendered(true);
    public boolean getRendersChildren() {
         return true;
    jsp code is
    <h:form id="form1">
    <h:panelGrid columns="2" binding="#{sample.formElements}">
    </h:panelGrid>
    <h:panelGrid id="panelgrid1" columns="1">
    <h:panelGroup id="panelgroup1">
    <h:outputText value="hardcoded jsf text1"/>
    <h:inputText value="#{sample.text1}"/>
    </h:panelGroup>
    </h:panelGrid>
    <h:commandButton id="add" action="#{sample.doAction}" value="add" type="SUBMIT"/>
    </h:form>
    when i click on the button its going into the method and diaplying s.o.p but the text box is not updated to the page.
    why is it so.
    i thought there may be a problem in calling the method directly thru button. i want to try thru javascript calling the bean method.
    why is the page not updated.
    can u help me out
    thanks in advance
    sree

  • Is it possible to call a class method using pattern in ABAP editor.

    Hi,
         Is it possible to call a class method using pattern in ABAP editor.
    Thank U for Ur time.
    Cheers,
    Sam

    Yes,
    Click patterns.
    Then choose Abap objects patterns.
    Click on the Tick
    It will give a new screen
    Here Give the name of the class first.
    Then the object (instance of the calss)
    And finally the method ..
    it will give you the pattern
    Hope this helps.

  • How to call jpf controller method from javascript

    Can any one help me how to call pageflow controller method from JavaScript.\
    Thanks.

    Accessing a particular pageflow method from Javascript is directly not possible unless we do some real funky coding in specifying document.myForm.action = xyz...Heres what I tried and it did not work as expected: I found another workaround that I will share with you.
    1. In my jsp file when I click a button a call a JavaScript that calls the method that I want in pageflow like this: My method got invoked BUT when that method forwards the jsp, it lost the portal context. I saw my returned jsp only on the browser instead of seeing it inside the portlet on the page of a portal. I just see contents of jsp on full browser screen. I checked the url. This does make the sense. I do not see the url where I will have like test1.portal?_pageLabe=xxx&portlet details etc etc. So this bottom approach will notwork.
    document.getElementById("batchForm").action = "/portlets/com/hid/iod/Batches/holdBatch"; // here if you give like test1.portal/pagelable value like complete url...it may work...but not suggested/recommended....
    document.getElementById("batchForm").submit;
    2. I achieved my requirement using a hidden variable inside my netui:form tag in the jsp. Say for example, I have 3 buttons and all of them should call their own action methods like create, update, delete on pageflow side. But I want these to be called through javascript say for example to do some validation. (I have diff usecase though). So I created a hidden field like ACTION_NAME. I have 3 javascript functions create(), update() etc. These javascripts are called onclick() for these buttons. In thse functions first I set unique value to this hiddent field appropriately. Then submit the form. Note that all 3 buttons now go to same common action in the JPF. The code is like this.
    document.getElementById("ACTION_NAME").value = "UPDATE";
    document.getElementById("batchForm").submit.
    Inside the pageflow common method, I retriev this hidden field value and based on its value, I call one of the above 3 methods in pageflow. This works for me. There may be better solution.
    3. Another usecase that I want to share and may be help others also. Most of the time very common usecase is, when we select a item in a drop bos or netui:select, we want to invoke the pageflow action. Say we have 2 dropdown boxes with States and Cities. Anytime States select box is changed, it should go back to server and get new list of Cities for that state. (We can get both states and cities and do all string tokenizer on jsp itself. But inreality as per business needs, we do have to go to server to get dynamic values. Here is the code snippet that I use and it works for all my select boxes onChange event.
    This entire lines of code should do what we want.
    <netui:anchor action="selectArticleChanged" formSubmit="true" tagId="selectPropertyAction"/>                    
    <netui:select onChange="document.getElementById(lookupIdByTagId('selectPropertyAction',this )).onclick();" dataSource="pageFlow.selectedArticleId" >
    <c:forEach items="${requestScope.ALL_ARTICLE}" var="eachArticle">
    <%-- workshop:varType="com.hid.iod.forms.IoDProfileArticleRelForm" --%>
    <netui:selectOption value="${eachArticle.articleIdAsString}">${eachArticle.articleItemName}</netui:selectOption>
    </c:forEach>               
    </netui:select>
    See if you can build along those above lines of code. Any other simpler approches are highly welcome.
    Thanks
    Ravi Jegga

  • How to call a bean method from javascript event

    Hi,
    I could not find material on how to call a bean method from javascript, any help would be appreciated.
    Ralph

    Hi,
    Basically, I would like to call a method that I have written in the page java bean, or in the session bean, or application bean, or an external bean, from the javascript events (mouseover, on click, etc...) of a ui jsf component. I.e., I would like to take an action when a user clicks in a column in a datatable.
    Cheers,
    Ralph

  • Call to Applet Method from JavaScript Failed.

    I Am calling a method from a javascript function from within a web page.
    The page is loaded into a frame. The parent window of the frame has stored a reference to the applet which defines the methods. Note I am treating the reterence to the applet as a global variable. So that I can reference it methods as I navigate from one page to another.
    I have JavaScript objects defined, and I am passing them as parameters to the applet's methods. In java, the JavaScript objects are refererenced as JSObject. When I call a java method passing a JavaScript
    Object I get the following exception. Note Iam using j2sdk1.4.2_01 on a Windows 2000 Professional System. This problem start occurring after the recent Microsoft Worm/Virus a fix was loaded on my system which resulted in the following bug. Could someone please help me.
    java.lang.NullPointerException
         at sun.plugin.javascript.ocx.JSObject.setIExplorerAppletContext(Unknown Source)
         at sun.plugin.com.DispatchImpl.convertParams(Unknown Source)
         at sun.plugin.com.DispatchImpl.invokeImpl(Unknown Source)
         at sun.plugin.com.DispatchImpl$2.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at sun.plugin.com.DispatchImpl.invoke(Unknown Source)
    java.lang.Exception: java.lang.NullPointerException
         at sun.plugin.com.DispatchImpl.invokeImpl(Unknown Source)
         at sun.plugin.com.DispatchImpl$2.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at sun.plugin.com.DispatchImpl.invoke(Unknown Source)

    A little code snippet would help. I use JSObjects from Java 1.4 no problem and do have all the latest updates. I also have JavaScript calling Java code as well - also with no problem.

  • How to call a WebService method using HttpsURLConnection?

    Hi,
    I want to know how i could use HttpsURLConnection to call a WebService method.
    I can use the following:
    String endpoint = "https://xyz:8443/axis/services/MSecurity";
    System.setProperty("javax.net.ssl.keyStore", keyStorepath);
    System.setProperty("javax.net.ssl.keyStoreType", "PKCS12");
    System.setProperty("javax.net.ssl.keyStorePassword", keyStorePassword);
    System.setProperty("javax.net.ssl.trustStore", trustStorePath);
    System.setProperty("javax.net.ssl.trustStoreType", "JKS");
    System.setProperty("javax.net.ssl.trustStorePassword", trustpass);
    //Call Web Service
    URL url = new URL(endpoint);
    MSecuritySoapBindingStub service = new MSecuritySoapBindingStub(url, null);
    //get list of people
    String[] vo = service.getVO();
    for (int i = 0; i < vo.length; i++) {
    System.out.println(vo);
    However, loading my cert. this way is not flexible. Therefore, I am using SSLContext to initialize my keystore and truststore and then I am using the following to connect to my webservice:
    SSLContext sc = SSLContext.getInstance("SSLv3");
    sc.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null);
    SSLSocketFactory ssf = sc.getSocketFactory();
    URL url = new URL(endpoint);
    HttpsURLConnection htp = (HttpsURLConnection) url.openConnection();
    htp.setSSLSocketFactory(ssf);
    However, I do not know how I could use the "htp" object to call the getVO() method above.

    Use Apache Axis to do SOAP in Java.
    Nobody can just mail you the code. You first have to create java source files from the web service via its WSDL file.

  • How to call formhandler handler method using js onclick function

    I need to call formhandler handle method when user clicks on a link. I want to call that method in js function.
    any help will be appreciated.

    Please try the below.
    In jsp page:
    <a(HTML tag) href="javascript:submitfunction();"> My Submit Link </a(HTML tag end>
    <dsp:input type="hidden" bean="MyFormHandler.handleMethod" id="submitForm"/>
    In js file:
    submitFunction(){
    $(#submitForm).submit(); //or you can try .click();
    Note: I am using jQuery library.
    Thanks,
    Gopinath Ramasamy
    Edited by: Gopinath Ramasamy on Nov 29, 2012 1:06 PM
    Added comment to 'a' tag to get the code displayed in the page

  • Calling Objective C method fron C function

    Hi All,
    I am working with an iOS application in which i have to establish LAN calls. Here I have to interact with core level layer like C.
    When i call the objective C method from the C function, I am not able to do any UI tasks in that objective C method, which is called
    from the C function. Here  i am able to do only printing the NSLog statements. I used function call back. But i am unlucky. Here any one
    can help me.
    Thanks in advance.

    Thanks for your reply.
    Here i am able to call the objective C method from the C function. But i am not able to perform any UI related
    functionalities in the Objective C method which i am calling in C function.
    Thanks,
    Lakshmi kanth

  • How can I call a web service using JAVAscript in LCD

    hi guys,
         I know it can call a WSDL in LCD, but I have not any WSDL web service , and I have a REST web service ,how can I call this REST web service in LCD? I checked some documents and found nothing...if it's possible that it can call a REST web service using JAVAScript code, I mean I can program some code to call this web service ?
    thanks,
    Jesse

    Hi Jesse,
    You can do GET, PUT and POST using FormCalc, so you should be able to access a REST web service. 
    There is a example of accessing a RSS feed in this thread, http://forums.adobe.com/message/5695433#5695433
    Regards
    Bruce

  • Calling managed bean method using ajax on jsp page loading

    Hello,
    I am using jsf1.1 i want to call managed bean method when page gets loaded using ajax.
    Thanks
    K.Ramu

    Use an ajaxical JSF framework, for example Ajax4jsf (part of RichFaces).
    But why don´t you just use the constructor of the bean class to do some stuff prior to page loading?

  • Call managed bean function using javascript

    Any one help me how to call managed bean function through Javascript onload() event.

    What do you want to do after all? Isn't the constructor/initblock of the bean sufficient? Which JSF version/implementation are you using?

  • How to use call a binding action using Javascript ?

    Hi adf people,
    JDev : 11.1.1.4.0
    How to submit the binding action using the Javascript ?

    what do u mean by submitting the binding action..???
    for javascript you can either use
    af:clientlistener to call javascript
    af:serverlistener to call from javascript to managed bean
    http://download.oracle.com/docs/cd/E12839_01/apirefs.1111/e12419/tagdoc/af_clientListener.html
    http://download.oracle.com/docs/cd/E15523_01/apirefs.1111/e12419/tagdoc/af_serverListener.html
    please tell us if you need any more information.. or explain your question properly..

  • Call Applet's method in javascript? (Urgent!)

    My applet has a method that returns a string.
    public String getName()In my html page [IE5.5]
    <script language="javascript1.2">
    function getName() {
       alert(myApplet.getName());
    </script>
    <applet name="myApplet" .....></applet>
    <button id=test onClick="getName()">Test</button>Is this possible? Do you know any better way?
    I really appreciate for your help.
    Thanks a lot.
    Tom

    Maybe I didn't set my path correctly?
    Here is what it's all about:
    I have a serialized object stored in Java folder.
    The class files are packed in Java/com.so.bo.MyApplet.class
    html file is the same level as Java folder
    codebase="Java"
    code="com.so.bo.MyApplet.classDid I do it right?
    For IE:
    The point is set the parameter "Scriptable" to
    "True".
    This is an example of an applet made scriptable:
    <!--"CONVERTED_APPLET"-->
    <!-- HTML CONVERTER -->
    <OBJECT
    classid="clsid:CAFEEFAC-0013-0001-0000-ABCDEFFEDCBA"
    WIDTH = "100%" HEIGHT = "280" NAME = "XmlApplet"
    codebase="http://java.sun.com/products/plugin/1.3.1/ji
    stall-131-win32.cab#Version=1,3,1,0">
    <PARAM NAME = CODE VALUE = "XmlApplet.class" >
    <PARAM NAME = CODEBASE VALUE = ".." >
    <PARAM NAME = ARCHIVE VALUE = "XMLApplet.jar" >
    <PARAM NAME = NAME VALUE = "XmlApplet" >
    <PARAM NAME="type"
    VALUE="application/x-java-applet;jpi-version=1.3.1">
    <PARAM NAME="scriptable" VALUE="true">
    <COMMENT>
    <EMBED
    type="application/x-java-applet;jpi-version=1.3.1"
    CODE = "XmlApplet.class" CODEBASE = ".." ARCHIVE =
    "XMLApplet.jar" NAME = "XmlApplet" WIDTH = "100%"
    HEIGHT = "280" scriptable = "true"
    pluginspage="http://java.sun.com/products/plugin/1.3.1
    plugin-install.html"><NOEMBED>
    </NOEMBED>
    </EMBED>
    </COMMENT>
    </OBJECT>
    <!--
    <APPLET CODE = "XmlApplet.class" CODEBASE = ".."
    ARCHIVE = "XMLApplet.jar" WIDTH = "100%" HEIGHT =
    "280" NAME = "XmlApplet">
    <PARAM NAME = "scriptable" VALUE ="true">
    </APPLET>
    -->
    <!--"END_CONVERTED_APPLET"-->You can see this applet working with IE in
    http://www.amicworld.com by following XMLBroker.

  • How to call Jive Search methods using REST Web Services from ADF

    Hi
    Can someone provide me an example to call JIVE Search using REST web services from Webcenter ADF.
    As we have the similar facility to call UCM Search from WebServices DataControl.
    Do we have anything similar like this for JIVE Search?
    JIVE 5.1 is deprecating SOAP style web services and so I am planning to use REST.
    Any suggestions on this is much appreciated.
    Many Thanks
    Khad

    so what exactly is the problem here?
    what is not working?

Maybe you are looking for

  • ITunes version 10.6.3 will not update

    iTunes 10.6.3 will not update so that I can sync my iphone.  What do I do?

  • Considering buying aperture.  Have raw images processed in NIK NX2 software.  What happens to those files when imported into Aperture?

    Understand NiK is discontinuing Capture NX2.  Therefore would like to buy Aperture as host for image management.  If I do purchase and import RAW files previously processed in NX2 into Aperture.  Is old processing retained?  Doubtful.  Or is new proc

  • Cost analysis report

    Hi, In a production order we can go to 'Cost Analysis' to check plan / target / actual / variance values. What is to be done if we need a collective report of multiple orders. is there any standard report?  thanks in advance. neeraja

  • Patch 142437 (Sendmail 8.14.4) broken?

    After installation of Patch 142437-05 (and newer) and therefore upgrading to sendmail 8.14.4, I cant get sendmail to bind on all interfaces. Removing the patch and downgrading to 8.13.8 resolves the issue. Normally, you specify where to bind to with

  • Java3D multi threads

    hi, I'm a new user of java3D, and I've to create a 3D world, with animations and interactions. I read the turorial, of course, but I think i've to create a multithreads application. That's the reason why I'm searching a such example, which I don't fi