I'm trying to build a simple example of the ProgressBar from WicketStuff.

I'm getting this stack trace when pressing the "start" button:

java.lang.IllegalArgumentException: cannot update component that does not have 
setOutputMarkupId
property set to true. Component: [Page class =
com.webperformanceinc.office.licmgr.ui.MassUpgradeStatusPage, id = 20, version 
= 0, ajax = 3]
     at 
org.apache.wicket.ajax.AjaxRequestTarget.addComponent(AjaxRequestTarget.java:346)
     at org.wicketstuff.progressbar.ProgressBar.start(ProgressBar.java:184)
     at
com.webperformanceinc.office.licmgr.ui.MassUpgradeStatusPage$2.onSubmit(MassUpgradeStatusPage.java:61)
     at 
org.apache.wicket.ajax.markup.html.form.AjaxButton$1.onSubmit(AjaxButton.java:102)
     ...

I have 3 elements with wicket:ids on them in my page, a form, a button and the
progress bar. I've called setOutputMarkupId(true) on all three, plus on the
page, since it was indicated as the offending componenet.  What am I missing?

See below for my code and HTML.

TIA to anyone who can point me in the right direction.
Chris



My page is constructed in this method (called from the page constructors):
    private void init()
        {
        setOutputMarkupId(true);

        final ProgressBar bar = new ProgressBar("bar", new ProgressionModel()
            {
            protected Progression getProgression()
                {
                return new Progression(progress);
                }

            protected void onFinished(AjaxRequestTarget target)
                {
                setVisible(false);
                target.appendJavascript("alert('Task done!')");
                }
            });
        add(bar);
        bar.setOutputMarkupId(true);

        Form form = new Form("form");
        add(form);
        form.setOutputMarkupId(true);
        IndicatingAjaxButton start_button = new 
IndicatingAjaxButton("start_button", form)
            {
            protected void onSubmit(AjaxRequestTarget target, Form form)
                {
                bar.start(target);
                new Thread()
                {
                public void run()
                    {
                    for (int i = 0; i <= 100; i++)
                        {
                        try
                            {
                            Thread.sleep(200);
                            }
                        catch (InterruptedException e)
                            {
                            }
                        progress = i;
                        }
                    }
                }.start();
                }
            };
        start_button.setOutputMarkupId(true);
        form.add(start_button);

        }

and my markup is pretty simple:

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>
<html xmlns="http://www.w3.org/1999/xhtml";
    xmlns:wicket="http://wicket.sourceforge.net/";>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>app title</title>
  </head>
  <body>
      <wicket:extend>

<p>Status goes here:</p>
<form action="#" wicket:id="form"><input type="submit" wicket:id="start_button" 
value="start"></form>
<div wicket:id="bar">[Progress]</div>


      </wicket:extend>
  </body>
</html>




-- 
------------------------------------------------------------------------ -
Chris Merrill                           |  Web Performance, Inc.
ch...@webperformance.com                |  http://webperformance.com
919-433-1762                            |  919-845-7601

Web Performance: Website Load Testing Software & Services
------------------------------------------------------------------------ -

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to