DMXzone Ajax Form replacement

Hello,
I need to replace an old dropdown menu created with DMXzone Ajax Form that allow to show on the same page the content associated with the items/names selected in the dropdown menu.

Example:

  1. dynamic records from a mysql view table;
  2. webpage with two columns;
  3. on the left column there is a dropdown menu with a list of cars (from database);
  4. on the right column the user see the details (from database) of the cars selected in the dropdown menu.

The behaviour is the same of this old example:
https://www.dmxzone.com/go/21205/dmxzone-ajax-form
https://www.dmxzone.com/go/21245/load-dymanic-galleries-on-demand

Which is the best procedure to replace it using Wappler?
Is there a tutorial about this?
Thanks.

Ajax form is subject of a feature request if you want to vote for it.

Hello Michele,
You don’t need such an extension (Ajax form) as our frontend tools show data without page refresh… You just add your dropdown as a filter in the server action/query and the data is filtered on change, without having to refresh the whole page.
That’s one of the many things that make front end frameworks like app connect great.

1 Like

So you filter the server connect query based on the content of the select field?
Filtering a table based on a text field I do all the time but don’t get how to filter a dynamically populated select field in the same way. Will have to have a play, maybe I’m missing something here. May have to drag myself out of bed I guess :wink:

It’s the same with text field or dropdown - you bind both to your get variable used to filter the data.

Ok, thanks Teodor.
Is there a quick guide to do it?

Yes:

  1. Here’s how to make a dynamic dropdown: Dynamic Select Menu
  2. Here’s how to filter a query using a text field: Filtering Database Query with a Text Input - for the dropdown filter the concept is the same, you just probably need to use “euqal” filter if you want to show a specific record (not contains as with the text field)
1 Like

No @Teodor Appconnect is not a framework. It is only a tool for kids, amateur self-called developers or some old guys who think they are doing something important. :slight_smile:

2 Likes

That’s right Niko :grin: as PROs say so!

1 Like

Hi Teodor,
unfortunately I’m stuck on the query.

If I try to create a query from a “mysql views” I receive an error.
Instead if I use a mysql table and not a “view”, the query works good.
The problem is only on the remote host (Plesk 17.8.11, Debian 9.5, PHP 7.2.11), instead on localhost works good (I’m using MAMP on a macOS 10.14, PHP 7.2.8, MySQL 5.7.23) so I think is missing some configuration on the remote server but I don’t know which it it.
Do you have an idea about it?
Thanks!

{"code":"HY000","file":"\/var\/www\/vhosts\/website.com\/wappler.website.com\/dmxConnectLib\/lib\/db\/Connection.php","line":82,"message":"SQLSTATE[HY000]: General error: 1615 Prepared statement needs to be re-prepared","trace":"#0 \/var\/www\/vhosts\/website.com\/wappler.website.com\/dmxConnectLib\/lib\/db\/Connection.php(82): PDOStatement->execute()\n#1 \/var\/www\/vhosts\/website.com\/wappler.website.com\/dmxConnectLib\/modules\/dbconnector.php(67): lib\\db\\Connection->execute('SELECT `id_jobs...', Array)\n#2 \/var\/www\/vhosts\/website.com\/wappler.website.com\/dmxConnectLib\/lib\/App.php(159): modules\\dbconnector->select(Object(stdClass), 'rsJobsView')\n#3 \/var\/www\/vhosts\/website.com\/wappler.website.com\/dmxConnectLib\/lib\/App.php(128): lib\\App->execSteps(Object(stdClass))\n#4 \/var\/www\/vhosts\/website.com\/wappler.website.com\/dmxConnectLib\/lib\/App.php(98): lib\\App->execSteps(Array)\n#5 \/var\/www\/vhosts\/website.com\/wappler.website.com\/dmxConnectLib\/lib\/App.php(71): lib\\App->exec(Object(stdClass))\n#6 \/var\/www\/vhosts\/website.com\/wappler.website.com\/dmxConnect\/api\/Data\/records-view.php(8): lib\\App->define(Object(stdClass))\n#7 {main}"}

Did you check this error codes
Maybe it is mysql bug

Are you certain you have created a view and not a query (which are not supported by wappler)

Hi Brian,
What is not supported by Wappler?

Yes I confirm that it’s a mysql bug (is necessary turning off “prepared statements”).
A question for Teodor, how can I turn off “prepared statements” in the recordset generated from Wappler?

Queries, only tables and views are supported (unless you have just added them in)

1 Like

@michele what version of mysql server is your server running?

10.1.26… the version included in the last version of Plesk.
Plesk show me exactly this version number: 10.1.26-0+deb9u1

That will be Maria DB then rather than standard MySql

I think you’re right:

Ubuntu 18.04 and Debian 9 have MariaDB version 10.1 pre-installed.