You can ask any component to generate an event request Link using its
component resources.  In Tapestry, you don't try to second guess, on
the client side, what links will look like ... you ask the server side
to generate a link, and then your JavaScript code can send Ajax
requests to that component.

In terms of what you are trying to do ... Tapestry assumes most
requests from the client will generate a partial page render response
... a particular format JSON response that contains HTML plus details
about JavaScript libraries and initializations.  In any case, that's
what a Zone (or anything Zone-like) needs.  If you can, use Zone.

Alternately, a component may send a response directly back to the
client, which it be text, HTML, JSON, or something binary.

On Thu, Jun 30, 2011 at 1:55 PM, Joel Halbert <j...@su3analytics.com> wrote:
> Can I access a component out of the context of a page?
> i.e. does a component have to be bound to a Page to be rendered?
>
> I'm trying render a simple html template and fetch it from my JS.
>
>
> On Thu, 2011-06-30 at 17:38 -0300, Thiago H. de Paula Figueiredo wrote:
>> On Thu, 30 Jun 2011 17:26:35 -0300, Joel Halbert <j...@su3analytics.com>
>> wrote:
>>
>> > Hi,
>>
>> Hi!
>>
>> > Is it possible to invoke a component directly via HTTP?
>> >
>> > E.g given a Tapestry Page:
>> >
>> > public class MyPage {
>> >   Object onMyRequest() {
>> >     return something;
>> >   }
>> > }
>> >
>> > I can call http://myapp/mypage:myrequest/ to return something.
>> > Can I do the same for a component?
>>
>> It's not recommended to access components directly, but you can @Inject
>> ComponentResources and use its createEventLink() method.
>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>



-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

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

Reply via email to