Re: TextStreamResponse - TypeError

2009-04-27 Thread Howard Lewis Ship
Yes, the client-side logic expects a JSON response in a particular
format; this format includes the content to put into the Zone, but
also JavaScript libraries to include, and JavaScript to execute after
the content is loaded ... and in 5.1 it may also include updates for
other zones.

But a t:block in your template with the desired text, @Inject the
Block into your page, and return the Block.

Alternately, you can return a JSONObject as the response, but you'd
need to know the Tapestry format expected by the client.

Another alternative: don't use the zone parameter of ActionLink, but
provide your own JS to send the request and interpret the response,
and update the Zone on the client side.

On Mon, Apr 27, 2009 at 2:12 PM, Geoffrey Wiseman
geoffrey.wise...@gmail.com wrote:
 Probably something really basic that I'm missing here -- I'm hoping one of
 you already knows the answer.  This is my first time trying
 TextStreamResponse for an ajax action link.

 The .tml has bits like this:
        t:zone t:id=actionResults /

        t:grid ...
            t:parameter name=actionsCella t:type=actionLink
 t:id=invite context=${item.id}
 zone=actionResultsinvite/a/t:parameter
        /t:grid

 And the .java has this:
    public StreamResponse onActionFromInvite( EventContext context ) {
        return new TextStreamResponse(text/html,Action taken.);
    }

 And I'm getting:
 Client exception processing response: TypeError: reply is null

 Anything leap out as obviously wrong, or am I going to have to diagnose
 further?

  - Geoffrey
 --
 Geoffrey Wiseman
 http://www.geoffreywiseman.ca/




-- 
Howard M. Lewis Ship

Creator of Apache Tapestry
Director of Open Source Technology at Formos

-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Re: TextStreamResponse - TypeError

2009-04-27 Thread Geoffrey Wiseman
On Mon, Apr 27, 2009 at 5:20 PM, Howard Lewis Ship hls...@gmail.com wrote:

 Yes, the client-side logic expects a JSON response in a particular
 format; this format includes the content to put into the Zone, but
 also JavaScript libraries to include, and JavaScript to execute after
 the content is loaded ... and in 5.1 it may also include updates for
 other zones.


Ah, I see -- so TextResponseStream is not a way to render simpler content
for a zone update.  I had a single string, and a block seemed excessive, I
thought I'd check the alternatives.  I already shifted back to a block in
the meantime, so I'll stick with that.


 Another alternative: don't use the zone parameter of ActionLink, but
 provide your own JS to send the request and interpret the response,
 and update the Zone on the client side.


[nod].  Streamlined, but a lot more work.  ;)

Thanks,

  - Geoffrey
-- 
Geoffrey Wiseman
http://www.geoffreywiseman.ca/