Skip to Content
0

Retrigger values in a html mashup

Mar 02, 2017 at 02:42 PM

198

avatar image

Hello experts,

I am currently playing with the nokia here html + js mashup. There I have to fill the longitude and latitude to set markers on the map. There i managed to set my own values via some outports + scripts !before the mashup is loaded!. This works perfectly fine.

Please ignore where the upper marker is positioned, its just some testing.

For my issue:
Now I want to select the second row of my addresses and let the marker jump to the new position. Therefore I implemented the button show location. For testing purposes I only created a script in the eventhandler which changes the lat of the marker in the bo. After that I trigger the outport which is bound to the mashup. but nothing is happening after that.

Could someone please provide me with informations?

Here the script + the outport + the html code

Kind Regards,

Johannes

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

4 Answers

Best Answer
Johannes Schneider Mar 09, 2017 at 09:42 AM
0

Hello Diego,

with the javascript function "eval(String)" you can execute everything what is saved within a string.

In my HTML code in the function where i set individual amount of markers and add them to a group, i added 2 eval functions. Before the html mashup code is read, i set the values i need for the 2 parameters which then gets executed.


So what is with the zoom now?

Here i added a third eval function at the bottom of my html which is empty at the initial laod of the html mashup.

So after selecting the row where the map should zoom to, I add a script which fills the parameter ZoomLine1 with the needed code. The next problem is, that when once loaded the HTML Mashup offers no opportunity the be re-read or recognize changed values and executes them or sth. So I implemented in the eventhandler, which sets the data I need in parameter ZoomLine1, a script that simply changes an indicator from ture to false bevore the parameter is set. After the parameters is set and the map is ready to zoom (at the very end of the eventhandler) the indicator is set from false to true again. Now you simply have to bind the visibillity of the Mashup against the used indicator and et voilà, the map is zoomed to the selected entry.

Problematics:

  1. eval is a very dangerous function: If there is any way to replace the parameter entry besides the outports by the system like another js or something, things can get real dangerous because you can exectue excatly anything throughout this function.
  2. It does not look good: Because I had to make reload the whole HTML-mashup after selecting the row, you shortly get a white-screen which tells you that the map is loading. This is not very good looking but necessary because otherwise one is not able to see which point belongs to which entry in the DataList. If you have any other solutions to solve this problem kindly forward the to me.

Kind Regards,

Johannes Schneider


Share
10 |10000 characters needed characters left characters exceeded
Will Godsall Mar 03, 2017 at 12:32 PM
2

Hi Johannes,

Is the Javscript function addMarkersAndSetViewBounds executing when you fire the outport?

Thanks,

Will

Show 3 Share
10 |10000 characters needed characters left characters exceeded

Hi Will,

i dont know if any of the javascript functions are runnung when i fire the outport.

I'm currently not able to debug the js in the broswer so i'll never know.

The only thing i know is that if i feed the informations before the mashup is loaded it works and changing the parameters doesnt change anything.

Kind Regards,

Johannes

0
Hi Johannes,

If possible can you post all of the Javascript please?

Thanks,

Will

0

Hello Will,

I found out i can add eventhandler to the marker which then calls other functions I need.

This kind of solves my problem.

Kind Regards,

Johannes

0
Diego Simionato Mar 03, 2017 at 10:41 AM
1

Hello Joahnnes,

Did you tried to add your Event Handler to the Lead Selection Change Event ?

Data Model - Data List - Properties - OnLeadSelectionChange

Let me know if it works.

Regards.

Show 2 Share
10 |10000 characters needed characters left characters exceeded

Hello Diego,

i tried to implement the eventhandler as you mentioned but it does not seem to change anything.

For debug reasons i added a different eventhandler to see if the eventhandler is triggered by selecting a row and it works perfectly fine. Im pretty sure it has nothing to do with the standard sdk stuff but with the html mashup. The js functions somehow need to be retriggered but i have no clue how to manage that.

Kind Regards,

Johannes

0

Hi Johannes,

sorry but i can't help you with js.

I've also implemented a list to manage the import values for my html mashup, but sometimes the mashup load before the values. How did you resolve that ?

Regards.

0
Diego Simionato Mar 07, 2017 at 05:23 PM
0

Hi Johannes.

Can you explain how you achieved this requirement ? I'm stuck with a similar problem.

Thank you.

Share
10 |10000 characters needed characters left characters exceeded