Progress Bar using HTP.DIV -Help please

Hi,
Below is my Code to get a progress bar on the screen writen as a package
PROCEDURE lp_progress_bar IS
BEGIN
htp.htmlOpen;
htp.headOpen;
-- Create Link to Style Sheet
htp.linkrel(crel => 'stylesheet',
curl => pk_constant.PATH_STATIC||'internal_body.css',
ctitle => 'text/css');
--Include the Javascript to Call the Progress Bar
lp_js_copy();
htp.headClose;
htp.bodyOpen;
--Define Attributes for the DIV tags to print the Progress bar
htp.div(cattributes => 'id="bar"');
htp.div(cattributes => 'id="progress"');
htp.bodyClose;
htp.htmlClose();
END lp_progress_bar;
and the JS for the progress bar
NL CONSTANT VARCHAR2(2) := CHR(13) || CHR(10);
PROCEDURE lp_js_copy
IS
vBodyCode VARCHAR2(500);
BEGIN
pk_js.js
'var time = 10000;'
|| NL ||'var aCopy = 5;'
|| NL ||'var aCopyDone = 1;'
|| NL ||'function progress() {'
|| NL ||'parent.fr_buttons.btnCancel.disabled= true;'
|| NL ||'var bar = document.getElementById("bar");'
|| NL || 'alert(bar);'
|| NL ||'var aStep = (bar.offsetWidth -2) /aCopy;'
|| NL ||'var x = Math.round( aStep *aCopyDone); '
|| NL ||'var progress = document.getElementById("progress");'
|| NL ||'progress.style.width = x +"px";'
|| NL ||'aCopyDone++;'
|| NL ||'if( aCopyDone > aCopy) redir();'
|| NL ||'else setTimeout( "progress();", time /aCopy);'
|| NL ||'}'
|| NL
|| NL ||'function redir() {'
|| NL ||'alert("Copy Successfully Completed");'
|| NL ||'parent.fr_buttons.btnCancel.disabled= false;'
|| NL ||'parent.fr_buttons.btnSave.disabled=true;'
|| NL ||'}'
END lp_js_copy;
The stlye for bar and progress aere defined in the stylesheet internal_body.css as
#bar
MARGIN: 0 auto;
WIDTH: 250px;
TEXT-ALIGN: left;
BORDER: 1px solid black;
#progress {
WIDTH: 0;
BACKGROUND: darkblue;
but I am not getting anything on the screen. What should I do to get it pop up on the existing screen.
I had posted it on a the database thread too. But I guess it was th wrong category.Hence posting it new here.
Please Help.
Message was edited by:
ora newbie

Hi Dwijesh,
U can use a OCX control. Make a OCX control and insert microsoft progress bar object into it. Then you can write codes into it accordingly to incerease the bar.

