Framework7: Server Connect does not work on Content page

======== TEMPLATE BUG FORM ========

Wappler Version : 3.3.4
Operating System : Windows 10
Framework: Framework7 with app connect

Expected behavior

What do you think should happen?

I define a server connect on a content page and it works.

Actual behavior

What actually happens?

The server connect does not work unless I also define it on the main page (index.html) and on the content page – it has to be on both. This becomes a bigger problem when trying to load data based on a route parameter because the param only appears on the route.

How to reproduce

Here’s an example for a simple Server Connect that does not need a route param to return data. It does not work until I add the Server Connect on the Main page and the Content page.

Here’s a further video showing a more specific issue with route params because the param only exists on the final page, so even if I added it to the Main page it won’t work.

Here’s the code from the User page which shows a Server Connect that is attempting to use the route param id. You will also see a route param used to display the ID in a paragraph tag (this will display on the page, so I know the route is being sent, but the Server Connect does not appear to use it.)

Do you see any errors in the browser console, when using the server connect on the content page? Do you see the server action loading in the Network > XHR tab?

No errors, outside of a reference to jQuery in bootstrapnavigation.js

See this video for a run through that includes the network tab and showing the server actions only when the Server Connect is added on the index.html page, along with it being on the content pages. The User page still doesn’t load the user though because I do not think it is getting the ID parameter for some reason.

We need a way to only add the Server Connect to the Content Page and have it work. Having to duplicate it on the Main page (index page) does not seem like a good, long-term, approach.

you can remove the boostrapnavigation include it was included by error.

Furthermore framework7 empowers its own caching. So when something is loaded again it is loaded from cache. There are options on the navigate action to do a reload.

Or do you mean server connect is not loaded at all?

Does it work when you move the server connect inside the page?

@kfawcett
Your server connect needs to be inside the page element in order to load:

@patrick Yes! Amazing. :slight_smile:

I was able to also remove it from the Main page too. Is this me being a dummy? Should Server Connects always be below the Page div? Did I miss this in documentation somehow?

Yes this is how Framework7 works - it injects only the new page element when loading content pages. So actually everything outside the page element is stripped.
It has a special logic for that so also optional headers and footers are also placed specifically as needed.

1 Like

Seems like a good place for automating the process to alert the User that they should be below the Page div and offer to move it. :slight_smile:

Thanks all. I appreciate the help in figuring it out. Happy Friday!