tags:

views:

400

answers:

2

I am trying to use the calendar component from Myfaces Tomahawk. I am running JSF 1.1 with Tomahawk 1.1.9 and Websphere 6.1. Looks like JSF1.1 and Tomahawk 1.1.9 are not compatible as the following code does not work -

<t:inputCalendar id="secondOne" monthYearRowClass="yearMonthHeader"
    weekRowClass="weekHeader" popupButtonStyleClass="standard_bold"
    currentDayCellClass="currentDayCell" value="#{dobBean.dateOfBirth}"
    renderAsPopup="true" popupTodayString="Shamik"
    popupDateFormat="MM/dd/yyyy" popupWeekString="Wk"
    helpText="MM/DD/YYYY" forceId="true" />

When access this jsp page thru IE 7, it throws some javascript problem like popupcalender not defined. I found that java scripts are added in the rendered HTML page, but no idea why this problem ?

Any idea which version of Tomahawk should I use with JSF 1.1 ?

EDIT:

I already have Extension Filter configured in the web.xml file. Something like this -

<filter>
    <filter-name>MyFacesExtensionsFilter</filter-name>
    <filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-class>
</filter>
<filter-mapping>
    <filter-name>MyFacesExtensionsFilter</filter-name>
    <!-- servlet-name must match the name of your javax.faces.webapp.FacesServlet entry -->
    <servlet-name>Faces Servlet</servlet-name>
</filter-mapping>
<filter-mapping>
    <filter-name>MyFacesExtensionsFilter</filter-name>
    <url-pattern>/faces/myFacesExtensionResource/*</url-pattern>
</filter-mapping>   
+1  A: 

Tomahawk is compatible with both JSF 1.1 and 1.2 (not with JSF 2.0 yet). The problem you're describing is recognizeable as not having the ExtensionsFilter properly configured in web.xml. Although the javadocs states that this is not needed anymore since Tomahawk 1.1.7, I would give it a try. Just define the ExtensionFilter in web.xml as per this document. It's namely responsible for injecting the necessary scripts/styles in the response.

<filter>
    <filter-name>MyFacesExtensionsFilter</filter-name>
    <filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-class>
</filter>
<filter-mapping>
    <filter-name>MyFacesExtensionsFilter</filter-name>
    <!-- servlet-name must match the name of your javax.faces.webapp.FacesServlet entry -->
    <servlet-name>Faces Servlet</servlet-name>
</filter-mapping>
BalusC
I had the extension filter in web.xml file. I can see the generated html has javascript in it, but it still does not work.
Shamik
Looks like something do with WebSphere.
Shamik
+1  A: 

I found the solution of this problem today. This is something to do with websphere 6.1. I found the following link where people faced similar problem like I am facting. As mentioned in the above link, I added a custom propery com.ibm.ws.webcontainer.invokefilterscompatibility=true in the websphere containter by following this link.

Shamik
+1: You're entirely right, it's a Websphere matter. I in fact already knew this particular issue, I've seen/read it before at other forums, but I unfortunately didn't realize/recall that immediately when I read your problem. By the way, you're free to post and **accept** your own answers.
BalusC