True, but that will only work on simple pages (that have no callbacks
to themselves, such as ActionLinks or Forms) ... unless you use the
activate event to store page stage into the session, which kind of
undermines the whole point of activate/passivate.  But I could be
wrong ... tell us about your use case ...


On Mon, Aug 8, 2011 at 5:26 AM, Michael Gentry <mgen...@masslight.net> wrote:
> Hi Les,
>
> Thanks for sharing!
>
> One comment, though, is you actually can have onActivate without
> onPassivate.  I've done this many times.
>
> Thanks,
>
> mrg
>
>
> On Sat, Aug 6, 2011 at 2:54 PM, robert baker <les.baker1...@gmail.com> wrote:
>> Hi,
>>
>> I've been in Tapestry training for the past week, have really enjoyed
>> it, and picked up some useful stuff along the way (if you've been
>> seeing "Clemson University" run across the tweet box, that was
>> connected with us).  Mr. Lewis-Ship really gave a broad and deep
>> overview of how Tapestry works (thank you!), and I thought I would
>> share some of the things I personally got out of it in hopes it would
>> help someone else learning the framework.
>>
>>
>> * Activation and passivation in Tapestry work in concert -- can't have
>> one w/o the other.
>>  - If you populate an instance variable on the page in onActivate,
>> return it back in onPassivate
>>  - PageLink asks for activation context using onPassivate if you
>> don't supply context parameter
>>  - May have to @InjectPage and supply what gets passivated beforehand
>> in some cases.
>>
>> * Play around with page URLs and see what happens
>>  - What happens if you don't supply any activation context?
>>  - What happens if the activation context is garbage?
>>  - What happens if the activation context points to something you
>> shouldn't be able to access?
>>
>> * Do work in baby steps -- just try to get *something* visible and
>> work from there.
>>  - Components should default as much as possible to aid this process.
>>
>> * JavaScript is very sensitive about syntax and loose about semantics
>> -- watching Firebug debugger religiously during development of
>> non-trivial JS almost a must.
>>  - Any client-side IDs need to be passed down to client, or use
>> well-known class names on the client.
>>
>> * Ajax: All about what happens when, and breaking up responsibility
>> between server and client.
>>  - Treat URLs going down to the client as immutable.
>>  - Can "bake in" data into the URL that will be passed back up as a
>> parameter on the handling method server-side using "context" parameter
>> on *Link, Form, ProgressiveDisplay components.
>>  - Keeping that in mind, what if you want to make an AJAX request
>> with dynamic number of parameters and/or with values not known at
>> render-time?  Use "parameters" object parameter on
>> Tapestry.ajaxRequest() to add query parameters to the AJAX request.
>>
>> * If you're banging your head against the framework, it's okay to step
>> down to raw elements and do things manually.
>>  - Request service (and @RequestParameter on method parameters) and
>> template property expansions (e.g. ${blah}) a good bridge between page
>> class and raw elements (prop expands for render-time, request parms
>> for submit-time).
>>
>> * Whatever tools you use, know them inside-out.
>>
>>
>> Thanks,
>> Les Baker
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> 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