Getting a page context in a embedded component

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Getting a page context in a embedded component

bhorvat
Hi all,

What is the best way to let the component on same page know what was the
context used on that page?

I have a Header like component that should mark the page that is selected,

As not all pages have context I would like to avoid passing context to the
component directly if possible.

I could use the Request to get the full URL and then parse it, but was
wondering if there was any other way?

Thanks
Reply | Threaded
Open this post in threaded view
|

Re: Getting a page context in a embedded component

Ilya Obshadko-2
you may @Inject ComponentEventLinkEncoder and then

PageRenderRequestParameters requestParams =
componentLinkEncoder.decodePageRenderRequest(request)

requestParams.getActivationContext() will give you what you want


On Sun, Jan 25, 2015 at 6:45 PM, Boris Horvat <[hidden email]>
wrote:

> Hi all,
>
> What is the best way to let the component on same page know what was the
> context used on that page?
>
> I have a Header like component that should mark the page that is selected,
>
> As not all pages have context I would like to avoid passing context to the
> component directly if possible.
>
> I could use the Request to get the full URL and then parse it, but was
> wondering if there was any other way?
>
> Thanks
>



--
Ilya Obshadko