cancel
Showing results for 
Search instead for 
Did you mean: 

get an IPortalComponentRequest in an AbstractCollectionRenderer

Former Member
0 Kudos

Hi,

We have developed a custom collection renderer based on AbstractCollectionRenderer and we need to get the request.

In EP5 we have found this solution:

PortalServletRequestWrapper stubRequest = (PortalServletRequestWrapper) this.getProxy().getDynamicPage().getPageContext().getRequest();
IPortalComponentRequest request = (IPortalComponentRequest) stubRequest.getAttribute("com.sapportals.portal.prt.component.IPortalComponentRequest");

but now, in nw04 sp14 this code doesn't work because it generate a ClassCastException.

Any ideas?

Thank you in advance.

Accepted Solutions (0)

Answers (1)

Answers (1)

markusriedinger
Advisor
Advisor
0 Kudos

HI Francesco,

try

IResourceContext context= list.get(0).getContext();

Object o = context.getObjectValue("http://sapportals.com/xmlns/cm/httpservletrequest");

To get the Servlet Request. Unfortunatelly I do not know the objectValue for the portal component request.

Hope it helps anyway,

Cheers,

M.

Former Member
0 Kudos

Hi Markus,

thank you for your answer.

I solved the problem debugging the code.

My solution is:

IPortalComponentRequest request = (IPortalComponentRequest)this.getProxy().getDynamicPage().getPageContext().getRequest();