Update jscript authored by Markus Krug's avatar Markus Krug
......@@ -216,4 +216,19 @@ Because you are reading your view from a file which is located within a jar, onc
}
```
This function reads the content of ```corefView.html```, ```corefView.css``` and ```corefView.js``` using an inputstream and IOUtils of apache.commons.io. Next, by using JSoup, a ```<script>``` and a ```<style>``` element is added to the header in order to integrate the styling and functions to your page.
\ No newline at end of file
This function reads the content of ```corefView.html```, ```corefView.css``` and ```corefView.js``` using an inputstream and IOUtils of apache.commons.io. Next, by using JSoup, a ```<script>``` and a ```<style>``` element is added to the header in order to integrate the styling and functions to your page.
## Executing a Java function using Javascript
Executing a Java function from within the html or another Javascript function is actually really comfortable. For this purpose we will call the ```createNewEntity()``` method of ```CorefView.java``` once a click on the according button is performed. This linking can be seen here:
```java
private void initEventHandler() {
//java function to create a new entity
//first row of buttons
new CorefViewParameterlessFunction(browser, "createEntity",controller::createNewEntity);
}
```