Similar Messages

  • Progress bar using htp.DIV

    Hi,
    Below is my Code to get a progress bar on the screen.
    PROCEDURE lp_progress_bar IS
    BEGIN
    htp.htmlOpen;
    htp.headOpen;
    -- Create Link to Style Sheet
    htp.linkrel(crel => 'stylesheet',
    curl => pk_constant.PATH_STATIC||'internal_body.css',
    ctitle => 'text/css');
    --Include the Javascript to Call the Progress Bar
    lp_js_copy();
    htp.headClose;
    htp.bodyOpen;
    --Define Attributes for the DIV tags to print the Progress bar
    htp.div(cattributes => 'id="bar"');
    htp.div(cattributes => 'id="progress"');
    htp.bodyClose;
    htp.htmlClose();
    END lp_progress_bar;
    and the JS for the progress bar
    PROCEDURE lp_js_copy
    IS
    vBodyCode VARCHAR2(500);
    BEGIN
    pk_js.js
    'var time = 10000;'
    || NL ||'var aCopy = 5;'
    || NL ||'var aCopyDone = 1;'
    || NL ||'function progress() {'
    || NL ||'parent.fr_buttons.btnCancel.disabled= true;'
    || NL ||'var bar = document.getElementById("bar");'
    || NL || 'alert(bar);'
    || NL ||'var aStep = (bar.offsetWidth -2) /aCopy;'
    || NL ||'var x = Math.round( aStep *aCopyDone); '
    || NL ||'var progress = document.getElementById("progress");'
    || NL ||'progress.style.width = x +"px";'
    || NL ||'aCopyDone++;'
    || NL ||'if( aCopyDone > aCopy) redir();'
    || NL ||'else setTimeout( "progress();", time /aCopy);'
    || NL ||'}'
    || NL
    || NL ||'function redir() {'
    || NL ||'alert("Copy Successfully Completed");'
    || NL ||'parent.fr_buttons.btnCancel.disabled= false;'
    || NL ||'parent.fr_buttons.btnSave.disabled=true;'
    || NL ||'}'
    END lp_js_copy;
    The stlye for bar and progress aere defined in the stysheet internal_body.css as
    #bar
    MARGIN: 0 auto;
    WIDTH: 250px;
    TEXT-ALIGN: left;
    BORDER: 1px solid black;
    #progress {
    WIDTH: 0;
    BACKGROUND: darkblue;
    but I am not getting anything on the screen. What should I do to get it pop up on the existing screen.
    Please Help.

    Hi Dwijesh,
    U can use a OCX control. Make a OCX control and insert microsoft progress bar object into it. Then you can write codes into it accordingly to incerease the bar.

  • I want to use my maps... But it says that it cannot determined my location...how can I use it? Help please...thanks

    I want to use my maps... But it says that it cannot determined my location...how can I use it? Help please...thanks

    Do you have location services turned on? See Settings > Privacy > Location Services
    In any event Maps can be used to obtain directions by supplying the start and end locations after touching "Directions" in the upper left corner.

  • Recent Safari problem - direction arrows in bookmark bar have disappeared. Help please. I am on a MacBook (white) running OS 10.6.9 with Safari 5.1.10

    Recent Safari problem - direction arrows in bookmark bar have disappeared. Help please. I am on a MacBook (white) running OS 10.6.9 with Safari 5.1.10

    cd,
    From the Safari Menu Bar, choose View>Show Toolbar:

  • I reset the ipad. hoping it would help. but still it needs password for activation. the owner already forgot password for icloud as well as password of the email since it was not used since 2011. help please.

    I reset the ipad. hoping it would help. but still it needs password for activation. the owner already forgot password for icloud as well as password of the email since it was not used since 2011. help please.

    Your sister can go to https://iforgot.apple.com/ and see if she can recover her password.
    There is nothing anybody else can do.

  • Creating a progress bar using BufferReader()

    Hi,
    I was wondering if it was possible to count the number of bytes that BufferReader() has read. I doing that because I need it to calculate progress (to have a progress bar). This is what I'm doing.
    private void createOutputFile() {
            String line;
            String [] temp = new String [21];
            try {
                FileReader fr = new FileReader(new File(openTF.getText()));
                FileWriter fw = new FileWriter(new File(saveTF.getText()));
                BufferedReader br = new BufferedReader(fr);
                BufferedWriter bw = new BufferedWriter(fw);
                while ((line = br.readLine()) != null) {
                    temp = line.split("\\t");              
                    if (temp.length > 18 && temp[18].length() > 0){
                        fw.write(temp[0] + "\t" + temp[18] + "\n");
                bw.close(); fw.close();
                br.close(); fr.close();
            catch (FileNotFoundException fN) {
                fN.printStackTrace();
            catch (IOException e) {
                System.out.println(e);
        }I know that I can do it using BufferedInputStream but due to the fact that I'm parsing each line of the file, I don't think I can do that because the length of each line is different (am I right?)
    Thanks.
    Desmond

    the length of each line is different (am I right?)Probably. Just get the length of the each line your read and keep a running total.

  • Aligning social media icons on a page (Was:Need Div help, please.)

    Hello,
    I'm trying to figure out the best way to get the social media icons on the right side in a row, side by side, no space between.
    Can I use a div?
    Problem is now is that depending on monitor/screen size, the spacing changes.
    Again, I want to have them all together with no spacing, centered on the right at all times.
    http://www.saintleo.edu/SocialMediaSliders/Kathryn-JK.html
    Any help would be greatly appreciated.
    Kind regards,
    JK

    Yes, I took a look at the website. I saw that they were sliders.
    It's hard for me to answer if putting an unordered list will hurt your code. The code that you have is not indented so it's extremely hard to read.
    I would try putting the image in the <li> first. Make a backup of the page if you're nervous, and work on the backup. So your current content is live, and your backup can be toyed with until you have it right.
    Also:
    If using an unordered list scares you, there is an alternative which may work. I will use #twitter_right img as an example.
    You are using absolute positioning. There is no reason to do this and I'm under the impression that absolute positioning should be avoided.
    Your current CSS Rules for this are as follows:
    #twitter_right img {
         left: -52px;
         position:absolute;
         top: 45px;
    Instead, it should be:
    #twitter_right img {
         float:right;
         margin-top:45px;
    Now, if you wanted to get fancy you could do this: (The CSS Identifiers are not accurate... just showing you an exmple)
    #twitter_right img, #facebook_right img, #youtube_right img {
         float:right;
         margin-bottom:45px;  -- this is could also be padding. Set this value to the height of the image if you don't want spacing.
    That way, when the slider moves out, the icon will move with it. Additionally, the spacing would be equal across the board.

  • Something is using up all my data even when I'm not using apps. Help please!

    Something is using up my data even when I'm not using any apps. Please help!

    I turned off my mobile data and made no phonecalls or sent no text messages but 30 minutes later my phone credit was a euro less even though I had just topped up. I have had problems with my mobile data using up all of my network provider allowance and then the remaining balance on my phone. And this is even though I had not been using it much.

  • My mom accidentally synced a bunch of music to her ipod touch and now she can't delete them even using itunes.  help please?

    A few days ago, my mom synced her ipod to her itunes and a bunch of the music files i have got synced to her ipod touch.  How do i delete them.  They show up on the ipod, but not in the manually added songs list.  I have tried many things short of downloading ios 5. I open the ipod,  clicked manually music and videos... click music... but i dont see the unwanted songs to delete.  I see the songs she did want.  Help please.
    Message was edited by: gcmusicluver

    - If the iPod has iOS 5 then she swipe the song left or right and a tap the Delete button.
    - If she does not then she will have to connect to computer and unsync them.

  • HT201493 I can't sign in to find my friends , it says I have no Internet connection but I do , the app used to work , help please

    I can't sign in to find my friends , it says I have no Internet connection but I do , the app used to work , help please

    when you say there is an Internet connection have you used safari?  Or does the phone just display a data connection (i.e. 3g/4g)?  You could try a couple of things if it is the latter 1. turn off cellular data than turn it back on.  2. turn on airplane mode and turn it back off.  I type these assuming you've tried resetting network connections.

  • My music is gone, but the GBs are still used...help please!

    Hello...ive searched for the answer without any luck. Please help me, i've got a 60GB 4G Photo iPod.
    Yesterday i selected a song to play, and it froze. I reset (select+menu) went to the same song...same results. Reset again, but this time all the music was gone! I've reset it again since, but my music (and personalized settings) still have not returned.
    I've used iTunes hoping that the reconnect would help, but iTunes requested that i name my ipod, starting all over! My 50GB of music is still being reported leaving me under 10GB of free space.
    I've run the iPod update, still no luck.
    Is there a solution that will allow me to get my stuff back? Any help is greatly appreciated.
    It was purchased in Sept 05, still has some time left under warranty.
    Richard S. Chomyszak
    [email protected]

    No.
    But you can do it this way.
    iTunes prefs -> Advanced. Uncheck Copy files to itunes music folder when adding to library.
    Insert the DVD and in iTunes Add folder to library, select the DVD.
    Leave the DVD in, connect the iPod and update it. Make sure it is on Manual update.
    After you remove the DVD and restart iTunes, there will be an exclamation mark in front of the songs it cannot find (from the DVD.

  • Desktop Background Freezing. Cant use it. Help please!

    This is happening on both my Imac and Macbook Air. When I open it, it all just freezes. I am about to sell my Imac I dont want the new user thinking I sold them it dodgy. Please help (I am a new mac user please explain in depth) Thank you

    First follow the instructions in this support article.
    If the iPhoto library is the source of your desktop pictures, it may need to be rebuilt, or you may need to update the iPhoto application to the latest version.
    Otherwise, continue as below.
    Back up all data.
    In the Finder, hold down the option key and select
    Go ▹ Library
    from the menu bar. From the Library folder, delete the following item, if it exists: 
    Caches/com.apple.systempreferences
    and move the following item to the Desktop:
    Preferences/com.apple.desktop.plist
    Launch System Preferences and test. If you still have the issue, put the item on the Desktop back where it came from and post again. Otherwise, delete the item.

  • Mildet connect to oracle DB using servlet problem ,help please

    hi guys i have a problem am tring to connect my midlet to databse through midlet but i don`t know what is the problem so far the midlet already connect to my servlet url but the servlet cant read the parameters to open the connection for database
    my servlet code
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    import java.io.*;
    import java.net.*;
    import java.sql.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.text.*;
    * @author freddy
    public class getconnection extends HttpServlet {
        Statement statement;
    ResultSet rs=null;
    String bstr=null;
    String bstr1=null;
    String bstr2=null;
    public void init()
        * Processes requests for both HTTP <code>GET</code> and <code>POST</code> methods.
        * @param request servlet request
        * @param response servlet response
        protected void processRequest(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
            response.setContentType("text/html;charset=UTF-8");
            PrintWriter out = response.getWriter();
            try {
                /* TODO output your page here
                out.println("<html>");
                out.println("<head>");
                out.println("<title>Servlet getConnection</title>"); 
                out.println("</head>");
                out.println("<body>");
                out.println("<h1>Servlet getConnection at " + request.getContextPath () + "</h1>");
                out.println("</body>");
                out.println("</html>");
            } finally {
                out.close();
        // <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code.">
        * Handles the HTTP <code>GET</code> method.
        * @param request servlet request
        * @param response servlet response
        @Override
        protected void doGet(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
            processRequest(request, response);
      doPost(request,response);
        * Handles the HTTP <code>POST</code> method.
        * @param request servlet request
        * @param response servlet response
        @Override
        protected void doPost(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
            processRequest(request, response);
            DataInputStream in = new DataInputStream(
                    (InputStream)request.getInputStream());
            String sid = in.readUTF();
            String user = in.readUTF();
            String pwd = in.readUTF();
          //  "jdbc:oracle:thin:@localhost:1521"+": "+sid
            String message = message = "Name:"+bstr+" telephone:"+bstr1+" burthday:"+bstr2;
             try {
                connect(sid,user, pwd);
                message += "100 ok connected";
            } catch (Throwable t) {
                message += "200 " + t.toString();
            response.setContentType("text/plain");
            response.setContentLength(message.length());
            PrintWriter out = response.getWriter();
            out.println(message);
            in.close();
            out.close();
            out.flush();
        private void connect(String sid, String user,String pwd)
        throws Exception {
            // Establish a JDBC connection to the MYSQL database server.
            //Class.forName("org.gjt.mm.mysql.Driver");
            Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
            Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:"+sid,user,pwd);
            System.out.print("connected");
            try{
               statement =conn.createStatement();
                rs=statement.executeQuery(" Select*from WOH.P_DEMGRAPHICS where P_ID='P1000 '");
            catch(SQLException e)
            System.err.print(e);
           try{
    while (rs.next()) {
    bstr=rs.getString(2);
    bstr1=rs.getString(3);
    bstr2=rs.getString(4);
    statement.close();
       catch (SQLException e) {
    //bstr += e.toString();
    System.err.println(e);
    System.exit(1);
            // Establish a JDBC connection to the Oracle database server.
            //DriverManager.registerDriver(new oracle.jdbc.OracleDriver());
            //Connection conn = DriverManager.getConnection(
            //      "jdbc:oracle:thin:@localhost:1521:"+db,user,pwd);
            // Establish a JDBC connection to the SQL database server.
            //Class.forName("net.sourceforge.jtds.jdbc.Driver");
            //Connection conn = DriverManager.getConnection(
            //      "jdbc:jtds:sqlserver://localhost:1433/"+db,user,pwd);
        * Returns a short description of the servlet.
        public String getServletInfo() {
            return "Short description";
        // </editor-fold>
    }Midlet code
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    import java.io.*;
    import java.util.*;
    import javax.microedition.io.*;
    import javax.microedition.midlet.*;
    import javax.microedition.lcdui.*;
    * @author freddy
    public class testOrcl extends MIDlet  implements CommandListener {
       protected String url;
        private String username;
        private Display display;
        private Command exit = new Command("EXIT", Command.EXIT, 1);;
        private Command connect = new Command("Connect", Command.SCREEN, 1);
        private TextField tb;
        private Form menu;
        private TextField tb1;
        private TextField tb2;
        DB db;
        public testOrcl() throws Exception
            display=Display.getDisplay(this);
            url="http://localhost:8084/getConnection/getconnection";
        public void startApp() {
            displayMenu();
        public void displayMenu()
        menu= new Form("connect");
         tb = new TextField("Please input database: ","",30,
                    TextField.ANY );
            tb1 = new TextField("Please input username: ","",30,
                    TextField.ANY);
            tb2 = new TextField("Please input password: ","",30,
                    TextField.PASSWORD);
            menu.append(tb);
            menu.append(tb1);
            menu.append(tb2);
            menu.addCommand(exit);
            menu.addCommand(connect);
            menu.setCommandListener(this);
            display.setCurrent(menu);
        public void pauseApp() {
        public void destroyApp(boolean unconditional) { }
        public void commandAction(Command command, Displayable screen) {
            if (command == exit) {
                destroyApp(false);
                notifyDestroyed();
            } else if (command == connect) {
                db  = new DB(this);
                db.start();
                db.connectDb(tb.getString(),tb1.getString(),tb2.getString());
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    import java.io.*;
    import java.util.*;
    import javax.microedition.io.*;
    import javax.microedition.midlet.*;
    import javax.microedition.lcdui.*;
    import java.lang.*;
    * @author freddy
    public class DB implements Runnable  {
        testOrcl midlet;
         private Display display;
            String sid;
            String user;
            String pwd;
            public DB( testOrcl midlet)
            this.midlet=midlet;
            display=Display.getDisplay(midlet);
        public void start()
        Thread t = new Thread(this);
                t.start();
        public void run()
         StringBuffer sb = new StringBuffer();
                try {
                    HttpConnection c = (HttpConnection) Connector.open(midlet.url);
                   c.setRequestProperty(
                       "User-Agent","Profile/MIDP-2.1, Configuration/CLDC-1.1");
                    c.setRequestProperty("Content-Language","en-US");
                    c.setRequestMethod(HttpConnection.POST);
                    DataOutputStream os =
                            (DataOutputStream)c.openDataOutputStream();
                    os.writeUTF(sid.trim());
                    os.writeUTF(user.trim());
                    os.writeUTF(pwd.trim());
                    os.flush();
                    os.close();
                    // Get the response from the servlet page.
                    DataInputStream is =(DataInputStream)c.openDataInputStream();
                    //is = c.openInputStream();
                    int ch;
                    sb = new StringBuffer();
                    while ((ch = is.read()) != -1) {
                        sb.append((char)ch);
               showAlert(sb.toString());
                    is.close();
                    c.close();
                } catch (Exception e) {
                    showAlert(e.getMessage());
         /* This method takes input from user like db,user and pwd and pass
                to servlet */
            public void connectDb(String sid,String user,String pwd) {
                this.sid = sid;
                this.user = user;
                this.pwd = pwd;
            /* Display Error On screen*/
            private void showAlert(String err) {
                Alert a = new Alert("");
                a.setString(err);
                a.setTimeout(Alert.FOREVER);
                display.setCurrent(a);
       

    Comment out process request or rewrite & move it to a position after you read the parameters and connect to the db. Decide where you want to write to the output stream. Also, you have some superfluous casting.
    I take it that you are using netbeans? If you debug and step through the code you will get an idea of the flow. The steps should be, midlet connects with POST, doPost is called, server reads parameters, server opens connection, executes query, releases/closes connection, and writes a response to the midlet.
    Some notes about the connect method; The scope of rs may cause problems. It is unlike you will have a valid result set if you have a problem with create statement or execute. Take a look at connection pooling and be mindful how the connections are opened, used, and closed; put all the important cleanup operations in a finally. Remove system.exit from your servlet. Actually I would suggest limiting the scope of all your vars;
    If you store the username, password, and sid on the midlet, you may have trouble updating the installation base if you need to change the values for any reason. Also, you have clients which contain your database u/p, susceptible to snooping and decompilation. Use the servlet to abstract the db from the client. And use a datasource (with connection pooling) for obtaining connections to db.

  • Using Nokia Downloader - Help please!!!

    I have recently purchased the Nokia 6500 Slide mobile phone. Have discovered that it does not have the latest software - currently has Version 08.30 (3rd July 2008). I have been advised to have it updated to the latest version.
    I understand it should be possible do download the software via Nokia Downloader. I have downloaded the appropriate software but am reluctant to attempt to start the procedure in case anything goes wrong!
    Can anyone please advise me whether it is an easy procedure to download the software.
    Many thanks
    Casselle

    Usually it is easy and things go smoothly.
    Sometimes there are issues (detecting the phone, doing the actual upgrading, etc.).
    Read the Help and FAQ (Frequently Asked Questions) around the topics here:
    http://europe.nokia.com/A41459975
    http://europe.nokia.com/get-support-and-software/download-software/non-fota-update-phone/faq

  • But I don't WANT unlimited bars!!! Help please.

    Hello all,
    I often work with short pieces of 60 seconds or less. Maybe 20 or 30 bars. Is there a way to get rid of all the rest of the bars so that, for example, when freezing a track, I don't have to wait while Logic freezes dozens of empty unneeded bars?

    Hi,
    if you look in the ruler above the arange window, you'll see a bracket at the left at measure 1 (by default). There's also a bracket like that somewhere further to the right, which is the project end marker. You can drag both markers to whatever location you want, and the freeze function will only do it's work between the begin and end marker.
    See page 150 of Help > Logic Express 8 User Manual.
    Regards,
    Jaap

Maybe you are looking for

  • Placed rasters shift colors in PDF output

    Hi all, New to the forum but been working with CS tools for many years now. I'm sure this problem is fairly straightforward but it has me completely stumped. This problem has surfaced recently; I've noticed it before but the situations were never as

  • Save tree structure to text file and load textfile to another tree control

    I'm able to save the structure and data to a text file, thanks to the "save tree structure to textfile" info found on this msg board, but can't seem to load the complete tree structure data from the text file into another tree. I've only been able to

  • Network Issue: G4 Running 10.3.9 Dlink

    Here's the deal...last month I had Verizon FIOS installed and along with it received their free dlink DI-624 (running firmware 2.43DDM). Here's the issue I'm having, my G4 is hardwired to it via a CAT5e run. I don't get on the network unless I manual

  • Error 12

    Hay well I am using Mac OS 8.6, and when ever I insert any software disc in the drive and try to open it from its short cut it appear with an Error MSG "unexpectedly Quit application error type 12", any one have any idea what that mean is and how to

  • Crystal XI

    Is there a way to take a Crystal XI report and open it in Crystal 8.5?