A
Anuradha Uduwage
Hi I have the following jsp page (I am only putting the area which is
relevant for this question) that use custom jsp tags. What I want to
do is change the window title based on the value that I get from the
properties file.
JSP File
<%@ include file="/netmarkets/jsp/util/beginPopup.jspf"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://someDotCome/windchill/taglib/components"
prefix="jca"%>
<%@ taglib uri="http://someDotCome/taglib/core" prefix="wc"%>
<%@ taglib uri="http://someDotCome/taglib/fmt" prefix="fmt"%>
....
....
<fmt:message var="tableLabel" key="<
%=partReportsRB.MULTI_LEVEL_BOM_LABEL%>" />
var tableLabel has the Window title that I want to appear in the
window title. So I created the following javascript to be added into
the above jspfile
<%-- Set window title based on rbinfo value --%>
<script language="javascript" type="text/javascript">
window.document.title = "${tableLabel}";
</script>
Above method works fine and it does what I want but, I want to make it
more developer friendly. Instead of adding this Javascript segment
into multiple jsp page I want to create a javascript file and include
that in the jsp file. But I want use the tableLabel variable. I am not
sure how I accomplish this.
I add above script into javascript function,
//Set Window title for the report based on the RbInfo data.
// do i need to add a path to the jsp file..?
function setWindowTitle() {
var rbinfoValue = document.getElementById("var");
window.document.title = rbinfoValue;
}
But I dont this is the correct.
Any help would be greatly appreciated.
Thanks,
Anuradha
relevant for this question) that use custom jsp tags. What I want to
do is change the window title based on the value that I get from the
properties file.
JSP File
<%@ include file="/netmarkets/jsp/util/beginPopup.jspf"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://someDotCome/windchill/taglib/components"
prefix="jca"%>
<%@ taglib uri="http://someDotCome/taglib/core" prefix="wc"%>
<%@ taglib uri="http://someDotCome/taglib/fmt" prefix="fmt"%>
....
....
<fmt:message var="tableLabel" key="<
%=partReportsRB.MULTI_LEVEL_BOM_LABEL%>" />
var tableLabel has the Window title that I want to appear in the
window title. So I created the following javascript to be added into
the above jspfile
<%-- Set window title based on rbinfo value --%>
<script language="javascript" type="text/javascript">
window.document.title = "${tableLabel}";
</script>
Above method works fine and it does what I want but, I want to make it
more developer friendly. Instead of adding this Javascript segment
into multiple jsp page I want to create a javascript file and include
that in the jsp file. But I want use the tableLabel variable. I am not
sure how I accomplish this.
I add above script into javascript function,
//Set Window title for the report based on the RbInfo data.
// do i need to add a path to the jsp file..?
function setWindowTitle() {
var rbinfoValue = document.getElementById("var");
window.document.title = rbinfoValue;
}
But I dont this is the correct.
Any help would be greatly appreciated.
Thanks,
Anuradha