​Hi Sabra,

Where are you writing this ? There is a separate method to check
application creation status and it does it in a parallel thread. Anything
you have to do regarding application creation status, you have to write it
here. And obviously red highlighted line will overriding your code after
application creation completes.

check function pollEvents() in
jaggeryapps/appmgt/src/site/themes/default/templates/application/template.jag.



​​
>                 for(var i = 0; i < result.length; i++){
>                     var statusStyle;
>                     var event = result[i];
>                     if(event.name === "Status" && event.status ==
> "success"){
>                         setTimeout(redirectAppHome, 2000);
>                         function redirectAppHome(){
>                             
> window.location.replace("home.jag?applicationName="
> + $("#applicationName").val());
>                         }
>                     } else if(event.status == "failed"){
>                         var alert = "<p>Application creation failed.
> </p><p>Reason: " + event.description + "</p>";
>                         var retry_button = "<button type=\"button\"
> class=\"btn btn-primary\" data-dismiss=\"modal\"
> onclick=\"redirectAppListing();\">cancel</button>" +
>                                            "<button type=\"button\"
> class=\"btn btn-primary\" data-dismiss=\"modal\"
> onclick=\"retryAppCreation();\">Back to Application Creation</button>";
>                         setTimeout(showErrorPopup, 2000);
>                         function showErrorPopup(){
>                             $("#app-creation-model-body").html(alert);
>                             $("#app-creation-model-footer"
> ).html(retry_button);
>                         }
>                     }
>                 }​


On Thu, Apr 28, 2016 at 4:53 AM, Sabra Ossen <[email protected]> wrote:

> Hi All,
>
> I am using the setTimeout() method to delay redirection to the application
> homepage after creating a new application version. The code is as follows.
>
> $.ajax({
>         url: $(this).attr("action"),
>         type: 'POST',
>         data: formData,
>         async: true,
>         success: function (data) {
>             if(isNewVersion){
>                 jagg.message({content: "Displayed Message.", type: 'info'});
>                 setTimeout(redirectAppHome, 20000);
>                 function redirectAppHome(){
>                     window.location.replace("home.jag?applicationKey=" + 
> applicationHashId);
>                 }
>             }
>         },
>         cache: false,
>         contentType: false,
>         processData: false
>     });
>
>
> Note that this notification is given after the successful creation of an
> application. According to the code it should be redirected to the
> application home page after 20 seconds. I even tested out with giving a
> number such as 1000 seconds, but still within 2 or 3 seconds of displaying
> the message ("Displayed Message") the page gets redirected.
>
> Any help on understanding the issue is appreciated.
>
> Thanks and Regards.
> --
> *Sabra Ossen*
> *Software Engineer*
> Email: [email protected]
> Mobile: +94 767 837356
>
> _______________________________________________
> Dev mailing list
> [email protected]
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
*Kasun de Silva*
Software Engineer | *WSO2 Inc.*; http://wso2.com
lean.enterprise.middleware

email   : [email protected]
mobile : +94 77 794 4260
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to