I have a process which takes a while to complete and I want to add a progress bar to the page to show the user that something is happening.
Has anybody already done this? and if so how did you go about it?
Many Thanks
Progress bar
Moderators: Jon, Steve, Ian, Dave
-
- Ebase User
- Posts: 53
- Joined: Thu Sep 13, 2007 9:02 am
- Contact:
I've achieved something similar before using JSP's as follows :-
Create a JSP file as ufs/shared/jsps/Form_Submitted.jsp with the following content :-
Create a second JSP file in ufs/shared/jsps/Form_Submitted_Progress.jsp with the following content :-
On your Form :-
1) create a field EFORM_SUBMITTED with a Default Value of 'N'
2) set the TOP_JSP on the form to shared/jsps/Form_Submitted.jsp
3) On your 'Submit' button script add set EFORM_SUBMITTED = 'Y';
Basically the JSP in the IFrame will refresh every 'x' seconds until the EFORM_SUBMITTED field has a value of 'Y', then change message and colour.
Hope this helps,
Mark
Create a JSP file as ufs/shared/jsps/Form_Submitted.jsp with the following content :-
Code: Select all
<div align="left" valign="top">
<iframe name="Progress_Bar" width="100%" height="40" scrolling="no" frameborder="1" src="shared/jsps/Form_Submitted_Progress.jsp">
</iframe>
</div>
Code: Select all
<%@ page language="java" import="com.ebasetech.ufs.kernel.*, java.util.*, java.text.*; " %>
<% UFSFormInterface form = (UFSFormInterface) session.getAttribute("FormInterface");
String eform_submitted = form.getFieldValue( "EFORM_SUBMITTED" );
String refresh_period = "2";
if(eform_submitted.equals("Y")) {
refresh_period = "5";
}
%>
<html>
<head>
<title>Form_Submitted_Tracker.jsp</title>
<META HTTP-EQUIV="Content-Type" content="text/html; charset=ISO-8859-1">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="0">
<META HTTP-EQUIV="REFRESH" CONTENT="<%= refresh_period %>">
<style type='text/css'>
.submitted {font-family:"Verdana","Arial","Helvetica";font-size:0.8em;color:red;background-color:#ffffff;text-align:left;font-weight:bold;font-style:normal;}
.not_submitted {font-family:"Verdana","Arial","Helvetica";font-size:0.8em;color:green;background-color:#ffffff;text-align:left;font-weight:bold;font-style:normal;}
</style>
</head>
<body>
<div <%
String progress_message = "null";
if(eform_submitted.equals("Y")) {
progress_message = " FORM SUBMITTED - PLEASE WAIT "; %>
class="submitted"
<% } else {
progress_message = " FORM NOT SUBMITTED"; %>
class="not_submitted"
<% } %> align="center" valign="top">
<%
Date now = new Date();
out.println(DateFormat.getTimeInstance().format(now));
%>-<%= progress_message %>
</div>
</body>
</html>
1) create a field EFORM_SUBMITTED with a Default Value of 'N'
2) set the TOP_JSP on the form to shared/jsps/Form_Submitted.jsp
3) On your 'Submit' button script add set EFORM_SUBMITTED = 'Y';
Basically the JSP in the IFrame will refresh every 'x' seconds until the EFORM_SUBMITTED field has a value of 'Y', then change message and colour.
Hope this helps,
Mark
0 x
Who is online
Users browsing this forum: No registered users and 17 guests