How to invoke  javascript function after business action??

How to call javascript function(such as "window.close(), window.open(...),...") in the action method(public String doBusiness(){...}) of <h:commandButton>?If not,then,is there any alternate approach to call javascript function when the bussiness action method finished??
Thanks a lot!

Since your business method is called after the form is submitted, and your code is running on the server, probably the only thing you can do is this:
Create a custom component (Maybe call it the "onLoad" component) that you always render at the top of your JSP. In the regular situation it wouldn't render anything, but in the case you mention, after your busines method, you would call a method on this new component on the server that would cause it to actually render something the next time it is rendered. When rendered this time, it could then render the "onLoad" method which has your window.close() code in it. The window would then close right away.
The key is that you are not doing any of this on the client. The form is submitted, your business logic is executed, then the next page is rendered. When the next page is rendered, your javascript could be rendered to close the window.
If I'm offbase here, someone please say something, I'd hate to send this guy on a wild goose chase.
Dave

Similar Messages

  • How to call javascript function from PL/SQL procedure

    Can anybody advice me how to call javascript function from PL/SQL procedure in APEX?

    Hi,
    I have a requirement to call Javascript function inside a After Submit Process.
    clear requirement below:
    1. User selects set of check boxes [ say user want to save 10 files and ticks 10 checkboxes]
    2. user clicks on "save files" button
    3. Inside a After submit process, in a loop, i want to call a javascript function for each of the file user want to save with the filename as a parameter.
    Hope this clarify U.
    Krishna.

  • Call javascript function after submit process

    Hi,
    How can I call javascript function after my submit process ?
    Thanks.

    Hi Carl,
    You say that I must have an Item or region that contains my js with conditionnal display. With this method I can execute my js with specific request value.
    My problem is that I tried to integrate the "save large value workaround" in my application with the APEX wysiwyg (fckeditor). To do that I have to call the javascript function clob_submit on the save button. This function save the value of my field but if I want to save other item value, how can I do that ?
    If I use your method, I will submit the page, save the other field and after that, I will branch on the same page. At this moment, I will execute my javascript file.
    Is it what did you said ?
    Sylvain Michaud
    Homepage : http://www.insum.ca
    InSum Solutions' blog : http://insum-apex.blogspot.com

  • How to call javascript function?

    Hi,
    How to call javascript function for SAP button
    control onclick event?
    Thanks in advance.

    Hi Sundar,
      u can call java script  in design mode.
      Add this code in ur design part inside body and call the function as
    <sap:button id="a" onSelect="javascript:go();"
    Add inside body:
      <script language="javascript>
    function go(){
    alert("hai");
      </script>
    Regards,
    Vinoth.M

  • How to invoke RFC function module from XI interface

    Hi all,
    I am having one question, How to invoke RFC function module from XI interface.
    Please reply me as soon as possible.
    Thanks in advance,
    Radhika

    Hi,
    To call the RFC in mapping u need to create the RFC lookups...check these links.
    How we have to create the lookups?
    Check this weblogs with some screenshots on how to achieve this:
    /people/siva.maranani/blog/2005/08/23/lookup146s-in-xi-made-simpler
    /people/sravya.talanki2/blog/2005/12/21/use-this-crazy-piece-for-any-rfc-mapping-lookups
    /people/alessandro.guarneri/blog/2006/03/27/sap-xi-lookup-api-the-killer
    /people/sap.user72/blog/2005/12/06/optimizing-lookups-in-xi
    /people/morten.wittrock/blog/2006/03/30/wrapping-your-mapping-lookup-api-code-in-easy-to-use-java-classes
    lookups in xi
    XI Design Guidelines
    Re: RFC Lookup API
    /people/alessandro.guarneri/blog/2006/03/27/sap-xi-lookup-api-the-killer
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/a03e7b02-eea4-2910-089f-8214c6d1b439
    Regards,
    Phani

  • How to call javascript function & action method on clicking jsf  button?

    I have one jsf custom button. I am checking client side validations in mail by calling javascript function & also sending mail by calling action method of a bean which will execute at server side for onclick event of that button. Because of this when I click on that button its calling both javascript function and action method. So even though validations failed its sending mail. How can I overcome this problem?? Please help me....

    I am asking regarding commanLinks in jsf. I have the following code block in jsf. Even though mailSentMessage('true'); returns false, its calling action="#{emailObjectAction.sendEmail}" method. thats why I got that doubt. try the following code.
    <h:commandLink id="mailBtn123Send"      onclick="return mailSentMessage('true');" value="send mail"     action="#{emailObjectAction.sendEmail}">          
    </h:commandLink>

  • How to call javaScript function in the form from Action:Tab buttion in workspace

    Hi,
    I want to trigger JavaScript function that I have written in form from Action: buttons in workspace user's account.
    Is there any way that if i hit a button on action bar, it fire a javascript function.
    Reason is: I dont want to place button on the form to perform any action on the form. I want to take control of the form from these buttons. Like submit, edit a form, etc, etc..
    Please let me know if i couldnt explain it properly.
    regards
    Sunil

    Sunil, you want to look at the "Customizing the LiveCycle® Workspace ES User Interface" document at http://help.adobe.com/en_US/livecycle/9.0/customizeworkspaceui.pdf.  The workspace is a Flash component.  For ES4 there's an option to run the workspace in HTML5 which might be more productive long-term.

  • How to invoke JavaScript for Premiere Pro CC?

    Hi,
    I am new to Adobe CC products/scripting and I'm trying to control Adobe Premiere Pro CC from another desktop application. Using ExtendScript Toolkit, from its UI, I can invoke JavaScript commands or files.
    But I can't find any way for my desktop application to invoke JavaScript commands. I can't seem to find any command line tool for it (no documentation either and JavaScript doesn't seem to be officially supported). Any help regarding this would be greatly appreciated.
    I tried using the Socket object on a .jsx file to act as a server (to listen for commands from my desktop application) and placing it on the common startup script folder. But the start up script blocks the UI of the Premiere Pro application entirely (even if I use "$.sleep(milliseconds)" function in between  the "poll" function for acquiring a connection). This wouldn't work for my application as I can't block the UI.
    For After After Effects CC, I can use the "afterfx.exe" on Windows and AppleScript with "DoScript" command on Mac, to execute JavaScript expressions or files. But this doesn't seem to work with Premiere Pro or any Adobe CC products. For Photoshop, I can just open any .jsx file with Photoshop (for e.g. "Open With") and it runs the .jsx file. But this technique doesn't work with all the other Adobe CC products (even the ones which support JavaScript officially).
    According to Adobe Premiere Pro developer centre, there is no mention of any JavaScript support. But since the functionality does seem to be there (as discovered through ExtendScript Toolkit), I am hoping I can get away just by using JavaScript commands to control Premiere, as opposed to using the native SDK for Plugins. However, I really hope Adobe Premiere Pro folks are seeing this and they officially support JavaScript soon .
    Thanks for your help.

    Hi all,
    Any help? Seems that the general Adobe Premiere forum is a lot more active in terms of responses. That is why I originally kept in the general forum at first.
    Due to the lack of documentation, I ended up spending even more time just to figure out how to invoke Premiere Pro with a JavaScript file, from the command line. But no luck still . Any advice would be greatly appreciated.
    Thanks.

  • Issue with firePartialAction or how to include JavaScript Functions

    We are using the Client Action Type: firePartialAction on an element in a region of type: TABLE. When a user enters data in here and tabs away, the action fires and recalculates 2 other fields in the same region. On a object with a small number of rows, it seems to work fine. However, when you have a large number of rows (anything over 25), the page seems to hang for nearly a minute and then when it does come back, the values are sometimes not calculated properly.
    The only reason we are using firePartialAction is because the dev guide says that JavaScript is not supported by OAF. We would much rather use a client-side JavaScript function to do these simple arithemtic operations rather than do them on the server.
    My question is two-fold:
    1 - Has anyone experienced this issue and are there any other settings or coding tricks that we should be aware of.
    2 - Has anyone ever rendered a page with a custom JavaScript tag (or library)? Also, where would you add the code in JDeveloper to get a particular element to execute a particulate javascript function (ie: onchange=MCalc())?

    The firePartialAction event is not working for us, so we need to be able to at least try out javascript. We're rendering the page from an XML file, so it's not clear to us how we would even get a custom HTML tag to render into the page at all. Normally, I'd use some kind of HttpServletResponse.getWriter()...println method call to write html (as in a controller servlet), but how would you do that using the OAWebBean? I checked the OAFromattedTextBean, would that allow me to embed onchange into the field?

  • How to return javascript function value to jsp page

    Hi i want to retrieve values from javascript function to jsp page, how can i do that ? i am trying this but its not working
    <script language="javascript" type="text/javascript" src="/feedback/common/scripts/config.js"></script>
    <script language="javascript" type="text/javascript" src="/feedback/common/scripts/richtext.js"></script>
    <td>
    <jsp:param id="description" value= "<%=request.initRTE('', '')%>"/>
    </td>
    here this initRTE function is used for displaying rich text editor .....i want to retrieve back the contetnt written in this editor and save it to DB.
    Please help.
    Edited by: xtech on Apr 4, 2008 12:00 PM

    surely i will do that but my app is still not working.....
    here is my code
    </td>
    <td align="left">
    <script language="javascript" type="text/javascript" src="/feedback/common/scripts/config.js"></script>
    <script language="javascript" type="text/javascript" src="/feedback/common/scripts/richtext.js"></script>
    <h:inputHidden id="introtext" value= "<%=request.getParameterValues(description)%>">
    <script>
    initRTE('','');
    </script>
    </td>
    in java script function i am geeting the text content
    function initRTE(rtePreloadContent, rteCSS) {
    rtePreloadContent=document.getElementById('surveyinfo:introtext').value;
    startRTE(rtePreloadContent);
    menuBuilder();
    var description= document.getElementById(rteFormName).value;
    return description;
    basically i want to get the text written in text editor in jsp and want to send it to DB.(Here initRTE() function is calling rich text editor)
    i have downloaded this editor from this url
    http://freerichtexteditor.com/page/4.htm
    and trying to embed it in my app.

  • How to call javascript function in back bean of jsf

    hi,
    i am trying to call java script function in back bean but not done. Is there any code for call javascript function in bean file.

    Java runs at server side.
    JSF produces HTML output.
    Server sends HTML output to client.
    Java stops running.
    HTML runs at client side.
    JS starts to run in HTML.
    Clear? Java is a server side language. JS is a client side language. To run JS using JSF, simply print it out to the HTML so that it get invoked when the HTML runs.

  • How to use javascript functions in struts jsp page

    hi
    iam using struts jsp pages. here iam calling one javascript function. but iam not able to access the form in javascript.
    wat i have to give as form name to get the elements of the form.
    please reply me soon
    it is urgent
    vamsi

    your form has no name liek this one:
    <html:form action="/userRegistration.do" >so you cannot access the elements inside your form?
    accessing the elements inside the form will be like this:
    document.forms[0].propertyName.value;

  • How to reference JavaScript functions stored in a script object on a different page?

    Hi,
    I have a form which has 2 pages. I have a bunch of JavaScript functions under script objects on page 1. How can I access these functions from page 2?
    I tried the following but none of it work:
    form1.page2.#variables[0].testScript.doThisNow();
    form1.page2.variables[0].testScript.doThisNow();
    form1.page2.variables.testScript.doThisNow();
    Please help.

    Hi,
    Simplest way would be to drag the script object to be under the root node (form1). On both pages would would then be able to reference the function by:
    testScript.doThisNow();
    If you leave the script object under page1, then from page2, the following should work:
    page1.testScript.doThisNow();
    Hope that helps,
    Niall

  • How to put javascript function to AIR

    Hi,
    first I had Flex web application with onet javascript function in index.html file. Now I copied my code from web project mxml file to AIR project and it working properly. How can add this javascript function now. There is no html file now...
    EDIT: I am trying to do (in my AIR application) copy to clipboard using roll Over the button. Maybe I can do this in another way instead of javascript function (as i did in my web application).

    SET CLIPBOARD DATA:
    import flash.desktop.Clipboard;
    import flash.desktop.ClipboardFormats;
    var textToCopy:String = "Copy to clipboard.";
    Clipboard.generalClipboard.clear();
    Clipboard.generalClipboard.setData(ClipboardFormats.TEXT_FORMAT, textToCopy, false);
    GET CLIPBOARD DATA:
    import flash.desktop.Clipboard;
    import flash.desktop.ClipboardFormats;
    if(Clipboard.generalClipboard.hasFormat(ClipboardFormats.TEXT_FORMAT)){
        var text:String = Clipboard.generalClipboard.getData(ClipboardFormats.TEXT_FORMAT);
    (From LiveDocs: http://livedocs.adobe.com/flex/3/html/help.html?content=CopyAndPaste_1.html)

  • How to invoke a function with arguments in JSTL expressions

    Hi ,
    I want to know how to send arguments in the JSTL expression.
    I have a scenario like this
    for (int i=0; i<nicList.size(); i++)
                          NavigationItemControl nic = nicList.get(i);
                          ni = nic.getNavigationItem();
                          //scr
                          if (nic.isAvailable(Mask.SYSTEM))
                          { %>
                            <option value="<%=ni.getInternalHandle()%>"  <% if(pi.getNavigationItemHandle().equals(ni.getInternalHandle())) {%>selected<%}%> ><%=nic.getLabel()%></option>
                          <%
                        }   I was changed these code into JSTL ,the new one is
    <c:forEach var="nic" items="${nicList}">                                             
                                                 <c:set var="ni" value="${nic.navigationItem}"/>
                                                 <c:set var="nicAvailableMaskSystem" value="${*nic.available*}"/>
                                                 <c:set var="navigationItemHandle" value="true" />                                             
                                                      <c:if test="${nicAvailableMaskSystem}">
                                                           <option <c:if test="${pi.navigationItemHandle==ni.internalHandle}">  selected </c:if> value="${ni.internalHandle}" >
                                                                     ${nic.label}
                                                           </option>
                                                      </c:if>
                                            </c:forEach>in the above code I have problem with nic.isAvailable(Mask.SYSTEM),
    Can any one help me on this how can I invoke a function in JSTL with arguments.
    -Bhaskar

    JSTL can only handle getter/setter methods. You can't pass parameters to the methods.
    There are a couple of ways around this
    1 - set up "mask" as a seperate attribute of the NavigationItemControl bean.
    ie getMask() setMask()
    and then have your isAvailable method as
      public boolean isAvailable(){
        return internalIsAvailable(getMask());
      }Another solution is to define a static function and invoke it as a function.
    public static boolean navigationAvailable(NavigationItemControl, Mask);
    What does the isAvailable() method do? How complicated is it?
    Hope this helps,
    evnafets

Maybe you are looking for

  • ActiveX Xtra - projector doesn't terminate

    Hi all, Has anyone had problems with the projector not terminating correctly when working with the ActiveX Xtra? We are working on a Director application that uses some custom ActiveX controls. When the user quits the projector, the Process for the p

  • Need supplier name along with lot no.

    hello sir, i need to show supplier name along with lot no. here is my query-- SELECT DISTINCT(b.vc_field1),a.vc_lot_no,a.nu_balance_qty--, c.VC_SUPPLIER_NAME FROM STK_LOT_SUMMARY a, DT_RECEIPT b, makess.mst_supplier c, purchase.MST_SUP_ITEM d WHERE a

  • TOOL language

    Does the TOOL language have it's own impact analysis tool to search for changed code and it's impact?

  • Best option for wifi for 15 days visit in UK

    My wife and I are visiting the Uk for 15 days in sept/oct landing at Gatwick. We need wifi for 2 cellphones and 2 laptops. what would be our best option? I see on your Q&A that you need to unlock your phone for sim cards to work. How do we do that?

  • ST02 Swaps issue

    Hi Folks, As per daily monotioring in ST02 i am getting swaps.Can any body advice me .Tunning the buffers is one solutiion i know this.but i am facing the problem daily . My Environmet: SAP--ECC6 DB-ORACLE-10.2.0.2.0 OS- AIX5.