Calling events from scripts in UIX

Hi,
I am able to call the ordinary events in the UIX from the script. But I am not able to call the
<ctrl:event .. >
from the script.
Could anyone please tell me how to call them.
Thank you
Velpandian

Velpandian -
Assuming your page contains a form, you can trigger an event on the server from a JavaScript handler by calling submitForm(). The following sample shows how to send an event both by using the ctrl:event attribute as well as from a JavaScript handler:
<?xml version="1.0" encoding="UTF-8"?>
<page xmlns="http://xmlns.oracle.com/uix/controller"
      xmlns:ui="http://xmlns.oracle.com/uix/ui"
      xmlns:data="http://xmlns.oracle.com/uix/ui"
      xmlns:ctrl="http://xmlns.oracle.com/uix/controller">
<content>
  <form name="foo" xmlns="http://xmlns.oracle.com/uix/ui">
  <contents>
    <!-- Import the submitForm() function -->
    <importScript names="submitForm()"/>
    <stackLayout>
    <contents>
      <!-- This link sends an event using a ctrl:event attribute -->
      <link text="Send Event" ctrl:event="test"/>
      <!-- This link sends an event using a JavaScript event handler.
           We use submitForm() and specify the event name using
           a parameter.  Note that this means that we need to be
           sure that we also have an "event" hidden field - which
           we add via a formParameter element below -->
      <link text="Send Event from JavaScript"
            onClick="if (confirm('Send event')) submitForm(0, 0, {'event':'test'}); else return false;"
            destination="#"/>
      <!-- Need a form value to contain the event name -->
      <formParameter name="event"/>
    </contents>
    </stackLayout>
  </contents>
  </form>
</content>
<handlers>
  <!-- Use a null event handler to set up a session variable -->
  <event name="test">
    <go name="nextPage"/>
  </event>
</handlers>
</page>I couldn't find the documentation for submitForm() online anywhere... Here is a copy of the documentation from our source code:
* Attempts to submits the form, potentially firing validation and notifying
* any Cabo onSubmit handlers registered on the form, returning
* <code>true</code> if the submission actually occurred.
* <p>
* If the <code>doValidate</code> parameter is false, no validation will
* be performed, and the form is guaranteed to be submitted.  Otherwise,
* the form will be submitted if both the validation succeeds and any
* registered Cabo onSubmit handlers do not return <code>false</code>.
* <p>
* @param form The form to submit.  This can either be the name of the form
*             in the current <code>document</code>, the index of the form
*             in the current <code>document</code> or the form itself.
* @param doValidate boolean value specifying whether validation should
*   occur before the form is submitted.  (As per a common Javascript
*   idiom, it is acceptable to pass true/false as well as 0/1).  If
*   this parameter is ommitted, it defaults to true.
* @param parameters a single Javascript object that specifies
*   all the additional key-value pairs to submit.  There must be
*   pre-existing &lt;input type="hidden"&gt; elements as targets
*   for each of these parameters.
function submitForm(
  form,
  doValidate,
  parameters
  )Andy

