I was hoping to wake up to a solution/suggestion :)

Anyone?

So, from a different perspective, what I really want in my page is something
like


Object onRender()
{
   StreamResponse = ...
   <blah/>
   return streamResponse;
}


where I can simply return the blog - just like onActionFromId ... type
handlers. The problem here for me is ...

what event to use when rendering a url the browser requests (like <img
src="[tapestry/Url]"/>) and how to get a binary response back and cease the
rest of the events..

Dare I try

Object pageAttached()
{
 ...
}


Hope that makes sense. Simplistically, I'm just trying to render an image
when the page is requested.

Were this stuts, I do this in the execute method of the action but with the
stages Tapestry has, I'm sure I need to think about it subtley differently.
I just haven't done something like this when RENDERING the page - only on
ACTION from the page - etc.

I'll keep thinking about it - maybe I am just missing it. Thanks,

-Luther



On Wed, Mar 11, 2009 at 1:25 AM, Luther Baker <lutherba...@gmail.com> wrote:

> So I've embedded an img tag as follows: <img src="image/Get/1"/>
>
> The url "image/Get/1" invokes page "image/Get" with an activation context
> of "1". The *.java onActivate handler loads the image from Hibernate. The
> corresponding *.tml page only has one component on it of which takes a
> @Parameter of type Image ... which the page successfully gives it.
>
> <t:Layout xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";>
>     <t:ImageStream image="value"/>
> </t:Layout>
>
> And hopefully, the ImageStream component attempts to render itself --- does
> this sound correct so far?
>
> My problem is - how does the component render binary data? IE: component
> render methods can take 0 or 1 argument, a MarkupWriter ... which doesn't
> have a binary output method. And if I try to be slick and change the render
> method signature to
>
> Object beginRender()
>
> I predictably get the error:
>
> "The return value from a render phase event method was not compatible the
> expected return type of java.lang.Boolean. You should change the method to
> return the correct type."
>
> So I think I'm back to the same question, "is there a way I can return
> binary information as part of a page or component's rendering lifecycle?"
> i.e.: in response to a GET.
>
> I can definitely do it onAction, onSuccess, etc since those methods can
> return Object ... streams, pages, etc. But what about BEFORE the user takes
> such action ... in the rendering cycle or as a simple response to a GET.
> Those render lifecycle methods seem to return boolean.
>
> Does that question make sense? Thanks,
>
> -Luther
>
>
>
>
>
> On Tue, Mar 10, 2009 at 5:06 PM, Thiago H. de Paula Figueiredo <
> thiag...@gmail.com> wrote:
>
>> Em Tue, 10 Mar 2009 16:57:11 -0300, Luther Baker <lutherba...@gmail.com>
>> escreveu:
>>
>>  Am I'm looking for a render method that returns an Object - and stops the
>>> rest of the lifecycle?
>>>
>>
>> I would try to create a component instead. It is a more reusable solution.
>>
>> --
>> Thiago H. de Paula Figueiredo
>> Independent Java consultant, developer, and instructor
>> http://www.arsmachina.com.br/thiago
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>
>>
>

Reply via email to