You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Barry Books <tr...@gmail.com> on 2013/08/24 16:55:48 UTC

Problem getting page's messages

I've got a mixin that needs access to the page messages. The problem is the
mixin ends up on a component that's in a BeanEditForm so I end up with the
messages for my AppPropertyEditBlocks page. If I do this

@Inject

*private* ComponentResources resources;


@BeginRender

*void* beginRender() {

logger.info("page {}", resources.getPageName());

}


The page name returned is AppProperyEditBlocks. After thinking about it I
suppose that makes sense but it's not really what I want.



Is there a way to get the "Real" page messages?

Re: Problem getting page's messages

Posted by Barry Books <tr...@gmail.com>.
I'll answer my own question:

It's possible to get the correct messages from the PropertyEditContext, so
the Mixin can check to see if there is one and if so use it otherwise use
the messages from the ComponentResources.


On Sat, Aug 24, 2013 at 9:55 AM, Barry Books <tr...@gmail.com> wrote:

> I've got a mixin that needs access to the page messages. The problem is
> the mixin ends up on a component that's in a BeanEditForm so I end up with
> the messages for my AppPropertyEditBlocks page. If I do this
>
> @Inject
>
> *private* ComponentResources resources;
>
>
> @BeginRender
>
> *void* beginRender() {
>
> logger.info("page {}", resources.getPageName());
>
> }
>
>
> The page name returned is AppProperyEditBlocks. After thinking about it I
> suppose that makes sense but it's not really what I want.
>
>
>
> Is there a way to get the "Real" page messages?
>