Calling AJAX to database using java script

Hi, How do call an ajax to a database using java script to get the suggestions for a textbox(particular attribute) in mendix.
2 answers

Hi Laxman,

You can not (and should not) communicate directly with your database from javascript (how would you securely store the DB password??). Instead all communication should go via the mendix runtime server.

If you want a textbox with suggestions you should take a look at the Auto Complete widget . We use it and it works really nice, might help you with your requirement.



Hi Laxman, 

What you are looking to do could be achieved in a couple of ways within the Mendix client side api:

within the API you can use

in order to GET an object from the database for example, or you could use action in order to call a microflow. 

these are generally the normal ways of performing retrieves via a javascript widget within mendix. 


hope this helps.