Get the triggered object

Get the triggered object

  

In a mobile event how to get the this reference or the mouse target event? Like 

$(object).on('mousedown',function(event){

     $(this)

});

Hi Filipe,

I don't know what exactly you're trying to achieve, but "$(this)" returns a reference to the DOM element whose event was triggered.

Check this link for more information.

Yes but i am talking inside an outsystems action event

Could you please go into a bit more detail as to what exactly you're trying to do?

i am trying to get the mouse x y when you click in a div touchstart event

In your client action add a JavaScript element with two output parameters and the following code:

$parameters.X = event.touches[0].clientX;
$parameters.Y = event.touches[0].clientY;

Is this what you need?

yes but event is something inside the function, have you sure?

Solution

Yes, it works. I always test code samples before posting them   


Solution

No , it doesnt. event is undefined

Hi Filipe,

Are you using the Touch Events block from mobile patterns?

If you're using the event from the extend properties dropdown, I don't know a way of doing it.

If you want to see some use of these kind of events, this component has a lot of them.

You also have the Drag and Drop mobile, I bet they need to use those events/listeners to implement it. 

Hope it helps.

If you're using the event from the extend properties dropdown, I don't know a way of doing it.


me neither

Filipe,

Here's a sample OML. Is this not what you need?

you're right Aurelio. I was getting undefined inside one timeout function inside the same javascript block. you deserve the mark as solution