shake effect in login page

32 views
Skip to first unread message

decebal

unread,
Nov 17, 2011, 8:29:11 AM11/17/11
to jqwicket-user
Hello

How can I use the jquery shake effect on login access denied -
onError() in LoginForm. Any code snippet it's welcome.

Thanks,
Decebal

max

unread,
Nov 17, 2011, 9:30:56 AM11/17/11
to jqwick...@googlegroups.com
Try this:

Html:

<div id="shakeContainer" style="border: 1px solid black; padding: 5px;">
        <form ...>
           
        </form>
</div>

Java:

class ShakeForm extends Form<Void> {

    private boolean shakeAlreadyAdded = false;

    .....

        @Override
        protected void onError() {
            if (!shakeAlreadyAdded)  {
                add(new JQBehavior(S.id("shakeContainer").to$()
                            .effect("shake", JQOptions.valueOf("times:2"), JQLiteral._raw(70))));
                shakeAlreadyAdded = true;
            }
        }  

}



http://docs.jquery.com/UI/Effects/Shake

decebal

unread,
Nov 18, 2011, 7:03:54 AM11/18/11
to jqwicket-user
Thanks

I have a strange error in firebug "$("#shakeContainer").effect is not
a function".
In html head:
<script type="text/javascript" src="http://ajax.googleapis.com/
ajax/libs/jquery/1.6.1/jquery.min.js"></script>
<script type="text/javascript" id="e693dd4f-e475-4526-99b7-
aef720751a70"><!--/*--><![CDATA[/*><!--*/
$(document).ready(function(){$
("#shakeContainer").effect("shake",{times:2},70);})
/*-->]]>*/</script>

Any help?

On Nov 17, 4:30 pm, max <m...@javaforge.net> wrote:
> Try this:
>
> *Html:*
>
> <div id="shakeContainer" style="border: 1px solid black; padding: 5px;">
>
> >         <form ...>
>
> >         </form>
> > </div>
>
> *Java:*

Sascha (MoH)

unread,
Nov 18, 2011, 12:37:52 PM11/18/11
to jqwicket-user
Aa far as i know the "effect"-function is part of jquery-ui, isn't it?
Therefore , an include like
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/
libs/jqueryui/1.8/jquery-ui.min.js"></script>
has to be available.

Is this include in your code?


regards,
sascha

decebal

unread,
Nov 18, 2011, 12:59:27 PM11/18/11
to jqwicket-user
First, thanks for the fast response.

Ooops you are right. I forgot to add:
getComponentPreOnBeforeRenderListeners().add(new
JQComponentOnBeforeRenderListener(
new JQContributionConfig().withDefaultJQueryUi()));

in my Application

Best regards,
Decebal
Reply all
Reply to author
Forward
0 new messages