Re: Rendering a Block

2011-06-05 Thread Steve Eynon
Hi, An approach I've just used, is to render the XML into to the page, convert the generated markup into a String and then remove the XML from the DOM. It may not be appropriate for all cases but it works if you just want to template pure XML with no javascript or CSS. Here's a component which r

Re: Rendering a Block

2011-03-16 Thread Howard Lewis Ship
I've done work integrating Ext.GridPanel with Tapestry, but we've just let Ext render the data items on the client side. I've actually had a lot of frustration because of the impedance mismatch between Ext (the server provides just data) and Tapestry (the server renders all content). On Wed, Mar

Re: Rendering a Block

2011-03-16 Thread Joe Klecko
Thanks, I appreciate your response Howard. Your insight is helpful and actually the behavior I was expecting from Tapestry (ie, injection of javascript, css, etc). But I still feel I need to render the block into a string so I can escape the output which can then be used as a javascript parameter

Re: Rendering a Block

2011-03-09 Thread Howard Lewis Ship
You don't necessarily need a zone, just combine Tapestry.ajaxRequest() with Tapestry.loadScriptsInReply() Example: Tapestry.ajaxRequest(spec.url, function (transport) { var reply = transport.responseJSON; Tapestry.loadScriptsInReply(reply, function() { $(myDiv).update(reply.content);

Re: Rendering a Block

2011-03-09 Thread Joe Klecko
>> provide more details. Anyway, there isn't a ready made way of rendering a >> block to a string. Please file a JIRA about it. Meanwhile, this message >> in >> the mailing list provide a way of doing exactly what you want: >> http://www.mail-archive.com/users@.../msg38854.html. It's >> not

Re: Rendering a Block

2011-02-28 Thread Richard Hill
I've also had a use-case like this - I wanted to use tapestry to generate html based on a .tml, in response to an ajax request that I was initiating from my own javascript, ie nothing to do with a zone. We've had a few people on the list say they'd like to do this. Given that tapestry is doing th

Re: Rendering a Block

2011-02-26 Thread Thiago H. de Paula Figueiredo
On Sat, 26 Feb 2011 13:52:27 -0300, Tom van Dijk wrote: Hi, Hi! Well, it is an AJAX request. The X-Requested-With header is properly set, isXHR() will return true. I'm executing it in Javascript, just a normal call. It's supposed to return a form that I can then display in any DIV that

Re: Rendering a Block

2011-02-26 Thread Adam Zimowski
That was my issue. I did not want to work with zones either, and as a result pounded my head against the wall. Using Tapestry features - zones and blocks - solves this problem (although not very intuitive). The tricky part is the Tapestry specific JavaScript which isn't readily documented. On Sat,

Re: Rendering a Block

2011-02-26 Thread Jonathan Barker
Unless I'm missing something (which is possible), in both cases the complexity comes because you are trying to NOT use the features of Tapestry. Both of you want to bypass the tools Tapestry gives you. Use an EventLink and use a context and a zone. As for an arbitrary div... you can update any

Re: Rendering a Block

2011-02-26 Thread Markus Feindler
The thing is, he does not want to work with zones! Heh.. this is funny, but it sounds like the issue I just described in my "Grid with multiple forms" thread. Anyway, to call a Tapestry event from a JavaScript you probably want this in your javascript: function yourJavaScriptMethod(yourParameter

Re: Rendering a Block

2011-02-26 Thread Adam Zimowski
Heh.. this is funny, but it sounds like the issue I just described in my "Grid with multiple forms" thread. Anyway, to call a Tapestry event from a JavaScript you probably want this in your javascript: function yourJavaScriptMethod(yourParameterIfYouHaveOne) { var url = '${tapestryEvent}' + '/

Re: Rendering a Block

2011-02-26 Thread Tom van Dijk
Hi, Well, it is an AJAX request. The X-Requested-With header is properly set, isXHR() will return true. I'm executing it in Javascript, just a normal call. It's supposed to return a form that I can then display in any DIV that I want, and I don't want to use zones here. So I would think I sho

Re: Rendering a Block

2011-02-26 Thread Josh Canfield
Hi Tom. You can definitely return a block as the result of an AJAX request. If it's not an AJAX request then you will get an error about not having a result processor. Make sure that the zone parameter is set on the link you are using to initiate the zone update, and that javascript is turned on.