You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-user@portals.apache.org by Gaurav Goel <sa...@gmail.com> on 2006/06/28 13:06:51 UTC

not working properly in portlets

Hi,
I m using the latest tomahawk 1.1.3, MyFaces-core 1.1.3 and have configured
the extensions filter for using <t:inputDate> component.Though i can see the
text boxes, I cannot view the pop up button.This works fine as a stand alone
application.Is the issue due to non compatibility of portlets and extensions
filter???Or am i missing something??Here is my web.xml and the JSF page
code....
=============================================================
<%@ page session="true" contentType="text/html;charset=utf-8"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>

<html>
<head>
<title>Booking Status</title>
</head>
<body>

<f:view>
    <f:loadBundle basename="com.arrkgroup.conference.resources.room-status"
        var="book_room" />
    <h:form id="example">
        <h:panelGrid id="roomStatusPanelGrid1" columns="2" align="center">
            <h:inputText id="firstName" value="#{bookStatusFormBean.date}">
            </h:inputText>
            <h:outputText id="roomStatusDate" value="#{book_room['
status.date']}" />
            <t:inputDate id="date1" value="#{bookStatusFormBean.date}"
                popupCalendar="true">
                <f:convertDateTime pattern="dd/MM/yyyy" />
            </t:inputDate>
            <h:outputText id="roomStatusRoom" value="#{book_room['
status.room']}" />
            <h:selectOneMenu id="roomstatusSelectRoom"
                value="#{bookStatusFormBean.roomNo}">
                <f:selectItems id="roomstatusSelectItemsRoom"
                    value="#{roomList.roomNo}" />
            </h:selectOneMenu>
            <h:commandButton id="submitRoomStatus"
                value="#{book_room['status.submit']}"
                action="#{bookStatusFormBean.updateDateRoom }">
            </h:commandButton>
        </h:panelGrid>
        <t:popup closePopupOnExitingElement="true"
            closePopupOnExitingPopup="true" displayAtDistanceX="10"
            displayAtDistanceY="10">
            <h:outputText value="This is the second textual text situation."
/>
            <f:facet name="popup">
                <h:panelGroup>
                    <h:panelGrid columns="1">
                        <h:outputText value="Popup Text " />
                    </h:panelGrid>
                </h:panelGroup>
            </f:facet>
        </t:popup>
    </h:form>

    <h:form id="bookStatusForm2">
        <h:messages globalOnly="true" style="color:#FF0000" />
        <h:panelGrid id="roomStatusPanelGrid2" columns="4" border="0"
            align="center">
            <h:outputText id="label" value="Booking Status  " />
            <h:outputText id="rooomStatusDateValue1"
                value="#{bookStatusFormBean.date}" />
            <h:outputText id="blank" value=" " />
            <h:outputText id="roomStatusRoomValue1"
                value="#{bookStatusFormBean.roomNo}" />
        </h:panelGrid>
        <t:dataTable id="data" styleClass="portlet"
            headerClass="portlet-table-header"
footerClass="portlet-table-footer"
            rowClasses="portlet-table-row1,portlet-table-row2"

columnClasses="book-room-view-date,book-room-view-day,book-room-view-room,book-room-view-from

book-room-view-to,book-room-view-remarks,book-room-view-bookedby,book-room-view-projects,book-room-view-cancel"
            var="conference" value="#{bookStatusList.bookingStatus}"
            preserveDataModel="true">

            <h:column>
                <f:facet name="header">
                    <h:outputText id="roomStatusDateHeader"
                        value="#{book_room['status.date']}" />
                </f:facet>
                <h:outputText id="roomStatusDateValue2" value="#{
conference.date}">
                </h:outputText>
            </h:column>

            <h:column>
                <f:facet name="header">
                    <h:outputText id="roomStatusDayHeader"
                        value="#{book_room['status.day']}" />
                </f:facet>
                <h:outputText id="roomStatusDayValue" value="#{
