on 04-22-2015 7:27 PM
I haven't been able to get the GeoMap to fire a click events. Has anyone been able to get this to work or is this a bug? See simple MVC example below:
Thx
//** ScnMain.controller.js
sap.ui.controller("scn.ScnMain", { });
//** ScnMain.view.js
function clickFunction(ev) {
console.log("clickFunction ev="+ev);
};
sap.ui.jsview("scn.ScnMain", {
getControllerName : function() { return "scn.ScnMain"; },
createContent : function(oController) {
var oLayout = sap.ui.commons.layout.VerticalLayout("appLayout", { width: "100%" });
oLayout.addContent(new sap.ui.commons.ApplicationHeader("appHeader"));
var gm = new sap.ui.vbm.GeoMap();
gm.attachClick(clickFunction);
oLayout.addContent(gm);
return oLayout;
}
});
//** index.html
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv='Content-Type' content='text/html;charset=UTF-8' />
<script src="resources/sap-ui-core.js" id="sap-ui-bootstrap"
data-sap-ui-libs="sap.ui.commons" data-sap-ui-theme="sap_bluecrystal"></script>
<script>
sap.ui.localResources("scn");
var view = sap.ui.view({id:"idScnMain1", viewName:"scn.ScnMain", type:sap.ui.core.mvc.ViewType.JS});
view.placeAt("content");
}
</script>
</head>
<body class="sapUiBody" role="application">
<div id="content"></div>
</body>
</html>
Joseph - I agree that information on SDK is misleading, JsDoc Report - SAP UI development Toolkit for HTML5 - API Reference - sap.ui.vbm.GeoMap
I was able to attach "click" event only to GeoMap aggregations. Beside to that I also have checked GeoMap-dbg.js https://sapui5.hana.ondemand.com/sdk/resources/sap/ui/vbm/GeoMap-dbg.js and click event is not defined and as result nothing happen when you click on the Map itself.
Here you can see how click is working, please click on Pin Element
JS Bin - Collaborative JavaScript Debugging
And here Visual Business UI5 Tests Index you can find more examples with VBI
Cheers
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So I have debugged VBI libs and managed to get mouse position on mouse click. See here - JS Bin - Collaborative JavaScript Debugging
gm.attachBrowserEvent("click",function(event){
});
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.