What's worse is that the PortletRequest MAY be an instanceof HttpServletRequest. Since PortletRequest is an interface, the only real way to tell for sure is to actually check for the PortletRequest you're looking for.

We have a utility in Trinidad (impl) which is called ExternalContextUtil and has an isPortlet(ExternalContext) method in it. This class successfully handles not having the portal classes in the classpath as well if you want to take a look at it.

Scott

Volker Weber wrote:
Hi Kristoff,

is tobago full working with your changes to the PageRenderer?

I don't know much about portlets, but there are many places with code
like this in tobago:

     // TODO PortletRequest
if (externalContext.getRequest() instanceof HttpServletRequest) {...}

From this i would expect a portletRequest is not a instanceof
HttpServletRequest,
and if so tobago won't work well.

Regards,
 Volker

2007/4/20, [EMAIL PROTECTED] <[EMAIL PROTECTED]>:

Hello :)

I think I found a solution for my problem.
What I did was: I wrote my own PageRenderer, substituting the body-element
for div and suchlike to make the resulting page conform to proper html.
Furthermore I moved the Tobago.init(...) call down to the bottom of the
page-fragment I created; for <DIV> does not provide me with the luxury of an onLoad-attribute and a init()-method called too early will fail in trying to
parse an incomplete DOM-Tree.
At the bottom of the page however the tree is mostly complete and it works
fine for me. (I don't know how generic the solution is though.)

I thought, I'd just let you know about that.

 Mit freundlichen Grüßen / kind regards

 Kristoff Kiefer

-----------------------------------------------------------------------------
 NORD/IT NORD/LB Informationstechnologie GmbH
 Geschäftsführer: Frerich-Weers Bremer, Volker Nagy
 HRB Nr. 58021, Amtsgericht Hannover
 www.nordlb-it.de

 Technologie- und  Informatik-Services  -  Softwareengineering
 Kaiserallee 9, D-30175 Hannover
 Fon: +49 511 / 361-9507

 mailto:[EMAIL PROTECTED]
 _____________________________________________

 Sicherheitshinweis http://www.nordlb-it.de/secure.html



[EMAIL PROTECTED] schrieb am 16.04.2007 16:16:59:

 >
 > Hello,
 >
 > I am trying to integrate a Tobago-JSF Page into a portlet. While
 > trying to do so I ran into a problem. The initial rendering of the
 > JSF-Page works just fine. However, clicking a tc:button makes
 > JavaScript throw an error. What I could gather from the page layout
 > and debug output of my browser is that the error is related to the
 > generated page content.
 > As far as I understand it, Tobago relies on Java-Script Code being
 > executed onLoad in the body tag of the generated page.
 > But according to specs portlets may not generate a body-element.
 [..]

Reply via email to