conference.day}">
                </h:outputText>
            </h:column>

            <h:column>
                <f:facet name="header">
                    <h:outputText id="roomStatusRoomHeader"
                        value="#{book_room['status.room']}" />
                </f:facet>
                <h:outputText id="roomStatusRoomValue2" value="#{
conference.roomNo}">
                </h:outputText>
            </h:column>
            <h:column>
                <f:facet name="header">
                    <h:outputText id="roomStatusFrom"
                        value="#{book_room['status.from']}" />
                </f:facet>
                <h:outputText id="roomStatusFromValue"
                    value="#{conference.fromTime}">
                    <f:convertDateTime type="time" />
                </h:outputText>
            </h:column>
            <h:column>
                <f:facet name="header">
                    <h:outputText id="roomStatusTo" value="#{book_room['
status.to']}" />
                </f:facet>
                <h:outputText id="roomStatusToValue" value="#{
conference.toTime}">
                </h:outputText>
            </h:column>

            <h:column>
                <f:facet name="header">
                    <h:outputText value="#{book_room['status.remarks']}" />
                </f:facet>
                <h:outputText value="#{conference.remarks}" />
            </h:column>

            <h:column>
                <f:facet name="header">
                    <h:outputText value="#{book_room['status.bookedBy']}" />
                </f:facet>
                <h:outputText value="#{conference.firstName}" />
                <h:outputText value=" " />
                <h:outputText value="#{conference.lastName}" />
            </h:column>

            <h:column>
                <f:facet name="header">
                    <h:outputText value="#{book_room['status.project']}" />
                </f:facet>
                <h:outputText value="#{conference.projectName}" />
            </h:column>

            <h:column>
                <f:facet name="header">
                    <h:outputText value="#{book_room['status.cancel']}" />
                </f:facet>
                <h:commandLink action="#{bookStatusList.cancelBooking}">
                    <h:outputText value="cancel" />
                    <t:updateActionListener value="#{conference.roomNo}"
                        property="#{bookStatusList.room
}"></t:updateActionListener>
                    <t:updateActionListener value="#{conference.fromTime}"
                        property="#{bookStatusList.fromTime
}"></t:updateActionListener>
                    <t:updateActionListener value="#{conference.date }"
                        property="#{bookStatusList.bookingDate
}"></t:updateActionListener>
                    <t:updateActionListener value="#{conference.employeeId}"
                        property="#{bookStatusList.empId
}"></t:updateActionListener>
                </h:commandLink>
            </h:column>
        </t:dataTable>
    </h:form>
</f:view>
</body>
</html>
=====================================================================

WEB.XML

