On 8/15/07, juliez <[EMAIL PROTECTED]> wrote:
>
>
> First, thanks for the reply!
>
> >> 2. AJAX components (Wicket vs. ZK)
> >you do not implement features like drag and drop or datepicker in wicket,
> >instead you wrap javascript libraries that implement those features with
> >wicket components.
>
> I am actually confused at how many ways Wicket supports AJAX. The classes
> in
> wicket.ajax packages are used for AJAX behaviors. I supposed these classes
> are for common AJAX behaviors.


wicket has an excellent native ajax support. it allows you to perform
partial page renders where only one or more components on the page are
updated. see wicketstuff.org/wicket13 for examples under ajax. it also has
common ajax handlers - so you dont have to reinvent the wheel - such as form
component update, ajax form submit, self updating timers, etc.

It seems they are different from wrapping
> JavaScript - correct me if I am wrong.


javascript is not the same as ajax. take drag and drop - that has very
little to do with ajax except maybe for notification that x has been dropped
into y. take datepicker, that has no ajax in it at all, its just javascript
that draws a calendar and puts a selected date into a textfield.

Then my questions are
> 1) what is the standard way to add AJAX with Wicket: first looking for
> existing components (including the components in WicketStuff), then if not
> found, wrap JavaScript?


if you have some ajax need that wicket doesnt natively provide and that is
existent in some 3rd party js lib then you can easily write wicket wrappers
for it. the nice thing about it is that you only have to do it once, and
from that point on you dont need to worry about javascript, just use your
java classes. for example there is wicketstuff-animator project that wraps
animator.js in a set of wicket components. you can add animations without
known the details of the animator.js lib.

2) I read the attached file and googled more for the instruction on how to
> wrap JavaScript. Found one here
> (http://cwiki.apache.org/WICKET/adding-dynamic-field-prompts-or-hints.html
> ).
> I am wondering if there are instructions on how to do it in a general way.


there is no "general way", you simply write components that hook into the
javascript.

>>3. Target application (Wicket)
> > like you say, wicket is component oriented. it doesnt really care how
> you
> > build your app: many pages or a single page. at my day time job we have
> an
> > app that is mostly a single page with a lot of component replacement.
> > works
> > just fine.
>
> Still not sure, if a page includes many replacement, how to keep the
> method/class short yet support those changes?


you dont define the combination of all possible replacements at the same
time. wicket is dynamic, at any point in time a component can replace itself
or other components with something else that was just instantiated. also
because components are encapsulated they can perform replacements inside
themselves as well. wicket is not page-centric.

-igor

Reply via email to