hi nick,

thanks for the feedback. there was indeed an error with the generated
javascript in JavascriptSubject.
The fix for that is already in the svn repository. so could you do an svn
checkout and try that again?

oh, you probably should remove the brackets around the javascript statement
so that it looks like this:
return "Wicket.$('"+progBar.getMarkupId()+"').innerHTML =\"Progress: \" +
Math.round(value *    100) + \"%\"";

i tested that specific line and it worked for me ;)

if you want to use a "timed animation" you could do something like this:

// IHeaderContributor#renderHead
public void renderHead(IHeaderResponse response)
    {
        // anim is a field in the page/component
        response.renderOnLoadJavascript("window.setTimeout(\"" +
anim.getAnimatorId()
                + ".toggle()\", 1000);");

    }

thanks again for the (informal) bug report and let me know if you have any
more questions...

  gerolf

On 9/28/07, NickCanada <[EMAIL PROTECTED]> wrote:
>
>
> Thanks Gerolf Seitz for adding animator.js functionality to wicket-stuff.
>
> I need a bit of help: Can anyone let me know how to implement a
> JavascriptSubject style subject?
> I have NumericalStyleSubject and CssStyleSubject animating a div nicely
> but
> I would love to add, for example something similar to this bit of
> javascript
> from the berniecode.com site:
>
> function updateButton(value) {
>     $('ex1Button').innerHTML = "Progress: " + Math.round(value * 100) +
> "%";
> }
>
> It seems that JavascriptSubject style subject is meant for this purpose
> however
>
> animJS.addSubject(new JavascriptSubject() {
>
>           protected String getFunctionBody() {
>
>                return "[Wicket.$('"+progBar.getMarkupId()+"').innerHTML =
> \"Progress: \" + Math.round(value *    100) + \"%\"]";
>                     }
> });
>
> gives me errors.
>
> Any help for a javascript and Wicket beginner appreciated
>
> Nick
>
> PS Is it possible to use animate with a timer rather than a javascript
> event?
>
>
> --
> View this message in context:
> http://www.nabble.com/Wicket-stuff-Animator-JavascriptSubject-tf4536756.html#a12948411
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to