Hi

Can't I use the equals method on forms? How do I detect if 2 forms are
equal across requests?

Below does not work .... But does iterate over the form where equals
should match. But I can see the forms contain different model types,
it's after a form submit...




        public class DiscoverFeedBackPanelsVisitor<T> implements

        IVisitor<Component, Void> {

                private Boolean shouldAccept;

                private Form<T> form;

                public DiscoverFeedBackPanelsVisitor(Form<T> form) {
                        setShouldAccept(false);
                        setForm(form);
                }

                @Override
                public void component(Component component, IVisit<Void> visit) {

                        if (Form.class.isAssignableFrom(component.getClass())) {
                                Form<T> possibleForm = 
Form.class.cast(component);
                                if (possibleForm.equals(getForm())) {

                                        setShouldAccept(true);
                                        visit.stop();
                                }
                        }

                }

                public void setShouldAccept(Boolean shouldAccept) {
                        this.shouldAccept = shouldAccept;
                }

                public Boolean getShouldAccept() {
                        return shouldAccept;
                }

                public void setForm(Form<T> form) {
                        this.form = form;
                }

                public Form<T> getForm() {
                        return form;
                }

        }

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to