When using Node.js with Layouts button onClick dynamic events no longer work

Hey everyone, I am brand new to wappler so if this is an obvious mistake forgive me but I am having trouble getting actions to run when using page layouts.

I have created a simple Layout page with a header. Then I created a content page with the layout page set to the layout I created. The problem is on this new page with a layout assigned to it none of the onClick actions assigned to buttons will work.

I create a duplicate of the page without a layout assigned to it and the onClick button actions work normally.

To make it a bit more confusing, when the layout page is assigned the “preview mode” inside wappler will show the onClick button actions working properly but when the app is opened in a browser the onClick actions do not work.

I hope I am explaining this clearly. Basically when using Node.js and pages with layouts I cannot get onClick button actions to work.

When you using layouts and content pages, especially when copying the layout/content between them you need to be mindful of the Wappler components that are used and if they are included in the header/include script at the top of the content page.

Without seeing exactly what is happening that would be what id look at.

Also, if you have an onclick event in a content page that is referencing something in the layout page, it won’t work In preview mode (like if it opens a modal but that modal component is actually in the layout page)

If you have copied code over and it uses something like Date Picker, it won’t work unless the date picker component had been added through the UI or you add it in the header/include script at the top of the page.

Hope that makes some sense

Thanks for the help Phillip_J! So after reading what you wrote I went back and started looking at the includes in the headers. Which led me to just starting a fresh project to see what is excluded and what is included with different settings.

It turned out to be dumb user error on my part! When I redid everything and confirmed that the headers had all the includes it works perfectly :slight_smile:

Yes I did the se thing. It’s easier if you add things in from scratch, but once you get the hang of it, you can copy content over, just making sure all the required components are listed In header includes, which can be edited directly as well.