As an idea, I tend to keep the panel edit/view state as a boolean and then
toggle the label on the button and control the behavior of the button press
via an if-else statement in the onSubmit() of the button.

This helps because I only have a single Edit/Save button and I toggle from
labels to form fields on the fly controlling those components via
AjaxFallback*** implemented in a single refrechPanel() method that calls
setVisable(editMode) for all the components that are to toggle or hide.

Also you can do this to the DataTable rows when necessary similar to how the
Editable tree table works:

I get away with all this because I have my own generic labeled form
component that can toggle from a label to a form component and have a
<label> html tag as well as an Help icon and feedback panel associated with

~ Thank you,
  Paul Bors

-----Original Message-----
From: eugenebalt [] 
Sent: Tuesday, August 14, 2012 12:16 PM
Subject: Re: WicketRuntimeException: "Submit Button ... is not enabled"

It is true that we have multiple buttons on our form that we are
disabling/hiding selectively.

Our scenario: a panel that contains the button "Edit", and then when it's
clicked, the panel opens and "Edit" is replaced by two other visible buttons
- "Submit" and "Cancel". "Edit" is gone. We need this dynamic behavior to
enable rich, "self-changing" forms.


add(new Button ("editButton"){
         public boolean isVisible() {
             return showeditbutton;
            public void onSubmit() {     
                  showeditbutton = false;    // hide this one
                  showsavebutton = true;   // show the others
                  showcancelbutton = true;

These are global variables/flags on the form. 

So given this "self-changing form" requirement, what's the fastest way to
get rid of this intermittent "Not Enabled / Visible" error? Is there a way
to turn off this validation in Wicket?

View this message in context:
Sent from the Users forum mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

Reply via email to