Sandro,

Sigh..  I'm beginning to sound like a broken record.  Setting the
doFilterCalled attribute just makes the famework THINK the filter has been
called, it does NOT actually perform the logic.  Filters cannot run in a
portlet environment (well they CAN on some portals, but this is more an
implementation detail then anything else).  There are three options for
fixing this.

1. Us a system like the Trinidad Configurators to execute before and end
request processing outside of a filter.  Yes, there will be a commons
version of the configurators once I actually get the time to commit it.

2. You can override the MyFacesGenericPortlet (or in JSR-301 the
GenericFacesPortlet) to do your filter logic BEFORE executing Faces.  You
actually need to do the logic though, not just set the attribute.

3. You can use JSR-286 filters and devise some sort of mechanism (most
likely using a system like #1) to activate the filter logic when you
actually have a faces request.

Scott



On Thu, Apr 24, 2008 at 5:27 AM, Sandro Röder (JIRA) <[email protected]>
wrote:

> calendar in portlet
> -------------------
>
>                 Key: TOMAHAWK-1239
>                 URL: https://issues.apache.org/jira/browse/TOMAHAWK-1239
>             Project: MyFaces Tomahawk
>          Issue Type: Bug
>          Components: Calendar
>    Affects Versions: 1.1.5
>         Environment: Pluto Portal
>            Reporter: Sandro Röder
>
>
> Hi,
>
> i try to create a popupcalendar with the tag t:inputCalendar in a portlet.
> There were two errors:
> 1.
> The portlet page dosent open. The error was "The Extensionfilter is not
> configured correctly....".
> But the Page was opened if i use the same page in a normal web
> application.
> I could fix this problem after i created a Portlet which extends the
> MyFacesGenericPortlet. I entered the folowing line to the render Method
> before I call the super.render:
> request.setAttribute("org.apache.myfaces.component.html.util.ExtensionFilter.doFilterCalled",
> "org.apache.myfaces.component.html.util.ExtensionFilter.doFilterCalled");
>
> Full Method:
>
> public void render(RenderRequest request, RenderResponse response)
>                        throws PortletException, IOException {
>        // This is a bugfix for tomahwk extension in portlet
>
>  
> request.setAttribute("org.apache.myfaces.component.html.util.ExtensionFilter.doFilterCalled",
> "org.apache.myfaces.component.html.util.ExtensionFilter.doFilterCalled");
>        super.render(request, response);
> }
>
> 2.)
> After i solve the previus error there was another one.
> I got javascript errors after i pressed the calendar-popup key. The main
> reason was tomahawk could not add his javascript files to the page, because
> portletsites haven't  a <head> tag.
> I solve this problem: I add the following lines to the page where the
> popupcalendar is rendered:
>        <link rel="stylesheet"
> href="<%=renderResponse.encodeURL(renderRequest.getContextPath())%
>
> >/faces/extensionResource/org.apache.myfaces.renderkit.html.util.MyFacesResourceLoader/12087850/calendar.HtmlCalendarRenderer/WH/theme.css"
> type="text/css" />
>         <link rel="stylesheet"
> href="<%=renderResponse.encodeURL(renderRequest.getContextPath())%
>
> >/faces/extensionResource/org.apache.myfaces.renderkit.html.util.MyFacesResourceLoader/12087850/calendar.HtmlCalendarRenderer/DB/theme.css"
> type="text/css" />
>         <script type="text/javascript"
> src="<%=renderResponse.encodeURL(renderRequest.getContextPath())%
>
>  
> >/faces/extensionResource/org.apache.myfaces.renderkit.html.util.MyFacesResourceLoader/12087850/prototype.PrototypeResourceLoader/prototype.js">
>          </script>
>          <script type="text/javascript"
> src="<%=renderResponse.encodeURL(renderRequest.getContextPath())%
>
>  
> >/faces/extensionResource/org.apache.myfaces.renderkit.html.util.MyFacesResourceLoader/12087850/calendar.HtmlCalendarRenderer/date.js">
>         </script>
>         <script type="text/javascript"
> src="<%=renderResponse.encodeURL(renderRequest.getContextPath())%
>
> >/faces/extensionResource/org.apache.myfaces.renderkit.html.util.MyFacesResourceLoader/12087850/calendar.HtmlCalendarRenderer/popcalendar.js">
>        </script>
>        <script type="text/javascript"
> src="<%=renderResponse.encodeURL(renderRequest.getContextPath())%
>
>  
> >/faces/extensionResource/org.apache.myfaces.renderkit.html.util.MyFacesResourceLoader/12087850/inputTextHelp.HtmlTextHelpRenderer/inputTextHelp.js">
>        </script>
>
> ....and it works fine
>
> Thanks.
>
> --
> This message is automatically generated by JIRA.
> -
> You can reply to this email to add a comment to the issue online.
>
>

Reply via email to