Show message before redirect

Hi Guys,
I am facing a problem that I do not know how to solve.
I have a method that adds a message to FacesMessage and redirect to another window after saving the record.
The problem is that the redirect comes before showing the af:message.
I think that is because the partialTriggers of the af:messages is the button that is calling the method that adds a message to FacesMessage.
Is there any way to make like a waiting action of clicking the ok button of af:messages in order to redirect?
Thanks a lot.
Best Regards,
Ricardo Morais
That is my code:
public String efetuarGravacao() {
try {
PontoDeVendaFacade pontoDeVendaFacade = ServiceLocator.getInstance().getEJB(PontoDeVendaFacade.class);
AssociarEstruturaComercialBean estruturaComercial = (AssociarEstruturaComercialBean)ADFContext.getCurrent().getViewScope().get("estruturaComercial");
pontoDeVenda.setUnidadesDeAtendimento((estruturaComercial.getItensAssociados()));
montarPontoDeVenda(pontoDeVenda, usuariosGerentes,
usuariosCoordenadoresDeExibicao,
usuariosCoordenadoresDeAdministracaoDeVendas);
if (renderPainelInclusao) {
if (pontoDeVendaFacade.inserirPontoDeVenda(pontoDeVenda) > 0) {
adicionarMensagemDeConfirmacao(WebResourcesKeys.MSG_KEY_PONTO_DE_VENDA_INCLUIDO, pontoDeVenda.getMnemonico(), pontoDeVenda.getNome());
} else if (renderPainelAlteracao) {
if (pontoDeVendaFacade.atualizarPontoDeVenda(pontoDeVenda) > 0) {
adicionarMensagemDeConfirmacao(WebResourcesKeys.MSG_KEY_PONTO_DE_VENDA_ALTERADO, pontoDeVenda.getMnemonico(), pontoDeVenda.getNome());
return WebResourcesKeys.OUTCOME_PONTO_DE_VENDA_CONSULTAR;
} catch (BusinessException be) {
logger.error(be.getMessage(), be);
handleBusinessException(be);
} catch (Exception e) {
logger.error(e.getMessage(), e);
handleException(e);
return null;
protected void adicionarMensagemDeConfirmacao(String key, Object... args) {
FacesMessage facesMessage = FacesMessageUtils.getConfirmationMessage(null, getKeyValue(key, args));
FacesContext.getCurrentInstance().addMessage(null, facesMessage);
}

Not sure of wait but here is what you can do as alternative:
On ActionListener of your button.. add a bean method to launch popup with dialog having confirmation message.
Override DialogListener for dialog .. and do redirect
refer:
How to invoke task flow navigation after closing inline popup?
Amit

Similar Messages

  • Show Message Before Send?

    Hi All,
    I think this is my last question (At least I hope so)...
    I am using the Groupwise objects to generate an EMail from my application
    which works fine, however I would like to show the EMail to the user
    before it is sent.
    So I programmatically create the EMail then I would like to open the
    EMail in the Groupwise interface, allow the user to edit it, and when
    they are happy click send.
    Can anyone advise me on how to do this please?
    Thanks,
    Dhugal.

    No you'd have to keep using token api to fill it in (itemsettext and such)
    There's no object connection between the two.
    "Andrew Maxin" <[email protected]> wrote in message
    news:uamTd.3809$[email protected]..
    > Dhugal
    >
    > The way I did this was by using the "Commander"
    >
    > Public g_c3p0Commander as object
    > Set g_c3PoCommander = CreateObject("GroupWiseCommander")
    >
    > g_c3PoCommander.Execute "NewMail()", strRet
    >
    >
    > From here, I believe you can refer to the object via the regular API. What
    > GW does is call the currently open message "X00". Once you have created
    > the message with the token commander, I believe you can fill in the object
    > (haven't tried though). You can get a list of tokens via Novell's
    > developer site.
    >
    > Regards,
    >
    > Andrew
    >
    >
    >
    > <[email protected]> wrote in message
    > news:NNlTd.3764$[email protected]..
    >> Hi Tommy,
    >>
    >> Can you elaborate?
    >>
    >> Cheers,
    >>
    >> Dhugal.
    >>> Use tokens.
    >>> --
    >>> Best Regards
    >>>
    >>> Tommy Mikkelsen
    >>>
    >>> IT Quality A/S
    >>> Denmark
    >>>
    >>> Novell Support Forums SYSOP
    >>>
    >>> Please Report back any success or failure, That way we all learn
    >>>
    >>> Sorry, but no support through email
    >>>
    >>> "I hate bugs".......Tommy Lee Jones, MIB
    >>>
    >>>
    >>> [email protected] wrote:
    >>>
    >>> >
    >>> > Hi All,
    >>> >
    >>> > I think this is my last question (At least I hope so)...
    >>> >
    >>> > I am using the Groupwise objects to generate an EMail from my
    >>> > application which works fine, however I would like to show the EMail
    >>> > to the user before it is sent.
    >>> >
    >>> > So I programmatically create the EMail then I would like to open the
    >>> > EMail in the Groupwise interface, allow the user to edit it, and when
    >>> > they are happy click send.
    >>> >
    >>> > Can anyone advise me on how to do this please?
    >>> >
    >>> > Thanks,
    >>> >
    >>> > Dhugal.
    >>
    >
    >

  • Creating an intro page/banner message before getting to my homepage

    I want to create intro page (or banner message) that stays on screen for a few seconds before we get to my homepage. It would be great if this page didn't show in the menu bar too. I'd be really grateful if someone could tell me how to do this (without having to use flash or other software).

    Welcome to the Apple Discussions. That can be done. First you need to set up the first page in the web site and add the banner to it. Using the Inspector/Page/Page pane remove the page from the navbar.
    After publishing the site you will need to retrieve that page's html file and add the following code to the file using a text editor like TextWrangler:
    <meta http-equiv="REFRESH" content="10;url=URL TO THE PAGE IN THE SITE YOU WANT TO REDIRECT TO"></head>
    Put this code directly before the </head> tag as shown above. 10 is the number of seconds to delay before redirecting to the next page. You'll need to experiment to see how many seconds are required to load and play your banner before redirecting. You should also provide a text hyperlink for those who do not want to wait for the banner to play fully.
    As for the banner you could create a slideshow in iPhoto (using the 16:9 format might look better than the standard 4:3 but you would have to try both and see which works better), export using the File->Export->Slideshow method and then select Medium or large. When you drag the QT file onto the iWeb page select it, go to the Inspector/Quicktime pane and check autoplay.
    OT

  • Simple problem with popup message before adding document on system form

    Hi all,
    We have an AddOn that validates price lines on system Sales Order form matrix, so that if prices fall below a certain value, a popup is show to ask to continue or not, when user presses ADD button.
    The problem is that if he chooses yes (to continue), the Sales Order is not added since the button ADD keeps being selected ....
    Here is my code:
            [B1Listener(BoEventTypes.et_CLICK, true)]
            public virtual bool OnBeforeClick(ItemEvent pVal)
                int iResult = B1Connections.theAppl.MessageBox("Price lines fall bellow minimum! Continue?", 1, "NO", "YES", "");
                if (iResult == 1) // NO
                    // Show error
                    B1Connections.theAppl.StatusBar.SetText("OK", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error);
                    return false;
                // YES: Continue to add Sales Order
                return true;
    The problem is somehow related with the popup message being shown: if user says YES to continue, the system form does not continue with the standard process of adding the Sales Order (when I move the cursor above the ADD button is shows it already pressed...).
    Do I have to do anything more to force the process to continue, when the user says YES?
    Regards,
    Manuel Dias

    Thtas known problem. The solution for this is declare global variable as boolean, when user selects Yes, then set this variable to true and emulate click to add button again where before the message box check if its varaible sets to true - in this case dont show message box, only set variable to false.
    The concept of code will be
    dim continue as boolean = false
    in item event
    if continue = false then
        x = messagebox...
      if x = 1 then
        continue = true
         items.item("1").click
    end if
    else
    continue = false
    end if

  • How to display a confirmation message before deletion

    Hi,
    I have an application and I want to display a confirmation message before people delete a record.
    The button on page 42 is number 90     "Supprimer cette fiche". It is a Submit as "DELETE_ALL". I have seen that the delete buttons are redirections to the url javascript:confirmDelete(htmldb_delete_message,'DELETE');, but I cannot use this as my button is not a redirection, but a submit.
    http://apex.oracle.com/pls/otn/f?p=4550
    Workaspace : ESPACE2008
    User : guest
    password : acdc2009
    Name of application is Activites
    Thank you for your kind answers.
    Christian

    Hi Christian.
    You can use the same logic for your own processing logic.
    the syntax is...
    javascript:confirmDelete(htmldb_delete_message,'YOUR_PROCESS_NAME');Replace 'YOUR_PROCESS_NAME' with the name of your page process that handles the bulk delete. Don't for get the single-quotes either side of your process name.
    Hope this helps.
    Simon

  • Getting Accessiblity Error Message before Recording Software Simulation...

    In Captivate 7, I go to start a brand new software simulation (chrome screen) in OSX and I get the following error message:
    Before recording application applications, select 'Enable Access for Assistive devices' in 'System Preferences' > 'Accessibility'.
    The pics below show the red screen capture box and the error I get when I try to capture when trying to capture the screen. Also included is a pic showing accessibility is enabled.
    I have no idea where this is coming from.

    ...and here's the answer:
    http://captivatecrazy.blogspot.com/2014/01/record-new-software-simulation-in-adobe.html

  • My dreamweaver cs5.5  on window 7started working stop  showing message  A problem caused programe to

    my dreamweaver cs5.5  on window 7started working stop  showing message  A problem caused programe to stop work correctly       

    What's the error message you received?
    What do your logs tell you?
    What were you doing just before you got the error message?
    Nancy O.

  • Servlet - show message while getting data

    Hello,
    I have a servlet that is getting some data in form of an String from another server. This is taking some time, so I would like to show a "Please wait" message in between.
    My problem is, that when I flush the message with my servlet and flush then the result of the query from the other server, the message is still visible.
    So ist there a way to overwrite the first flushed output? Or some other way to show some short message before a result page?
    Below is my code so far. I curently flush only the result without the message.
    Thanks in advance!
    package de.gfz.userinterface.httpclient;
    import java.io.BufferedReader;
    import java.io.InputStreamReader;
    import java.io.PrintWriter;
    import java.util.ArrayList;
    import java.util.Enumeration;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import org.apache.commons.httpclient.HttpClient;
    import org.apache.commons.httpclient.NameValuePair;
    import org.apache.commons.httpclient.methods.PostMethod;
    public class ClientPostServlet extends HttpServlet
    public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, java.io.IOException
        HttpClient httpClient = new HttpClient();
        //Url f�r den PostRequest setzen (kommt aus LoginWorkflow.xml Datei bei SCIENTIST)
        String url = String.valueOf(request.getAttribute("viewUri"));
        PostMethod postMethod = new PostMethod
             url
        //Attribute aus dem Request rausholen und als NameValuePair f�r den sp�teren Post Request setzen
        ArrayList<NameValuePair> postData = new ArrayList<NameValuePair>();
        Enumeration requestAttributeNames = request.getAttributeNames();
        while (requestAttributeNames.hasMoreElements())
             String requestAttributeName = (String) requestAttributeNames.nextElement();
             String attribut = String.valueOf(request.getAttribute(requestAttributeName));
             postData.add(new NameValuePair(requestAttributeName, attribut));
             //Attribute sicherheitshalber aus dem Request entfernen
             request.removeAttribute(requestAttributeName);
        //ArrayList in Array �bertragen
        NameValuePair[] postDataArray = new NameValuePair[postData.size()];
        for (int i = 0; i < postDataArray.length; i++)
              postDataArray[i] = postData.get(i);
         //the 2.0 beta1 version has a PostMethod.setRequestBody(NameValuePair[])
         //method, as addParameters is deprecated
        //Attribute in den Post Request setzen
        postMethod.setRequestBody(postDataArray);
        //Post Request senden
        httpClient.executeMethod(postMethod);
        //Ergebnis verarbeiten
        BufferedReader in = new BufferedReader(new InputStreamReader(postMethod.getResponseBodyAsStream()));
        String zeile = "";
        StringBuffer ergebnis = new StringBuffer();
        while ((zeile = in.readLine()) != null)
             ergebnis.append(zeile);
         //release the connection used by the method
        postMethod.releaseConnection();
        //String Buffer in String umwandeln
        String ergebnisString = ergebnis.toString();
        //css-Datei Position ver�ndern
        ergebnisString = ergebnisString.replaceFirst("AnzeigeModell/css/layout.css", "../css/layout.css");
        //display the response to the POST method
        response.setContentType("text/html");
        PrintWriter out = response.getWriter();
        out.print(ergebnisString);
        out.flush();
      public void doGet(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, java.io.IOException {
        doPost(request,response);
      }

    Hi,
    Please do the consistency check on target ODS by using the transaction RSRV.
    RSRV->Tests in Transaction RSRV ->All Elementary Tests ->ODS Objects -> double click on "Foreign Key Relationship of Reporting-Relevant ODS Object and SID Table Characteristics" and also on "Check the Status of the Generated Program of a Data Store Object ".
    These two will be shifted to the right hand side.
    Then expand the recently shifted checks and they will ask for ODS technical names. Provide the same and click on transfer. After giving in both, click execute. After successfull execution, try to load the data again. If this check fails, there would be a tab on the screen to correct the error "Correct Error".
    Click on the same and it will correct the error and then load the data.
    Hope this solves your problem...

  • I am not able to send messages to multiple person from my iphone 5s after updating to ios 8.1.2. It shows message not delievered

    I am not able to send messages to multiple person from my iphone 5s after updating to ios 8.1.2. It shows message not delievered

    Hi waqaskhan91,
    Thank you for visiting Apple Support Communities.
    If you're not able to send text or iMessages to certain contacts after updating your iPhone, start with the troubleshooting tips in this article:
    iOS: Troubleshooting Messages - Apple Support
    If you only see this behavior with a few contacts, you may want to try these steps first:
    If the issue occurs with a specific contact or contacts, back up or forward important messages and delete your current messaging threads with the contact. Create a new message to the contact and try again.
    If the issue occurs with a specific contact or contacts, delete and recreate the contact from the Contacts app. Send a new message to the contact.
    Best Regards,
    Jeremy

  • How to show messages in a little popup ?

    Hello,
    Im faced with an issue when I want to show messages in my little popup.
    The calling component is BT111H_OPPT.
    Whenever I want to show the message in my popup that the mandatory fields are not filled with information the systems only shows them on the view of BT111H_OPPT when I closed my popup.
    Ive implemented an own check method for that issue. See the following Code:
    IF me->check_mandatory_fields( 'CREATE' ) = abap_true.
        lr_window ?= me->view_manager->get_window_controller( ).
        lr_window->call_outbound_plug( 'CREATE' ).              "#EC NOTEXT
      ELSE.
        DATA: lr_service TYPE REF TO cl_bsp_wd_message_service.
        lr_service = me->view_manager->get_message_service( ).
    +   TESTED THAT CODE FIRST TIME, BUT NOTHING APPEARS ANYWHERE!!!!+*
    *    CALL METHOD me->messages->add_message
    *      EXPORTING
    *        condition = co_mandatory_field_empty
    *        message   = 'Test'
    **        otr_alias =
    *        severity  = cl_bsp_messages=>co_severity_error
    **        dummy     = me->component_id
    **        p1        =
    **        p2        =
    **        p3        =
    **        p4        =
    + SO I TRIED THAT ONE. NOW, THE MESSAGE APPEARS IN THE CALLING COMPONENT!+* 
    TRY.
            lr_service->add_message(
            iv_msg_type = 'W'
            iv_msg_id = 'ZICRM'
            iv_msg_number = '050'
            iv_msg_v1 = 'lv_text'
          CATCH cx_bsp_wd_dupl_mess_subscr.
        ENDTRY.
      ENDIF.
    THANK you for an answer...
    Regards,
    marcus

    Hi Marcus,
    try to use the following method as you create the popup in the calling view controller:
    <your popup ref>->set_display_mode( iv_mode = if_bsp_wd_popup=>c_display_mode_surrounded ).
    Best Regards,
    Michael
    Edited by: Michael Neumann on Feb 23, 2011 5:50 PM

  • In MD05 system show message "The MRP element no longer exist".

    Hi Guru,
    Need some help .
    In MD04 transaction contain Purchase order, when I double click purchase order,It will get open .  But when I open same purchase order in MD05 system show message u201CThe MRP element no longer exist".
    Please help me , if any know the solution or any input. Open purchase order in system.
    Regards
    PNU

    PNU,
    I don't believe this is the same Purchase order.
    Review closely order number/item number/schedule number.  I believe you will see that the old entry (MD05) no longer exists, and has been replaced with a similar item.
    Best Regards,
    DB49

  • Junk Mail folder refusing to show messages from a particular account

    So, I have a weird problem with Leopard Mail (3.2) - when I click on the junk mail folder, 99% of the time it won't show messages from my Yahoo POP account. The only way I can get messages from this account to show is by expanding the junk mail folder, clicking on a different sub-account, then clicking on my Yahoo account. This will show the messages in its junk folder, and if I click on the combined junk folder they will show up inside it. This will work until I click away from junk - say, to my inbox - at which point the procedure will need to be repeated if I wish to see my Yahoo junk mail.
    I've only noticed it very recently, but I'm not sure how long it's been going on. Unbelievably annoying. I deleted the junk folder, no luck. I toggled the account off/on - this seemed to work for a day, but the behaviour's back and I can't make this work again. I rebuilt the mailbox... Even deleted and added the account again, but it still did the same thing.
    Has anyone else experienced this? Is it just a bug in Leopard Mail? Something specifically with POP accounts, perhaps? (My 5 IMAP accounts seem fine). If anyone has any further suggestions I'd be really, really grateful.

    Ok, so, something in way of an update: Normal behaviour appears to be restored after Mail detects a piece of junk mail and puts it in the junk folder for this account (manual marking of junk doesn't do the trick). Then it works ok until I quit Mail.

  • Itunes will not launch, it shows  message of "itunes library .itl" can not be read because it was created by a newer version of itunes. I tried opene it in save mode but I had the same problem.

    Itunes will not launch, it shows  message of "itunes library .itl" can not be read because it was created by a newer version of itunes. I tried opene it in save mode but I had the same problem.

    If you still have an issue you may have to see about using the iTunes version (application) included with Snow Leopard 10.6 from the installer or an another one if available online, and see if that will install.
    Sometimes you may have uninstall the bits left in your system by the earlier (or later) iTunes installers; as they all leave a trace and these can stop a different version of iTunes from being installed.
    Not sure if the following site/link will tell the method...
    •Apple - Support - iTunes - install & update:
    http://www.apple.com/support/itunes/install/
    •Troubleshooting iTunes installation on Mac OS X:
    http://support.apple.com/kb/HT2311
    Good luck & happy computing!
    ps: i see you resolved this issue. it's magic!

  • My iPad shows message that it needs to be backed up, but when connected to iTunes for backup it states all backed up. Cannot remove message by clicking ok.  Therefore iPad is locked up.  What can I do?

    My iPad shows message needs to be backed up.  When connected to iTunes it shows all backed up.  Cannot get rid of message by clicking ok.  IPad  therefore is frozen.  What to do?

    Welcome to the Apple Community.
    You might try a forced shutdown to begin with, hold down the top and home buttons together until the device shuts down, then restart it.

  • I get a message "before viewing pdf documents i must launch adobe reader and accept end user licence

    I get a message "before viewing documents in this browser you must launch adobe reader and accept the end user licence agreement then quit and relaunch the browser". How do I do this?

    Just launch Adobe Reader. Assuming you are on a Mac, all apps are launched from Applications.

Maybe you are looking for