Similar Messages

  • Calling java from scripting

    Hello,
    I would like to integrate some scripting capability in my web application.
    The main purpose is to cover the following scenario :
    - I develop a web app with JSP technology, packaged in a MyAPP.WAR file containing my application and another file (MyCustomer.RAR?) containing installation specific informations. I want the MyApp.WAR to be the same for all my customers, just having the RAR file specific to each customer (installation).
    - In this ressource file, there could be some scripting functions that will be called from my JSP Pages to change the default presentation with some customer particular informations.
    Those informations would be extracted from my java data model. The purpose is to enable the customer to code some little script, and to avoid coding those in Java.
    The question I have on that are :
    1/ is it possible to call java instances from scripting language (I read on apache that the answer was yes for some of them), but I would like to know if javascript can do that.
    2/ Can I recover the "result" of the script in JSP ?
    An example :
    1/ The class containing a marvellous property
    class MyClass {
    public String myProperty;
    2/ The JSP page :
    <stlLib:callScript(Customer.RAR, "ScriptToCall",anInstance) />
    <stlLib:getResult ???>
    3/ A user script (pseudo-code)
    Customer 1 :
    Function ScriptToCall(object) {
    variable iwanttoshowsquareroot;
    iwanttoshowsquareroot = squareroot(object.myProperty);
    return iwanttoshowsquareroot ;
    Customer 2 :
    Function ScriptToCall(object) {
    variable mychoiceisdifferent;
    mychoiceisdifferent= object.myProperty / 2;
    return mychoiceisdifferent;
    According to what ScriptToCall looks like the result on page would be different
    Thanks in advance for your advises
    Olivier.

    1) The script will be running in the browser, not the server, yes? So in Netscape you can load Java objects via Javascript, but IE doesn't seem to support this. Although in either, you can call methods on an applet in the page. But you can't call a JS function from the Java code in the JSP page, since that is only executed on the server.
    2) Only if the "result" is submitted back to the server.

  • Call event from another event

    I have a button where i need to call one event from another... does anyone have any ideas on what the syntax would be?
    public class PushButton extends Button
    public PushButton()
    * Mouse Pressed Event
    this.addEventHandler(MouseEvent.MOUSE_PRESSED,
    new EventHandler<MouseEvent>() {
    @Override
    public void handle(MouseEvent e) {
    System.out.println("MousePressed");
    * Mouse Released Event
    this.addEventHandler(MouseEvent.MOUSE_RELEASED,
    new EventHandler<MouseEvent>() {
    @Override
    public void handle(MouseEvent e) {
    System.out.println("MouseReleased");
              *// Make a call to the mouse pressed event????*
    }

    Hi,
    As per your requirement, i hope the below code should work. :)
    public class PushButton extends Button
         public PushButton()
               * Mouse Pressed Event
              final EventHandler<MouseEvent> mousePressedEvent = new EventHandler<MouseEvent>() {
                   @Override
                   public void handle(MouseEvent e) {
                        System.out.println("MousePressed");
              this.addEventHandler(MouseEvent.MOUSE_PRESSED, mousePressedEvent);
               * Mouse Released Event
              this.addEventHandler(MouseEvent.MOUSE_RELEASED,
                        new EventHandler<MouseEvent>() {
                   @Override
                   public void handle(MouseEvent e) {
                        System.out.println("MouseReleased");
                        // Make a call to the mouse pressed event
                        mousePressedEvent.handle(e);
    }Happy Coding !! :)
    Regards,
    Sai Pradeep Dandem.

  • Getting ie error when calling event from code.

    Hi all!
    I've got an application (running on 6.40 sp8, ep6 sp2) that is pretty basic by all means. Since I want to implement some way to tell the user when he/she has made an error or just to inform him/her about something, I decided to use the ConfirmationDialog.
    I've created an action called onActionShowErrorMessage in my view. This action is tied to my controller and an event defined in the controller.
    Hence, when I want to show the ConfirmationDialog to show the user an error message, I call the controller method and in the method I fire the event that my view method is looking for.
    So far so good..
    When I call my controller method from a button action in the view everything works nicely, but when I try to call it from the wdInit method it fails?! I do get the ConfirmationDialog up but I also get an IE error window telling me that IE is trying to open a page it cannot find. I have no idea why it tries to open any page at all, since there is no navigation defined for this action.
    Anyone got an idea? I couldn't find any good stuff in the system logs either
    Best regards,
    Andreas

    Hello Sam!
    Thanks for your answer! I would like to use something more of a pop thing, since i want to make sure the user sees it. The MessageManager does not work as good as it used to anymore, since it puts all messages in the bottom of the page. This page needs to be scrolled in order to see the error message..
    Anyone got an idea of a workaround? I'm reading a propsfile, and in case I'm not able to read it I want to display this to the user.
    B.R
    Andreas

  • Call event from other event or other vi

    I have LabVIEW 6.1.
    1. Can I call an event or a serious of events from another event? How can I do that? It doesn't matter if the events are executed after the event that called them is completed.
    2. Can I call an event from another vi? Let's say I have an event structure in a subvi. Can I trigger an event in the subvi calling it from the main vi? How would I do that?
    Thanks for your help.
    Jerome.

    Salutations,
    In reality, a program should only have 1 event structure. Or so someone much more knowledgable with labview has told me in the past.
    It's an important note to make that when running events or SubVi's, they will run until they are accomplished and then allow the next event or subvi to take place. So if you have multiple event structures, you must wait until one finished before the next one is run (This might...no guarantees, be avoided by multiple while loops and not locking the front panel on the execution of an event). Now, since you don't care, you can handle such a case. Just make multiple events in your one main event structure. I'm not sure what exactly you want to do, just make sure you "unfreeze" the front panel when you're messing with what handles what events.
    Hence, you could have a "run" button that's pressed and it goes about it's business. Then you could have a mouse down response, that you hit while your "run" process is still going, this will be, in a sense, logged and accomplished once the "run" task is done. Now, if you're looking for data to trigger another event, maybe I'd switch over to a case structure that's inside your event structure. For case structures, every case must have an output.
    Can you trigger an event in the subvi calling it from the main vi.... Excellent question... I'm not exactly sure when this would come up, but i'm not super experienced like some of the people around here. It may be possible, but i'd imagine a case structure would be more efficient. Like the ones in error handling. Pass the case to the subvi, it'll operate depending on what you want, and then continue along. Events seem most useful when dealing with events that occur on the front panel.
    Hope this helps,
    ElSmitho

  • Error while calling Subroutine from Script

    HI Friends,
    I am getting a short dump whilecalling a suboutine from Script.
    Please suggest if am wrong with below code
    /: PERFORM GET_ADDRESS IN PROGRAM ZSUBROUTINES
    /: USING &MHND-KUNNR&
    /: CHANGING &ADRS-LINE0&
    /: CHANGING &ADRS-LINE1&
    /: ENDPERFORM
    All above fields are available in script window
    In the program
    FORM get_address    TABLES in_tab STRUCTURE itcsy
                                       out_tab stucture itcsy.
    ENDFORM.
    Thanks

    HI,
    Your code is correct, in the FORM and ENDFORM in the program, read the INPUT table and get the values and write your logic using these values and send back the values to the SCRIPT using the OUTTABLE. here you need to use the MODIFY statment for the outtable using Sy-TABIX.
    Regards
    Sudheer

  • BUG: UnhandledEventException when calling event from a link on UIX page

    Here is very simple test you can do to reproduce this:
    1. Create empty workspace and open ViewCOntroller->struts-config.xml
    2. Craete two data pages, dataPage1 and dataPage2
    3. On dataPage1 create a link with ${ctrl:eventUrl(uix,'back')} and create event 'back'
    <event name="back">
      <method method="handleBack" class="view.MyClass"/>
    </event>4. create event handler in a class:
    package view;
    import javax.servlet.http.HttpSession;
    import oracle.cabo.servlet.BajaContext;
    import oracle.cabo.servlet.Page;
    import oracle.cabo.servlet.event.EventResult;
    import oracle.cabo.servlet.event.PageEvent;
    import oracle.cabo.servlet.util.RedirectUtils;
    public class MyClass
      public static EventResult handleBack(BajaContext context, Page page, PageEvent event)
        System.out.print("I am in handleBack");
        HttpSession session = context.getServletRequest().getSession(true);
        Page nextPage = new Page("dataPage2");
        session.invalidate();
        return new EventResult(RedirectUtils.getRedirectPage( context, nextPage));
    }run dataPage1.do and click on a link:
    500 Internal Server Error
    oracle.cabo.servlet.event.UnhandledEventException
    at oracle.cabo.servlet.event.TableEventHandler.handleEvent(Unknown Source)
    at oracle.cabo.servlet.event.BasePageFlowEngine.handleRequest(Unknown Source)
    at oracle.cabo.servlet.AbstractPageBroker.handleRequest(Unknown Source)
    at oracle.cabo.servlet.ui.BaseUIPageBroker.handleRequest(Unknown Source)
    at oracle.cabo.servlet.PageBrokerHandler.handleRequest(Unknown Source)
    at oracle.cabo.servlet.UIXServlet.doGet(Unknown Source)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
    at oracle.security.jazn.oc4j.JAZNFilter.doFilter(Unknown Source)
    at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:16)
    at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:239)
    at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:645)
    at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:322)
    at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:790)
    at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:270)
    at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
    at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
    at java.lang.Thread.run(Thread.java:534)
    if you do not get the same error I am then Donald Duck.

    I have a similar scenario to recreate this same error. I have a link on my page used as an anchor. After I select the link, I select a submitButton and I get the error. If I select the submitButton before I use the link, everything works fine.
    Is this a BUG???

  • Call Event from One View to another View

    Hi All,
    I have 2 views in my Webdynpro application .View 1 has a input field and View2 has a button. When the user enters a value in the input field and clicks on Enter, i want to call the button action in View2.
    I created Navigation link from view1 to view2 using outbound and inbound plugs. I created an action "OnEnter" for the input field. But how do i invoke Button action(View2) from View1?
    Regards,
    Maggie.H

    Hi Maggie,
    You can do in another way, OnClick of view 2's button action you will write some code. Write the same code by creating a method in component controller, and call from wherever you want.
    I Hope it helps and solves your issue.
    Regards
    Nizamudeen SM

  • Calling subroutine from scripts

    I am calling a subroutine form a standard text, the subroutine is getting called but the input table is comming empty.
    can any one please advise me what could be the problem.
    /:PERFORM GET_APP_DATA IN PROGRAM YHR_APP_DATA
    /:USING &P0001-PERNR&
    /:CHANGING &GRADE&
    /:ENDPERFORM

    Check this sample code...may be it will help u to identify the prob...
    Definition in the SAPscript form:
    /: PERFORM GET_BARCODE IN PROGRAM QCJPERFO
    /: USING &PAGE&
    /: USING &NEXTPAGE&
    /: CHANGING &BARCODE&
    /: ENDPERFORM
    / &BARCODE&
    Coding of the calling ABAP program:
    REPORT QCJPERFO.
    FORM GET_BARCODE TABLES IN_PAR STUCTURE ITCSY
    OUT_PAR STRUCTURE ITCSY.
    DATA: PAGNUM LIKE SY-TABIX, "page number
    NEXTPAGE LIKE SY-TABIX. "number of next page
    READ TABLE IN_PAR WITH KEY u2018PAGEu2019.
    CHECK SY-SUBRC = 0.
    PAGNUM = IN_PAR-VALUE.
    READ TABLE IN_PAR WITH KEY u2018NEXTPAGEu2019.
    CHECK SY-SUBRC = 0.
    NEXTPAGE = IN_PAR-VALUE.
    READ TABLE IN_PAR WITH KEY u2018BARCODEu2019.
    CHECK SY-SUBRC = 0.
    IF PAGNUM = 1.
    OUT_PAR-VALUE = u2018|u2019. "First page
    ELSE.
    OUT_PAR-VALUE = u2018||u2019. "Next page
    ENDIF.
    IF NEXTPAGE = 0.
    OUT_PAR-VALUE+2 = u2018Lu2019. "Flag: last page
    ENDIF.
    MODIFY OUT_PAR INDEX SY-TABIX.
    ENDFORM.
    Regards,
    JOy.

  • Event call event

    hello,
    I would like to know how to call event from another,
    I have for the moment 5 individuals actions (manage with event structure) A B C D and E  and
    i  need  in somecase that A want to call E, B to call E or  B to call E then quit on quit button.
    is there a way to call ( simulate) an event call at end of first really called (by user) ?
    can i use flag, event register ? i don't kow what is best solution
    Best regards 
    Tinnitus
    CLAD / Labview 2011, Win Xp
    Mission d'une semaine- à plusieurs mois laissez moi un MP...
    RP et Midi-pyrénées .Km+++ si possibilité de télétravail
    Kudos always accepted / Les petits clicks jaunes sont toujours appréciés
    Don't forget to valid a good answer / pensez à valider une réponse correcte
    Attachments:
    eventcall.vi ‏14 KB

    Yes but it send me an error
    see attachement
    CLAD / Labview 2011, Win Xp
    Mission d'une semaine- à plusieurs mois laissez moi un MP...
    RP et Midi-pyrénées .Km+++ si possibilité de télétravail
    Kudos always accepted / Les petits clicks jaunes sont toujours appréciés
    Don't forget to valid a good answer / pensez à valider une réponse correcte
    Attachments:
    eventcall2.vi ‏19 KB

  • Sync put random photos on my iphone 5s as "Events (from My Mac), however now I cannot delete from phone?

    These photos now exist in an Album called "Events" (From My Mac) in about 10 seperate folders. When I try to delete them from the phone, the trash can does not highlight, nor does the red minus circle pop up for the album. Also, I cannot delete photos individually.
    Futhermore, when I connect my phone to iTunes, iPhoto, or Image Capture, those photos do not show as existing on my iPhone. They seem to be lost in the nether regions of the phone...please help me get rid of them!
    Thanks!

    Thanks for the response!
    Unfortunately, the photos do not exist in the Camera Roll. The Camera Roll now shows 0 photos total, since I have deleted every photo I've been able to. The mystery photos are located in a folder underneath Camera Roll labled as "Events", but I am unable to delete the folder, and when I go to look at the photos individually, I cannot delete them there either. In the Events folder, I did previously have photos from my Photostream, and I was able to delete those with no problem. It just seems that these photos do not want to be removed.

  • Can I transfer photos in 'Events from my Mac' back to my iMac?

    I lost my entire iphoto library and I am not entirely sure how. I have run a few searches on my imac and cannot seem to find the hidden library anywhere. Luckily my library is still appearing on my iPad within a folder called Events from my Mac - any tips as to how I can move these pictures from my ipad back to my Mac please? When I open iPhoto on my Mac I am unable to see these, I can only see these photos on my iPad. Thanks.

    Meet the minmum software requiremets, subscribe to iCloud, log ina dn turn it on
    http://www.apple.com/icloud/setup/
    LN

  • Calling Portal event from ABAP class

    Hi Experts,
    I need a following clarificatrion, Please help,
    1. Is it possible to call a webdynpro method from a normal ABAP class?
    2. If no, we need a functionality of a class 'CL_WDR_HTTP_EXT_MIME_HANDLER' having method 'DO_DOMAIN_RELAX_HTML'.
    Is there any alternative method which can be used in ABAP having the same functionality.
    3. Is there any ways with which we can call portal event from ABAP class?
    Thanks,
    Shabir

    >1. Is it possible to call a webdynpro method from a normal ABAP class?
    I wouldn't necessarily recommend this approach. You shouldn't try to trigger events or any of the standard WDDO* methods from outside the WD Component itself.  That said, you can pass the object reference (like the WD_COMP_CONTROLLER object reference or the View Object Reference) into methods of normal classes.  Be careful if you are finding yourself calling a lot of your added methods from outside WD.  This is probably a sign that these methods should be in the Assistance Class or some other Class functioning as a Model Object.
    >2. If no, we need a functionality of a class 'CL_WDR_HTTP_EXT_MIME_HANDLER' having method 'DO_DOMAIN_RELAX_HTML'.
    Is there any alternative method which can be used in ABAP having the same functionality.
    What exactly do you want to do here?  Do you just want to get the relaxation script?  For what purpose?  You should never need to inject the relaxation script into WDA. 
    >3. Is there any ways with which we can call portal event from ABAP class?
    To what purpose.  Do you just want to delegate the triggering of the event that is inside WD Component to be called from a class?  If so you can pass the portal API object reference into a class from the WD Component.  However this only works while running within WD.
    How is this class used?  Are you running in WD?  Are you trying to generate some HTML code that runs in the portal independent of WD?

  • Calling 'show hide' event from 'select' event

    Hi all,
    is it possible to call an event from another event?
    Can i call the 'show hide' event from the 'select' event to disclose the selected row?
    As a sidenote: is it possible to remove the show/hide button/link but to retain the show/hide functionality?
    Thanks in advance....
    Regards,
    Robert

    Hi Gabrielle,
    Yes indeed... the row information is sent... the 'select' event i'm refferring to is the one generated when you drag a viewobject as a readonly table to a UIX datapage...
    It is generated initially as
    <event name="select" source="EmpView10">
        <set target="${bindings.EmpView1Iterator}" property="currentRowIndexInRange" value="${ui:tableSelectedIndex(uix, 'EmpView10')}"/>
    </event>However i must have made a typo last time as it works now... ohwell.. made some changes and submitted the selected row as parameter using
        <invoke method="handleEvent" javaType="view.DisclosureEventHandler">
            <parameters>
                <!-- Selected row -->
                <parameter javaType="java.lang.String" value="${ui:tableSelectedIndex(uix, 'EmpView10')}" />
                <!-- SessionScope attribute to put detailDisclosure in -->
                <parameter javaType="java.lang.String" value="detailDisclosure" />
                <!-- All the other stuff -->
                <parameter javaType="oracle.cabo.servlet.expl.ControllerImplicitObject" value="${uix}"/>
            </parameters>
    </invoke>This works more cleanly and can be reused...
    Thanks for your replies... it always helps when someone is thinking along... it makes you takes some crossroads you wouldn't think of...
    Regards,
    Robert

  • Can any one tell me how can i call a shell script from pl/sql

    i like to call shell script from pl/sql procedure.
    can any one suggest how can i do this

    Have you not mastered in asking the same kind of question ?
    First do write a script...
    no one will spoon feed you.
    How can i call a shell script from procedure
    How to call Shell Script from pl/sql block
    -Sk

Maybe you are looking for

  • Protected mode message comes up and when I try to open files it says it encountered an error and to check online.. i can not open any files now

    Within the past week I have been getting messages when trying to open pdf files " that its in protected mode and can not open" I deleted adobe and reinstalled directly from Adobe.com and now I can not open any file with a message it has encountered a

  • Permissions for connected SharePoint sites

    hello forum members, can someone please explain to me how do permissions work for connected SharePoint sites if Project Server set up to use Project permissons instead of SharePoint ? Another question I have is that our environment was once set to us

  • Connect Notebook to TV

    How do you connect a Toshiba NB505-N500BL to a Toshiba 32TL515U LCD TV? Do I use a VGA to HDMI cable or a VGA to RCA cable ? Have been told to use a VGA to HDMI cable and plug into the HDMI port on TV. Could not find any detailed information in manua

  • Speakers and Connecting Them

    I plugged in external speakers, but my macbook doesn't seem to recognize it or even notice that it's there. Anyone know how to fix this? Thanks.

  • Removecontexts

    I have the following mapping structure.. IDOC   ORDERS05     E1EDK01       belnr     E1EDK03       IDDAT - 011       DATUM - date      E1EDK03       IDDAT - 011       DATUM - date      E1EDP01       posex I need to map that to Header (as many times a