Skip to content

Latest commit

 

History

History
32 lines (29 loc) · 647 Bytes

callCustomFunction.md

File metadata and controls

32 lines (29 loc) · 647 Bytes

Html: index.html

<!DOCTYPE html>
<html>
	<head>
	    <meta charset="UTF-8">
	    <title>Greencode</title>
	    <script>
	    	function customMethod() {
	    		alert("Teste");
	    	}
	    	
	    	function customMethodWithArgument(arg01) {
	    		alert(arg01);
	    	}
	    </script>
	</head>
	<body></body>
</html>

Java: IndexController.java

@Page(name="index", path="index.html")
public class IndexController extends Window {
    public void init(JRenderContext context) {
    	DOMHandle.execCommand(window, "customMethod");
    	DOMHandle.execCommand(window, "customMethodWithArgument", "Test Argument");    	
    }
}