You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by dekar <pd...@tiaa-cref.org> on 2007/08/27 21:40:04 UTC

file save popup in javascript window

Hi, I dont know the source of this error but its really wierd error I think
the source is javascript/apacheconfig/struts. I am getting a save file popup
(TopicAction.do as the filename) when I click a button in a javascript
window.


I am trying to submit a form from a javascript window which invokes a
particular function from the corresponding action servlet (operation as the
parameter) (the content for window is populated using a jsp - topicpage.jsp)

something like when I click submit/save button the form on the window page
gets submitted. 

js files included in the jsp page
here is the structure of the jsp page:

String txtHTML = request.getAttribute("html")==null?"HTML not
found":request.getAttribute("html").toString();

//external js in topicpage.jsp
<script language="JavaScript"
src="<%=contextPath%>/docs/js/JumpToScreen.js"></script> 
//script which invokes the window........

<script language="JavaScript"
src="<%=contextPath%>/docs/js/DisplayTopic.js"></script>
script which contains the function markassubmit() - sets a string 
 <script language="JavaScript"
SRC="<%=contextPath%>/docs/js/showWaitMsg.js"></script>
<script language="Javascript">
function submitForm(page)
    {
        document.TopicForm.operation.value = page;
        //document.TopicForm.submit();
        return true;
    }

function updateParent() {
		opener.TopicHomeForm.operation.value = "refresh";
		opener.TopicHomeForm.submit(); 
    } 
</script>

</head>
<body BGcolor="" onLoad="updateParent(); document_init();" 
onUnLoad="updateParent();self.close(); "> 

<html:form action="/TopicAction.do" method="post">

<div>
    <%=txtHTML%> 
</div>
 

</html:form>
button: <INPUT ALT="Submit the Topic" onClick="return markAsSubmit();
submitForm('submit');" type="image"
src="">

function mark as submit inside displaytopic.js is as follows
var lastCmd = "";
function markAsSubmit() {
	 document.TopicForm.operation.value="submit";
	var _lastCmd = lastCmd;

	lastCmd = "submit";
	var rtn = submitTopic(this.TopicForm);

	if (rtn == false) {
		lastCmd = _lastCmd;
	}
	else {
		setupAction("Submitting Topic");
	}
	return rtn; 
} 

I am using Weblogic server on port 7001, apache services
here are details for the apache httpd.conf
<LocationMatch "/Encounter/(?!docs)">
            SetHandler weblogic-handler
            WebLogicHost DLKBFT9M.ad.tiaa-cref.org                 //my mac
name
            WebLogicPort 7001                                             
//port on which the encounter app is running
            Idempotent ON
            DebugConfigInfo ON
</LocationMatch>

DocumentRoot "C:/TiaaWebs/St01/Docs"  //all the js files are located here 

now when I click the submit button on the topicpage window I get a popup to
save file with following details:
Do you want to save the following file?
Name: TopicAction.do
Unknown File types
From: DLKBFT9M.ad.tiaa-cref.org

This error only occurs when I dont use the port in the apln URL (in shich
case the js file are taken from the war file in the build)

If I use the completed build with the js as part of the war package it run
perfect. I need to know what is causing the error..


-- 
View this message in context: http://www.nabble.com/file-save-popup-in-javascript-window-tf4337827.html#a12356216
Sent from the Struts - User mailing list archive at Nabble.com.


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