On 11/18/06, Alarcón Vladimir <[EMAIL PROTECTED]> wrote:

Feature 1: Navigate-In & Navigate-Out for each page.

I understand that Shale uses a bean for each page,
that's called "backing bean". A lot of times I have
found that I need some code to "set-up" and for
"tear-down" the page. Typically for loading values
from DB in the form of the page, setting session
variables or removing these session variables when
exiting the page.

So, what do you think of having a couple of optional
methods named "navigateIn()" and "navigateOut()" in
each backing bean that are called by Shale every time
that the application enter or exit each page?


I think the use cases you describe are adequately addressed with the current
APIs ... see below for more.

For example, if I am in page A and I press a command
that decides to go to page B, Shale would execute
"navigateOut()" on page A and then "navigateIn()" on
page B. On the contrary, if the command decides to
stay in the page A, Shale doesn't execute any of them.

I know that Shale already uses "init()" and
"destroy()" but I think these methods do not address
very well the problems mentioned above.





Another though: It's not uncommon that the
"navigateIn()" method can go bad. For example if it
tries to fill in the form, retrieving from the DB the
details of customer that doesn't exist anymore. It
would be good to have a simple way to redirect the
processing returning some value (or throwing an
exception) that represents the new page that I would
like to go, if that happens.

That's it. Any comments?


For setup actions, I'd suggest using ViewController.prerender().  It is
called *only* on the backing bean whose view is actually going to be
rendered, so it covers both the case where you navigate elsewhere (prerender
gets called on *that* view's bean) or if you stay here (prerender will be
called on your own page bean).

Given that, I think your navigateOut requirements are covered by destroy()
... destroy() will get called on both beans if you did navigate, but you
won't have set anything up on the "from" bean.  Note also that destroy() is
called *after* rendering is complete, so you can clean up resources that you
needed for rendering.

Vladimir.


Craig


--- Wendy Smoak <[EMAIL PROTECTED]> wrote:

> On 11/18/06, Alarcón Vladimir
> <[EMAIL PROTECTED]> wrote:
>
> > Hi, I am interested to discuss new features to a
> > future version of Shale and I would like to know
> if
> > there is interest on discussing them; if so,
> please
> > reply.
>
> Sure!  The best way would be to start a new thread
> on the mailing list
> and use a descriptive subject line.  (Here, you've
> replied to an
> unrelated thread about Tiles.)
>
> And your English is fine. :)
>
> --
> Wendy
>





____________________________________________________________________________________
Sponsored Link

$420k for $1,399/mo.
Think You Pay Too Much For Your Mortgage?
Find Out! www.LowerMyBills.com/lre

Reply via email to