IJavascriptAnimation { CharSequence getJavascript(); }
AjaxRequestTarget.append(IJavascriptAnimation ani);
AjaxRequestTarget.prepend(IJavascriptAnimation ani);
something like that? that is pretty pluggable.
generalize it even more?
IJavascriptAnimation->IJavascriptProvider
the assumption is that doing
(1) target.append(new FadeToYellow(component, Duration.seconds(2));
is a lot better then
(2) target.append(FadeToYellow.create(component, Duration.seconds
(2)).getJavascript());
eventhough (2) is how HeaderContributor works
-igor
On 4/13/07, Matej Knopp <[EMAIL PROTECTED]> wrote:
I'm sure we can. But the API won't be as straightforward. Bascially
everything you need for an animation is a chunk of javascript, so
prepend/appendJavascript can do the work. But you need some helper
classes to generate the javascript. However, is is more decoupled and
more difficult/uglier to use.
Plus if we want to prepend animations (before component replacement),
we need to add funtionality to asynchronously delay component
replacement. Fortunately, due to the ajax pipeline we have, this
should be very easily doable.
-Matej
On 4/13/07, Martijn Dashorst <[EMAIL PROTECTED]> wrote:
> On 4/13/07, Vincent Demay <[EMAIL PROTECTED]> wrote:
> > What about a simple Behavior, I think behavior is easier to use for
the
> > end user
> >
> > class onRefreshAnimationBehavior extends AbstractBehavior{
> >
> > onRendered(){
> > if(AjaxRequestTarget){
> > target.prependJavascript(getFromEffect())
> > target.appendJavascript(getToEffect());
> > }
> > }
> >
> > CharSequence getFromEffect();
> >
> > CharSequance getToEffect();
> >
> > }
> >
> > so user can extend it, ie
> >
> > onRefreshAnimatedClassBehavior(fromClass, toClass)
> > in order to do
> > component.add(new onRefreshAnimatedClassBehavior("yellow",
"default"));
>
> This is creating a complete slew of new behaviors. I don't like that.
> We have to implement it in a way, that we don't increase the API too
> much.
>
> What Al coined seems like a nice option (needs a bit polish imo, but
> the basic idea seems sound), *if* we want to support animation as a
> core functionality. This would increase the API for the
> AjaxRequestTarget. Couldn't we implement it in a less intrusive way,
> so that the scriptaculous/dojo/moo fans can plug into our animation
> aware target?
>
> Martijn
>
> --
> Learn Wicket at ApacheCon Europe: http://apachecon.com
> Join the wicket community at irc.freenode.net: ##wicket
> Wicket 1.2.5 will keep your server alive. Download Wicket now!
> http://wicketframework.org
>