You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by mogulwraith <mo...@gmail.com> on 2007/07/28 00:19:07 UTC

T5 confused about Services and XmlHttpResponse

Im really new to Tapestry so bear with...

I have a service injected into a component. The service returns some text. I
have a simple html form with a button and textbox. Javascript in the onclick
event of the button gets a link to the service and passes it to an
XmlHttpResponse object which I need to give me the text from the service.
But instead of that, I get an error telling me there is no page that
matches... and then it lists whatever text returned by the service. If the
text returned is a valid page, then I get the html for that page. this is
not what I want to happen.

How do I get the text returned by the service?
-- 
View this message in context: http://www.nabble.com/T5-confused-about-Services-and-XmlHttpResponse-tf4160459.html#a11837656
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


Re: T5 confused about Services and XmlHttpResponse

Posted by mogulwraith <mo...@gmail.com>.
I do mean XmlHttpRequest of course...
-- 
View this message in context: http://www.nabble.com/T5-confused-about-Services-and-XmlHttpResponse-tf4160459.html#a11837658
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


Re: T5 confused about Services and XmlHttpResponse

Posted by "Nick Westgate (Work)" <ni...@key-planning.co.jp>.

mogulwraith wrote:
> 
> How do I get the text returned by the service?
> 

Have a look at this example on the wiki:
http://wiki.apache.org/tapestry/Tapestry5HowToCreatePieChartsInAPage

You want to do the same thing but something like:

TextStreamResponse onEvent()
{
    // get the service text
    // ...

    return new TextStreamResponse("text/html", serviceText);
}

Note that if you're using non ASCII characters you'll need to derive a new
TextStreamResponse class that takes an encoding parameter (UTF-8 etc).
There's a JIRA ticket for that already.

Cheers,
Nick.
-- 
View this message in context: http://www.nabble.com/T5-confused-about-Services-and-XmlHttpResponse-tf4160459.html#a11839004
Sent from the Tapestry - User mailing list archive at Nabble.com.


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