[prev in list] [next in list] [prev in thread] [next in thread] 

List:       tapestry-user
Subject:    Re: Get instance of page
From:       "Howard Lewis Ship" <hlship () gmail ! com>
Date:       2008-11-27 1:40:23
Message-ID: ecd0e3310811261740s321f24a5mdc225c4adb5fcc32 () mail ! gmail ! com
[Download RAW message or body]

This is also the general case for why you can return a page name from
a event handler method, as well as a page instance or page class.

On Wed, Nov 26, 2008 at 6:35 PM, Thiago H. de Paula Figueiredo
<thiagohp@gmail.com> wrote:
> Em Tue, 25 Nov 2008 01:45:38 -0300, Henrik Schlanbusch <henrik@enovate.no>
> escreveu:
>
>> Hi Thiago
>
> Hi, Henrik!
>
> The pattern you're using makes a lot of sense. :) I just wasn't smart enough
> to find a problem that fitted your solution (getting a page through its
> name). . . :D
>
>> I am doing this because I have one controller in the
>> application that holds a
>> mapping between object types and page ids.
>> When I create an object of any type,
>> the system will ask the controller to get
>> a page that renders this object
>> correctly. If I do this through annotations
>> I have to have a page full of all
>> pages as annotated properties, and then add
>> these properties to a map where I
>> map object type and page, which is a bit
>> heavy I think. Now I have a spring
>> injected map that simply maps com.somepackage.
>> SomeObject->SomeObjectEditor. So
>> when an instance of SomeObject has been created,
>> I ask the map for the correct
>> editor (which returns the logical name of the page),
>> and set the object as a
>> model on that page before returning it from my
>> action method.
>>
>> Does that make sense to you? Maybe the pattern
>> isn't good? I do not know, but it
>> works. :-)
>>
>> Henrik
>>
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>
>
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java consultant, developer, and instructor
> Consultor, desenvolvedor e instrutor em Java
> http://www.arsmachina.com.br/thiago
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>



-- 
Howard M. Lewis Ship

Creator Apache Tapestry and Apache HiveMind

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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic