Hi,

On Sat, Sep 4, 2010 at 11:07 PM, Andrei Ionescu <[email protected]> wrote:

> I understand that Ajax is not that easy, so maybe it's impossible with Click
> to offer the same level of "magic" like it usually does.

Not sure where you see "magic" but one of the things that attracted me
to Click is that there was no magic. It is stateless, URLs are
predictable and it follows the DRY principle.

> Unfortunately, for me this "Behavior" functionality doesn't sounds "too
> natural". It also feels just too much like Wicket.

I think we need to be careful of trying to be different just for the
sake of it. This is open source after all, and we should borrow good
ideas from other frameworks. Not saying Behavior is good but I do
think it accurately describes the feature.

> The "Partial" - on the other hand was quite straight forward to understand.

Is it the Behavior concept that you find difficult or is it the
implementation that is complex? I assume you have looked at the
Behavior Javadoc? Perhaps it needs further explaining or more
examples?

The Behavior concept is used by both Wicket and JSF so it is becoming
well known outside of Click. Btw. Partial and Behavior are orthogonal
concepts and not related to each other.

>
> Regarding the documentation:
> A.
> https://hudson.apache.org/hudson/view/Click/job/Click/javadoc/docs/user-guide/html/ch02s07.html
>   :
>  1. "...template will not be rendered. More on this later."
>    --> The last phrase could be dropped or replaced with a direct link to
> the section that details the subject. This appears in several places in the
> documentation.
>
>  2. "First we create our template:
>     <img src="/mycorp/images.htm?pageAction=onRenderImage"/>
>    "
>    --> shouldn't be "$context/mycorp...." ? Also this refers to the
> corresponding template: image.htm?

Fixed.
>
>  3. ..., a new Page instance is created and the attributes for the Page ..."
>    ---> so each Ajax method call will create a new Page? Isn't this a
> performance problem since Ajax calls are many? Or the page can be stateful
> to reduce object creation?

I think it might be faster as there is no need to synchronize.
>
>  4. "...Note, if you want to send a specific response to the client or
> perform a redirect you have to do that from the onSecurityCheck() event,
> since other Page events are not processed."
>    ---> Is there an example how to send a specific response from
> onSecurityCheck? since it's not returning an ActionResponse to be able to
> returns something to the client.

I'll add an example, but essentially you'll have to render directly to
the HttpResponse. Normally one would redirect to another page, but
redirect is not supported directly by Ajax.

> Other questions to chapter 2.7:
>  5. can the pageAction parameter be configured/renamed by the user or is it
> hardcoded in Click?

I guess one could create a custom ClickServlet to change it...
>
>  6. If the content of the ActionResponse is complicated (but still not a
> complete page), is it possible to have Velocity render it the same way it
> does for a normal page?

Off course. ActionResponse can render any chars or bytes.
>
> B.
> https://hudson.apache.org/hudson/view/Click/job/Click/javadoc/docs/user-guide/html/ch04.html#ajax-overview
>  1. "You can use pure JavaScript or one of the popular JavaScript libraries
> such as: jQuery, Prototype ..."
>    ---> I think here would be a good place to mention Click-JQuery project.
>
> C.
> https://hudson.apache.org/hudson/view/Click/job/Click/javadoc/docs/user-guide/html/ch04s04.html
>  ---> It would be nice if it would be possible to use that example without
> an anonymous class - the same way it's possible with other listeners. E.g.
> link.addBehavior("onAjaxAction").

Where "onAjaxAction" is a method on the Page?
>
> I'm still trying to understand correctly the rest of Behaviors :), so if
> it's not in "code freeze" I will post later some more feedback.

Go ahead its not in codefreeze. I would however ask that you
differentiate between Behavior as a concept and the implementation.
That would make it easier for us to identify and resolve the problem
areas.

Thanks.

Bob

Reply via email to