wicket-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gmparker2000 <greg.par...@brovada.com>
Subject Re: Determine which submit buttons was pressed
Date Wed, 08 Jan 2014 16:14:57 GMT
I had tried that but unfortunately at the point I'm trying to make the
determination this call returns null.


        Form myForm = new EasyForm("myForm") {
            public void process(IFormSubmitter submittingComponent) {
                // this returns null
                IFormSubmitter btn = this.findSubmittingButton();
                
                if (btn == ...) {
                    // do something before validation
                }
                
                super.process(submittingComponent);
            }


The only way I could make this work so far is something like this:

            public void process(IFormSubmitter submittingComponent) {
                IFormSubmitter btn = this.findSubmittingButton();
                String qs = this.getRequest().getUrl().getQueryString();
                
                if (qs.contains("myButtonName")) {
                    // do something
                }
                
                super.process(submittingComponent);
             }

This is ugly.  Hoping there is a better way.

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Determine-which-submit-buttons-was-pressed-tp4663550p4663554.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Mime
View raw message