Parameters cause error

I have a route for /dashboard when it loads it adds this to the url:

http://localhost:3000/dashboard?offset=0&status=1%2C4%2C5&sort=Created&dir=desc

This is because the main part of the page is a paginated table. it comes from this code:

<body is="dmx-app" id="dashboard" dmx-on:load="getClientNames.load({});myticketsSorting1.set('offset',0);myticketsSorting1.set('status','1,4,5');myticketsSorting1.set('sort','Created');myticketsSorting1.set('dir','desc')">

If you hit refresh on that you get a 404 error, you have to delete the parameters from the url then it will load. This probably goes back to something I’ve forgotten about wappler. What have i done wrong that you cant just refresh the page?

I see now that the route has no knowledge of the parameters so i’m looking for how to define these, except one of them is a comma separated list which it appears the route won’t like very much. i don’t think it’s the :parameter style… but the query.parameter style. now to find documentation for that.

You have to echo those parameter names to the App Connect Query Parameters within your Layout Page...

image

Reason being is that they are being drawn from the URL so you'll need these present for App Connect to associate them and allow for passing to Server Connect.

they’re in there… they were defined in there. The route however has nothing and everything i’m trying isn’t working.

Have you defined them in the route?

Below are two parameters /:area and /:urlslug

I changed the route from

/dashboard

to

/dashboard/:offset?/:status?/:sort?/:dir?

that did not work.

It makes no sense to have multiple optional parameters in the route.
And if you need all of them it will look like this:

/dashboard/:offset/:status/:sort/:dir

so the URL that matches it will be:

https://example.com/0/1/created/desc

But in your case the url you are having now should work just fine without defining anything else for the path other than /dashboard
The ?offset=0&status=1%2C4%2C5&sort=Created&dir=desc part should not break anything.

What server model are you using?
Are your site links set to site root relative?

1 Like