Need event in proper way in servoy backend from JS

Forum to discuss the new web client version of Servoy.

Need event in proper way in servoy backend from JS

Postby smilanshah » Tue Feb 13, 2018 1:31 pm

Hi

In our application we are using JS and consider that we have dropdown control and it's ondatachange event with argument say (oldValue, newValue, event)

Now from JS, event we need to pass in below way

var jsEvent = { svyType: 'JSEvent' }

but in backend, when onDatachangeEvent triggered at that time event.getElementName we are not getting any value into it.

So can you please let us know what is missing in above to get the elementName as well?
smilanshah
 
Posts: 18
Joined: Sat May 20, 2017 11:41 am

Re: Need event in proper way in servoy backend from JS

Postby mboegem » Tue Feb 13, 2018 2:14 pm

You can only get the elementName when it's really triggered by a form-element.
Better solution is to separate your logic, so it doesn't require the element name.
_____________________
Marc Boegem
Solutiative / JBS Group, Partner
• Servoy Certified Developer
• Servoy Valued Professional
• Freelance SAN Developer

Image
User avatar
mboegem
 
Posts: 1436
Joined: Sun Oct 14, 2007 1:34 pm
Location: Hoofddorp, The Netherlands

Re: Need event in proper way in servoy backend from JS

Postby sean » Tue Feb 13, 2018 7:26 pm

Are you using the NGClient or the classic WebClient ?
NGClient can support custom components which are data-bound
Software Engineer
Servoy USA
sean
 
Posts: 107
Joined: Mon May 21, 2007 6:26 pm
Location: USA

Re: Need event in proper way in servoy backend from JS

Postby jay.rao » Thu Feb 15, 2018 10:45 am

Fetching the proper element name from the component and pushing it to jsEvent would work fine.
jay.rao
 
Posts: 55
Joined: Mon Apr 10, 2017 1:32 pm


Return to Servoy NGClient

Who is online

Users browsing this forum: No registered users and 1 guest