I’m developing an Solution.
In that solution the user can call a function onRightClick-Event of specific fields.
RightClick is - as far as I know - not available on an iPad.
Is there an alternative to call a function on an iPad for a field?
One option could be to call that function onAction on the assosiated Label.
But on one Form I have a matrix of 6 x 4 fields. And here I have no labels for those fields but I need to call that Function.
Hope somebody has an idea / solution.
Harro
I experimented with this a while back:
Have a look at https://github.com/eightmedia/hammer.js
You’d need that and the webclient utils plugin… you’d have to register the listeners at runtime, and then register a callback to listen for that event.
the “Hold” event works sort of like a right click, press and hold for x seconds and then it will fire an event with the x y coordinates of the event
etc.
Perhaps as Servoy 7 is mobile focused we could file a feature request to have a long press on a touch device interpreted as a servoy right click?
Update: Here’s a code snippet : plop it in an empty text document, and save it somewhere in the application_server/server/webapps/ROOT directory
var SERVOY_MULTITOUCH = new function(){
this.HammerTime = null;
this.Environment = new function(){
//set the root path of where this file lives
this.basePath = "../innit_app/assets/js/",
//initialize multitouch
this.init = function(){
//get the hammer.js file
$.getScript(SERVOY_MULTITOUCH.Environment.basePath + "hammer.js/dist/hammer-latest.js", function(){
//get the hammer.js jquery plugin
$.getScript(SERVOY_MULTITOUCH.Environment.basePath + "hammer.js/plugins/jquery.hammer.js", function(){
//log to the client-side console - use chrome web inspector to see this
console.log('InnitMultitouch Initialized')
//create a new Hammer for any button elements - you could also use $('body'), etc.
this.HammerTime = $(':button').hammer();
//bind to the long-press mulitouch event
this.HammerTime.on('hold',function(event){
//stop the default event action
event.stopPropagation();
//trigger the context menu (right-click) action on the button element
$(event.target).trigger('contextmenu');
});
});
return true;
});
}
}
var INNIT_MT_instance = this;
};
just fire the plugins.WebClientUtils.executeClientSideJS(‘path/to/the/file.js’) somewhere in your solution onopen method