cancel
Showing results for 
Search instead for 
Did you mean: 

Retrigger values in a html mashup

JOSC_ITLAB
Participant
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

JOSC_ITLAB
Participant
0 Kudos

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

Answers (3)

Answers (3)

Former Member

Hi Johannes,

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

Thanks,

Will

JOSC_ITLAB
Participant
0 Kudos

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

Former Member
0 Kudos
Hi Johannes,

If possible can you post all of the Javascript please?

Thanks,

Will

JOSC_ITLAB
Participant
0 Kudos

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

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.

JOSC_ITLAB
Participant
0 Kudos

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 Kudos

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 Kudos

Hi Johannes.

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

Thank you.