struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "fea jabi" <zy...@hotmail.com>
Subject struts and javascript
Date Thu, 13 Apr 2006 13:14:17 GMT
In a JS file I created a function as below.

function showPopup(htmlRewrite) {
var w = 480, h = 340;

if (document.all || document.layers) {
w = screen.availWidth;
h = screen.availHeight;
}

var popW = 200, popH = 100;
var leftPos = (w-popW)/2, topPos = (h-popH)/2;

window.open( 'htmlRewrite', "", "resizable, toolbar=yes, statusbar=yes, 
menubar=yes, status=yes, location=yes, scrollbars=yes", 'width=' + popW + 
',height=' + popH + ',top=' + topPos + ',left=' + leftPos);
}

But getting error at the select statement below. how to call the above 
function??

<html:select name="Form1" property="typeselected" 
onchange='showPopup("<html:rewrite action="/PrepareSchedule.do"/>");'>
<htmlptions collection="typeList" property="value" labelProperty="label"/>
</html:select>

*********************************************************

Was working fine when I had the js function in the jsp itself. i.e it was 
working fine with below code

function showPopup() {
var w = 480, h = 340;

if (document.all || document.layers) {
w = screen.availWidth;
h = screen.availHeight;
}

var popW = 200, popH = 100;
var leftPos = (w-popW)/2, topPos = (h-popH)/2;

window.open('<html:rewrite action="/PrepareSchedule.do"/>', "", "resizable, 
toolbar=yes, statusbar=yes, menubar=yes, status=yes, location=yes, 
scrollbars=yes", 'width=' + popW + ',height=' + popH + ',top=' + topPos + 
',left=' + leftPos);
}
</script>



<html:select name="Form1" property="typeselected" onchange='showPopup();'>
<htmloptions collection="typeList" property="value" labelProperty="label"/>
</html:select>


But now trying to have a common function in the js file and pass an argument 
for the url it has to go to.

what's is the right way of doing this?

Thanks.

_________________________________________________________________
Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ 
Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963


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


Mime
View raw message