Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Scout » Heatmap click event
Heatmap click event [message #1810015] Mon, 29 July 2019 09:59 Go to next message
Tim Meuser is currently offline Tim MeuserFriend
Messages: 16
Registered: February 2019
Junior Member
Hi,

I implemented the heatmap demo (https://scout.bsi-software.com/widgets/?dl=widget-heatmapfield) and changed it to draw markers instead of heatpoints on the map. I can load my markers to the map without any problems.
Now, I want to create a new event. By clicking on a marker the id of the marker should be sent to the MapFieldForm to open a form.

The function in my javascript looks like this:
marker.on("click", function(e){
var id = e.target.id;
//TODO: send id 
});


The function in my form is then looking something like this:
public void markerClicked(String markerId) {
MarkerForm form = new MarkerForm();
form.setMarkerId(markerId);
form.edit();
}


I already tried to create a new event in the MapListener und sent the id json with a trigger function, but I didnt get it to work. The scout js documentation is not helping me alot because I am using the classic scout application with js.
Maybe there is a simpler way to directly access the method from my form in js.
Can someone give me an idea on how to deal with this problem?
Thanks in advance.

Re: Heatmap click event [message #1810019 is a reply to message #1810015] Mon, 29 July 2019 10:59 Go to previous messageGo to next message
Tim Meuser is currently offline Tim MeuserFriend
Messages: 16
Registered: February 2019
Junior Member
I could also think about adding a StringField to my MapFieldForm and then setting the value from the js. Is this the correct idea? How can I achieve this?
Re: Heatmap click event [message #1810173 is a reply to message #1810019] Fri, 02 August 2019 08:50 Go to previous message
Claudio Guglielmo is currently offline Claudio GuglielmoFriend
Messages: 256
Registered: March 2010
Senior Member
Hi Tim

If you want to introduce a new event, you need to send that event from the browser to the UI server. On server side, you need to accept the event and forward it to your field. This is done by the ModelAdapter.js on browser side and IJsonAdapter on server side. You can have a look at the existing adapters and try to trace the click event. To implement a new event ('e.g. markerClick'), just do it in the same way as it is done for the click event.

-> HeatmapField.js: this.trigger('markerClick')
-> HeatmapFieldAdapter.js: this._send('markerClick')
-> JsonHeatmapField.java: handleUiMarkerClick()
-> IHeatmapFieldUIFacade.java: handleMarkerClickFromUI
-> AbstractHeatmapField.java : execMarkerClick()
Previous Topic:Object from Database
Next Topic:embedding a PDF document as an object in the html code
Goto Forum:
  


Current Time: Fri Apr 26 12:40:44 GMT 2024

Powered by FUDForum. Page generated in 0.03786 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top