AC Form query parameter binding is being appended to the actual query parameter

Wappler Version : 3.7.2
Operating System : MacOS Catalina
Server Model: N/A
Database Type: N/A
Hosting Type: N/A

As the title suggests when working with AC forms the binding is being added to the query parameters

image

image

<form class="omnisearch-form" is="dmx-api-form" id="serverconnectform1" action="/search" site="test" dmx-bind:params="{q:`bs4input.value`}">

Does the Wappler UI add the backticks?

Does it work correctly when you change:

{q:`bs4input.value`}

to:

{q:bs4input.value}

Yes. They are added by the UI.

I would have to set up a new test scenario as I finally decided not to use a SC Form, but I would assume without the backticks it would work as it’s how you load a serverconnect with query parameters.

SC form just extends SC right?

When calling a SC from an input the UI doesn’t add the backticks.

serverconnect1.load({query: value})

This is still ocurring.

Are you getting this with AC API Forms? As the UI there is different, not sure where you get your UI…

This is mine and it seems all fine.

Yes.

It’s the query parameters definition via Dynamic Attribute.

image

<form is="dmx-api-form" id="apiform1" method="post" action="thisplace" dmx-param:q="form1.input1.value" dmx-bind:params="{test:form1.input1.value}"><button id="btn1" class="btn" type="submit">Button</button></form>

image

I see but in this case the backticks are correct IMO.

Backticks means evaluate the expression - later when the form is submitted and not when initially rendered.

And that is what you usually want - you want to submit the dynamic data values during the submit and not the render time values.

Uhmm…maybe I’m missing something

Why would I want to send to an external api a query string that means nothing to the server.
It’s actually sending a GET request with the AC binding as a string and not resolving the value before performing the xhr call.

Check the URL value below.

Summary
URL: http://localhost:3000/thisplace?test=%7B%7Bform1.input1.value%7D%7D=
Status: 404 Not Found
Source: Network
Address: ::1:3000
Initiator: 
serverconnectForm.js:296

Please test this update: dmxAppConnect.zip (25.7 KB)

Sorry @patrick I have no access to Wappler until tomorrow. I just saw the fix is due for today.

This has been fixed in Wappler 4.6