In my XSL, I am calling a Javascript method. From this Javascript method, I need to call a Java method. Please let me know how to do this.
If I simply write this in javascript
java_func_1:fileViewer('09
00054d8000
cf8e');
it does not work
xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:java_func="com.common.utils.SUtils"
xmlns:java_func_1="com.components.detailedView.FkDetailedView"
extension-element-prefixes="java_func java_func_1" version="2.0">
....
<xsl:template match="/">
<html>
<head>
<script language="javascript">
<![CDATA[
function displayFile() {
alert("works");
java_func_1:fileViewer('0900054d8000cf8e');
}
]]>
</script>
</head>
<body>
<xsl:apply-templates />
</body>
</html>
</xsl:template>
...
...
<tr class="row1">
<td>
<xsl:for-each select="fb_holder/attached_files/file_details">
<a href="#" onclick="javascript:displayFile();"><xsl:value-of select="file_name"/></a><br/>
</xsl:for-each>
</td>
</tr>
Select all Open in new window
But i need to call Java from a Javascript method