Calendar component is not working with Tabbed Pane
--------------------------------------------------
Key: TOMAHAWK-1130
URL: https://issues.apache.org/jira/browse/TOMAHAWK-1130
Project: MyFaces Tomahawk
Issue Type: Bug
Components: Calendar, Tabbed Pane
Affects Versions: 1.1.7-SNAPSHOT
Environment: Windows XP, IE 6.0 & Firefox 2.0, Apache-tomcat 6.0,
Reporter: Nirav Patel
Assume cal.jsp that renders calendar component. Below is the code snippet I
used to render it. It works fine when I invoke the page from IE/Firefox.
<t:inputCalendar id="registryCertificateDate"
value="#{propertyListMB.property.registryCertificateDate}" renderAsPopup="true"
popupTodayString="today is" popupDateFormat="MM/dd/yyyy" helpText="MM/DD/YYYY"
forceId="true"/>
After that I created tab.jsp that includes cal.jsp as one of its tab. Below is
the code snippet for it...
<t:panelTabbedPane serverSideTabSwitch="false">
<t:panelTab id="propListTab" label="#{propValMsg.propList}"
rendered="#{propertyValuationMB.propListVisible}" styleClass="pvsTabHeader">
<f:subview id="subview_propListTab">
<jsp:include page="cal.jsp" />
</f:subview>
</t:panelTab>
</t:panelTabbedPane>
Now, if I try to render tab.jsp on IE/Firefox it throws java-script error -
"org_apache_myfaces_PopupCalendar is undefined".
My debugging showed that generated HTML code includes required java scripts -
"calendar.HtmlCalendarRenderer/date.js" and
"HtmlCalendarRenderer/popcalendar.js" much after in the code before a reference
to one of its function [org_apache_myfaces_PopupCalendar()] is made. Hence, we
are getting java-script error.
But, if you set "serverSideTabSwitch" to "true", surprisingly, it resolves the
issue.
Further investigation showed that if I set "serverSideTabSwitch" to true, it
includes the required java scripts in the header info. Otherwise, it is not
included in header. Below are the snipped of generated HTML code...
When "serverSideTabSwitch" is set to "false"
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Building Valuation</title>
<link rel="stylesheet" type="text/css" href="../css/pvs-web.css" />
</head>
When "serverSideTabSwitch" is set to "true"
<head>
<link rel="stylesheet"
href="/PVS-PL/faces/myFacesExtensionResource/org.apache.myfaces.renderkit.html.util.MyFacesResourceLoader/11925166/tabbedpane.HtmlTabbedPaneRenderer/defaultStyles.css"
type="text/css" />
<link rel="stylesheet"
href="/PVS-PL/faces/myFacesExtensionResource/org.apache.myfaces.renderkit.html.util.MyFacesResourceLoader/11925166/calendar.HtmlCalendarRenderer/WH/theme.css"
type="text/css" />
<link rel="stylesheet"
href="/PVS-PL/faces/myFacesExtensionResource/org.apache.myfaces.renderkit.html.util.MyFacesResourceLoader/11925166/calendar.HtmlCalendarRenderer/DB/theme.css"
type="text/css" />
<script type="text/javascript"
src="/PVS-PL/faces/myFacesExtensionResource/org.apache.myfaces.renderkit.html.util.MyFacesResourceLoader/11925166/prototype.PrototypeResourceLoader/prototype.js">
<!-- // --></script>
<script type="text/javascript"
src="/PVS-PL/faces/myFacesExtensionResource/org.apache.myfaces.renderkit.html.util.MyFacesResourceLoader/11925166/calendar.HtmlCalendarRenderer/date.js">
<!--//--></script>
<script type="text/javascript"
src="/PVS-PL/faces/myFacesExtensionResource/org.apache.myfaces.renderkit.html.util.MyFacesResourceLoader/11925166/calendar.HtmlCalendarRenderer/popcalendar.js">
<!--//--></script>
<script type="text/javascript"
src="/PVS-PL/faces/myFacesExtensionResource/org.apache.myfaces.renderkit.html.util.MyFacesResourceLoader/11925166/inputTextHelp.HtmlTextHelpRenderer/inputTextHelp.js">
<!--//--></script>
<title>Property List</title>
<link rel="stylesheet" type="text/css" href="../css/pvs-web.css" />
<script language="javascript" src="../js/pvs-web.js"></script>
</head>
Though, I have temporarily fixed my probelm. But I would like to use
serverSideSwitch=false for better user experience. Would you please fix the
issue in libraries or show me some better work around?
Thanks,
Nirav.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.