Wicket Ajax Link - 404 Not Found Error

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Wicket Ajax Link - 404 Not Found Error

lorenz12
I have an ajax link that shows or hides a panel.

public class ShowHidePlansButton extends AjaxLink<Void> {
        private static final long serialVersionUID = 1L;
        private boolean show = true;
        private final Label showHidePlansText;
        private final StringResourceModel showPlans = new StringResourceModel("health.cge.showPlans", null);
        private final StringResourceModel hidePlans = new StringResourceModel("health.cge.hidePlans", null);

        public ShowHidePlansButton(final String id, final Label showHidePlansText) {
                super(id);
                this.add(this.showHidePlansText = showHidePlansText);
                this.showHidePlansText.setOutputMarkupId(true);
        }

        @Override
        public void onClick(final AjaxRequestTarget target) {
                this.show = !this.show;
                if (this.show) {
                        this.showHidePlansText.setDefaultModel(this.showPlans);
                } else {
                        this.showHidePlansText.setDefaultModel(this.hidePlans);
                }
                target.addComponent(this.showHidePlansText);
                target.appendJavascript("showHidePlansClickEvent('" + this.getMarkupId() + "');");
        }
}

But the code in the onClick never executes.  Instead when I click the link nothing happens and when I check the errors in Chrome's developer tools I am seeing this error:

GET https://darden.cbacadev.hewitt.com/site/Benefit%20Enrollment?wicket:interfa…pingHeader:showHidePlans::IBehaviorListener:0:-1&random=0.3417134510818869 404 (Not Found)

in wicket-ajax.js line 628

The url is correct.  The part that is throwing it off is the wicket:interface=:... that is inserted by wicket itself.  Can anyone tell me why this would throw a 404 not found error?