MarcGiffing / wicket-spring-boot

Spring Boot starter for Apache Wicket
151 stars 61 forks source link

Bug in Wicket 9.0.0 - Upgrade to Wicket 9.2.0? #178

Closed orangejuice2508 closed 2 years ago

orangejuice2508 commented 3 years ago

Hello,

our Wicket web application is based on Spring Boot 2.4.4, which works flawlessy with Wicket-Spring-Boot-Starter 3.0.4 and Wicket 9.0.0. However, due to the bug WICKET-6845 (https://issues.apache.org/jira/browse/WICKET-6845?page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel&focusedCommentId=17218188#comment-17218188) we have to upgrade to Wicket 9.2.0 (minimum), which is incompatible with the current version of this library. For example, "onclick" on links does not work properly anymore.

Is an update to Wicket 9.2.0 (or later) planned?

martin-g commented 3 years ago

Do you know why "onclick" does not work ? How is it related to Wicket-Spring-Boot ?

orangejuice2508 commented 3 years ago

With Wicket 9.0.0 and Wicket-Spring-Boot-Starter 3.0.4 the following implementation works flawlessly, i.e. the page parameters are manipulated correctly:

public class TestLink extends Link<Void> {

        private PageParameters para;

        public TestLink(String id, PageParameters para) {
            super(id);
            this.para= para;
        }

        @Override
        public void onClick() {
            para.add("test", "true");
            setResponsePage(getPage().getClass(), para);
        }

<button wicket:id="test" class="btn">Test</button>

However, when upgrading to Wicket 9.1.0 or later, the "onclick" method fails without an exception, i.e. the page parameters are not manipulated. According to the changelog (https://github.com/apache/wicket/blob/master/CHANGELOG-9.x) nothing was changed with respect to the implementation. So, the issue is likely due to Wicket-Spring-Boot-Starter, which was not updated after the release of Wicket 9.0.0.

martin-g commented 3 years ago

Can reproduce this in a mini application ? Also please check the browser dev tools > Network tab. Is there a request when you click the link ?