The following seems to work until the page refreshes and scrolls to the top:

//--------------------------------------------------------------------------------
    Label lbl = new Label("floatDiv", "floaty text") {
      @Override
      protected void onComponentTag(ComponentTag tag) {
        tag.put("style", "position: absolute; left: 610px; top: "
            + (80 + scrollValue)
            + "px; height: 400px; width: 100px; padding: 1em;");
      }

    };

    AbstractAjaxBehavior beh = new AbstractAjaxBehavior() {
      @Override
      public void onRequest() {
scrollValue = Integer.parseInt(getRequest().getParameter("scrollPos"));
      }
    };
    lbl.add(beh);
    add(lbl);

    WebMarkupContainer body = new WebMarkupContainer("theBody") {

      @Override
      public boolean isTransparentResolver() {
        return true;
      }
    };
    body.add(new SimpleAttributeModifier("onscroll",
        "var wcall=wicketAjaxPost('" + beh.getCallbackUrl(true)
            + "&scrollPos='+window.pageYOffset)"));
    add(body);
//--------------------------------------------------------------------------------

Not sure yet how to keep the page from scrolling to the top each time the callback is made. Still at it. Suggestions?

On 08/30/2010 10:51 AM, Kurt Heston wrote:
I have a really long table with qty values in one of the columns. Instead of having a total at the bottom of the page (and requiring the user to scroll to see it), I'd like to float a div in the bottom right that I can update on the fly as the user changes qty values.

The wicketstuff dojo package had a way to do it, but I don't believe it's compatible with 1.4. Any ideas?

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to