<?xml version="1.0" encoding="UTF-8"?>
<web-app id="conference-room" version="2.4"
    xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
    <display-name>Conference Room</display-name>
    <context-param>
        <param-name>
            org.apache.myfaces.CHECK_EXTENSIONS_FILTER
        </param-name>
        <param-value>false</param-value>
    </context-param>
    <context-param>
        <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
        <param-value>server</param-value>
    </context-param>
    <context-param>
        <param-name>javax.faces.application.CONFIG_FILES</param-name>
        <param-value>/WEB-INF/faces-config.xml</param-value>
    </context-param>
    <context-param>
        <description>
            This parameter tells MyFaces if javascript code should be
            allowed in the rendered HTML output. If javascript is
            allowed, command_link anchors will have javascript code that
            submits the corresponding form. If javascript is not
            allowed, the state saving info and nested parameters will be
            added as url parameters. Default: "true"
        </description>
        <param-name>org.apache.myfaces.ALLOW_JAVASCRIPT</param-name>
        <param-value>true</param-value>
    </context-param>
    <context-param>
        <description>
            This parameter tells MyFaces if javascript code should be
            allowed in the rendered HTML output. If javascript is
            allowed, command_link anchors will have javascript code that
            submits the corresponding form. If javascript is not
            allowed, the state saving info and nested parameters will be
            added as url parameters. Default: "false"

            Setting this param to true should be combined with
            STATE_SAVING_METHOD "server" for best results.

            This is an EXPERIMENTAL feature. You also have to enable the
            detector filter/filter mapping below to get JavaScript
            detection working.
        </description>
        <param-name>org.apache.myfaces.DETECT_JAVASCRIPT</param-name>
        <param-value>false</param-value>
    </context-param>
    <context-param>
        <description>
            If true, rendered HTML code will be formatted, so that it is
            "human readable". i.e. additional line separators and
            whitespace will be written, that do not influence the HTML
            code. Default: "true"
        </description>
        <param-name>org.apache.myfaces.PRETTY_HTML</param-name>
        <param-value>true</param-value>
    </context-param>
    <context-param>
        <description>
            If true, a javascript function will be rendered that is able
            to restore the former vertical scroll on every request.
            Convenient feature if you have pages with long lists and you
            do not want the browser page to always jump to the top if
            you trigger a link or button action that stays on the same
            page. Default: "false"
        </description>
        <param-name>org.apache.myfaces.AUTO_SCROLL</param-name>
        <param-value>true</param-value>

    </context-param>
    <!-- Extensions Filter -->
    <filter>
        <filter-name>extensionsFilter</filter-name>
        <filter-class>
            org.apache.myfaces.component.html.util.ExtensionsFilter
        </filter-class>
        <init-param>
            <description>
                Set the size limit for uploaded files. Format: 10 - 10
                bytes 10k - 10 KB 10m - 10 MB 1g - 1 GB
            </description>
            <param-name>uploadMaxFileSize</param-name>
            <param-value>100m</param-value>
        </init-param>
        <init-param>
            <description>
                Set the threshold size - files below this limit are
                stored in memory, files above this limit are stored on
                disk.

                Format: 10 - 10 bytes 10k - 10 KB 10m - 10 MB 1g - 1 GB
            </description>
            <param-name>uploadThresholdSize</param-name>
            <param-value>100k</param-value>
        </init-param>
    </filter>

    <!-- Filter Mappings -->
    <filter-mapping>
        <filter-name>extensionsFilter</filter-name>
        <url-pattern>*.jsf</url-pattern>
    </filter-mapping>
    <filter-mapping>
        <filter-name>extensionsFilter</filter-name>
        <url-pattern>/faces/*</url-pattern>
    </filter-mapping>



    <!-- Listener, that does all the startup work (configuration, init). -->
    <listener>
        <listener-class>
            org.apache.myfaces.webapp.StartupServletContextListener
        </listener-class>
    </listener>

    <!-- Faces Servlet -->
    <servlet>
        <servlet-name>Faces Servlet</servlet-name>
        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>

    <!-- Jetspeed Servlet -->
    <servlet>
        <description>
            MVC Servlet for Jetspeed Portlet Applications
        </description>
        <display-name>Jetspeed Container</display-name>
        <servlet-name>JetspeedContainer</servlet-name>
        <servlet-class>
            org.apache.jetspeed.container.JetspeedContainerServlet
        </servlet-class>
        <init-param>
            <param-name>contextName</param-name>
            <param-value>conference-room</param-value>
        </init-param>
        <load-on-startup>0</load-on-startup>
    </servlet>

    <!-- servlet mapping -->
    <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>*.jsf</url-pattern>
    </servlet-mapping>

    <servlet-mapping>
        <servlet-name>JetspeedContainer</servlet-name>
        <url-pattern>/container/*</url-pattern>
    </servlet-mapping>

    <welcome-file-list>
        <welcome-file>index.html</welcome-file>
        <welcome-file>index.htm</welcome-file>
        <welcome-file>index.jsp</welcome-file>
        <welcome-file>default.html</welcome-file>
        <welcome-file>default.htm</welcome-file>
        <welcome-file>default.jsp</welcome-file>
    </welcome-file-list>
</web-app>
============================================================================

-- 
Thanks and regards,
Gaurav Goel.

Re: not working properly in portlets

Posted by MarineW <ma...@gmail.com>.
Hello,


gaurav goel-2 wrote:
> 
> Hi,
> I m using the latest tomahawk 1.1.3, MyFaces-core 1.1.3 and have
> configured
> the extensions filter for using <t:inputDate> component.Though i can see
> the
> text boxes, I cannot view the pop up button.This works fine as a stand
> alone
> application.Is the issue due to non compatibility of portlets and
> extensions
> filter???Or am i missing something??Here is my web.xml and the JSF page
> code....
> 

I also have the same problem with Tomahawk ExtensionsFilter.

My Webapp works well as a standalone application. But when I use it as a
portlet (in Liferay Portal) with Apoche Portals JSF bridge, the
ExtensionFilter does not work correctly :

16:09:21,609 ERROR [liferay.portlet.PortletRequestDispatcherImpl]
org.apache.jasper.JasperException:
ExtensionsFilter not correctly configured. JSF mapping missing. JSF pages
not covered. Please see:
http://myfaces.apache.org/tomahawk/extensionsFilter.html
org.apache.jasper.JasperException: ExtensionsFilter not correctly
configured. JSF mapping missing. JSF pages not covered. Please see:
http://myfaces.apache.org/tomahawk/extensionsFilter.html
       at
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:476)


Here is my web.xml file :

<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4"
	xmlns="http://java.sun.com/xml/ns/j2ee"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">

	<display-name>my-webapp</display-name>

	<context-param>
         (...)
	</context-param>

	<!-- DEBUT DECLARATIONS FILTRES -->

	<filter>
		<filter-name>MyFacesExtensionsFilter</filter-name>
		<filter-class>
			org.apache.myfaces.webapp.filter.ExtensionsFilter
		</filter-class>
		<init-param>
			<description>
				Set the size limit for uploaded files. Format: 10 - 10
				bytes 10k - 10 KB 10m - 10 MB 1g - 1 GB
			</description>
			<param-name>uploadMaxFileSize</param-name>
			<param-value>100m</param-value>
		</init-param>
		<init-param>
			<description>
				Set the threshold size - files below this limit are
				stored in memory, files above this limit are stored on
				disk.

				Format: 10 - 10 bytes 10k - 10 KB 10m - 10 MB 1g - 1 GB
			</description>
			<param-name>uploadThresholdSize</param-name>
			<param-value>100k</param-value>
		</init-param>
	</filter>
	
	<filter-mapping>
		<filter-name>MyFacesExtensionsFilter</filter-name>
		<url-pattern>*.jsf</url-pattern>
	</filter-mapping>
	
	<filter-mapping>
		<filter-name>MyFacesExtensionsFilter</filter-name>
		<url-pattern>/faces/*</url-pattern>
	</filter-mapping>

	<filter-mapping>
		<filter-name>MyFacesExtensionsFilter</filter-name>
		<url-pattern>/faces/myFacesExtensionResource/*</url-pattern>
	</filter-mapping>
	
	<!-- FIN DECLARATIONS FILTRES -->


	<!-- DEBUT DECLARATIONS SERVLETS -->

	<servlet>
		<servlet-name>Faces Servlet</servlet-name>
		<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
		<load-on-startup>1</load-on-startup>
	</servlet>

	<servlet-mapping>
		<servlet-name>Faces Servlet</servlet-name>
		<url-pattern>/faces/*</url-pattern>
	</servlet-mapping>

	<!-- FIN DECLARATIONS SERVLETS -->

	<welcome-file-list>
		<welcome-file>index.html</welcome-file>
		<welcome-file>index.htm</welcome-file>
		<welcome-file>index.jsp</welcome-file>
		<welcome-file>default.html</welcome-file>
		<welcome-file>default.htm</welcome-file>
		<welcome-file>default.jsp</welcome-file>
	</welcome-file-list>

	<listener>
		<listener-class>
			org.apache.myfaces.webapp.StartupServletContextListener
		</listener-class>
	</listener>

</web-app>
</code>


Any idea about this ?
Thanks.

-- 
View this message in context: http://www.nabble.com/%3Ct%3AinputDate%3E-not-working-properly-in-portlets-tf1860797.html#a12452955
Sent from the Jetspeed - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org