Thanks for your replies - removing the html part already did the job, and there was no need for a more advanced processing. The only remaining problem so far is that I haven't managed to obtain my persisted object (it's persisted in the main page), but the component I get using AJAX doesn't seem to be able to retrieve it. I'll keep on trying and I'll summarize it in the Wiki once I'm there.
With regard to Howard's last comment: does this mean that we can expect something like an <t:ajaxSubmit href="myComponent" div="myDiv" post="true" id="myId" onsuccess="function..." onerror="function... " errorMessage="RTFM"/> I already thought of making such a component myself, which would include the Ajax.Updater javascript above and include a reference to prototype.js: but I don't know yet how to prevent this javascript and the prototype ref to be repeated every time I include such an ajaxSubmit (except by including it separately in the main page). I probably have to take a look at the Grid component... BTW do you also plan to AJAX-ify the delegate option, e.g. when you have a border/layout component, the <t:body/> will be replaced using AJAX. On 6/12/07, Howard Lewis Ship <[EMAIL PROTECTED]> wrote:
Most of that logic will move into the framework pretty much invisibly. On 6/12/07, Kristian Marinkovic <[EMAIL PROTECTED]> wrote: > hi erik, > > GetContent.html is interpreted by T5 as: go to component "html" > on page "GetContent". > > if you know beforehand what your link looks like (eg. what component > and what page) you can use following code snippet to perform partial > page rendering: > > > @Component > private ActionLink UpdateLink; > > // to retrieve page instances > @Inject private RequestPageCache _cache; > // returns markupwriter > @Inject private MarkupWriterFactory _mwf; > // sets the environment > @Inject private PageRenderInitializer initializer; > > public Object onActionFromUpdateLink { > initializer.setup(markupWriter); > Page page = _cache.get("anypage"); > > ComponentPageElement element = > page.getRootElement().getEmbeddedElement("anyelement"); > > RenderQueueImpl queue = > new RenderQueueImpl(page.getLog()); > > element.queueRender(queue); > > queue.run(markupWriter); > markupWriter.end(); > initializer.cleanup(markupWriter); > > return new TextStreamResponse("text/html",markupWriter.toString()); > } > > it works but i don't know if it's the T5 way of doing it :) > > g, > kris > > > > > "Erik Vullings" <[EMAIL PROTECTED]> > 12.06.2007 16:00 > Bitte antworten an > "Tapestry users" <users@tapestry.apache.org> > > > An > "Tapestry users" <users@tapestry.apache.org> > Kopie > > Thema > T5: Prototype's AJAX.updater question > > > > > > > Hi all, > > Is it possible to use prototype's AJAX updater function to replace a div > with the output of a tapastry page or component? > > I''ve tried the following: > > I created a js function which should update the mainContent div > *function* showAJAX(index) { > *new* Ajax.Updater("mainContent", "GetContent.html", { > method : "post", > postBody : "index=" + index, > onSuccess : *function*(resp) { > }, > onFailure : ajaxError > }); > } > > Whether GetContent.html is a valid T5 page or a component, in both cases I > get the following error (in the correct mainContent div, so that part > works > :-): > An unexpected application exception has occurred. > > - org.apache.tapestry.ioc.internal.util.TapestryException Component > org.example.myapp.pages.GetContent does not contain an embedded > component with id 'html'. > > Stack trace > > - > > org.apache.tapestry.internal.structure.ComponentPageElementImpl.getEmbeddedElement > (ComponentPageElementImpl.java:831) > - > > org.apache.tapestry.internal.structure.PageImpl.getComponentElementByNestedId > (PageImpl.java:83) > - org.apache.tapestry.internal.services.ActionLinkHandlerImpl.handle( > ActionLinkHandlerImpl.java:69) > - ... > > Any idea what I'm doing wrong? > > Thanks > Erik > > -- Howard M. Lewis Ship TWD Consulting, Inc. Independent J2EE / Open-Source Java Consultant Creator and PMC Chair, Apache Tapestry Creator, Apache HiveMind Professional Tapestry training, mentoring, support and project work. http://howardlewisship.com --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]