Skip to end of metadata
Go to start of metadata

Hi All,

We are new to this Stripes framework. We are having a requirement to show progress bar on submit of a form. Actually on click of submit button, the action will take some time untill the next screen loads. So in that mean time we need to disable the UI and show the Progress bar so that user will not be able to edit anything untill the process completes.

Here is the code that we are using.


routesCreate.jsp:

<stripes:form beanclass="com.verizon.irr.stripes.actions.RoutesActionBean" focus="" >

           <%--  Some form Inputs  --%>

           <stripes:submit name="addRoute" value="Add"/>

</stripes:form>


RoutesActionBean.java:

public class RoutesActionBean extends ActionBean{

   private RouteService objRouteService = RouteServiceImpl.instance();
   private Resolution nextScreen = new ForwardResolution("/jsp/home.jsp");

   public Resolution addRoute(){
      try{
         logger.debug("addRoute [BEGIN]");
         objRouteService.addRoute(route);
         nextScreen = new ForwardResolution("/jsp/routes.jsp");
      }

      catch(Exception e){

         getContext().getValidationErrors().add("route.prefix", new SimpleError(""+e.getCause()));

         nextScreen = new ForwardResolution("/jsp/routesCreate.jsp");
      }
      logger.debug("addRoute) [END]");
      return nextScreen;
   }
}


The addRoute() operation in backend will take 30 - 40 seconds depends upon the inputs provided by user. So we need to show how much processing completed to the user in progress bar. Please guide us.


--Thanks in advance


  • No labels