You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by Jesse Kuhnert <jk...@gmail.com> on 2006/02/23 16:57:17 UTC

Re: [Tacos-devel] Re: IMPORTANT(usability/core logic for ajax): hijacking IMarkupWriter

Good point. It does feel a little hacky upon further reflection.

Maybe something more like:

IComponent.renderJsonComponent(IJsonWriter writer, IRequestCycle cycle);

Still not sure about the ajax response part. It would be easy to add in:

IComponent.renderAjaxComponent(IAjaxWriter writer, IRequestCycle cycle);

but a lot of logic would be duplicated between renderComponent and
renderAjaxComponent if not coded carefully...

I will have to re-think this one I think :)

On 2/23/06, Danny Angus <da...@apache.org> wrote:
>
>
>
>
> "Jesse Kuhnert" <jk...@gmail.com> wrote on 23/02/2006 04:45:34:
>
> > The initial thought I'm having in regard to rendering "ajax" responses
> back
> > to client browsers is that all of the infrastructure/components in place
> > already do an awful lot of work writing their very important content to
> > IMarkupWriter, so why not use that to sort of bootstrap the abililty to
> make
> > your service JSON/XML/html-able?
>
>
> We use (tap 3) IMarkupwriter to rewrite form names and form component
> names
> for Oracle portal (9ias), and to add the original value of the "name" as
> the value of the "id".
> We've just extended that to also rewrite those same names in all script
> refrences, inlcuding <script> and element attributes like event handlers
> and URL's.
> It also detects when the app is being called by portal and doesn't rewrite
> at all when it isn't, meaning that our portlet apps can be developed stnad
> alone and will Just Work (tm) when called by portal.
>
> We've achieved all of this in around 300 lines of code, it is encapsulated
> in a single markup writer and we haven't had to hack Tapestry in any way
> at
> all.
>
> Its a simple but wickedly powerful way to munge every piece of output from
> any component.
>
> I'd quite like to see Tapestry enforcing XHTML so that markup writers
> could
> use XSLT. But just using indexOf and subString gives us extraordinary
> power. Muahhahha.
> The only two issue I have is that the contract for components is not
> strict
> enough that we can reason that a markupwriter will work in all cases,
> effectively because component developers have the freedom to come up with
> any kind of raw output.
>
>
>
> ______________________________________________________________________
> This email has been scanned by the MessageLabs Email Security System.
> For more information please visit http://www.messagelabs.com/email
> ______________________________________________________________________
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by xPML, a groundbreaking scripting
> language
> that extends applications into web and mobile media. Attend the live
> webcast
> and join the prime developer group breaking into this new coding
> territory!
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
> _______________________________________________
> Tacos-devel mailing list
> Tacos-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/tacos-devel
>