When adding two buttons to a form and enabling and disabling them alternatively 
we get the org.apache.wicket.WicketRuntimeException: Submit Button ...  is not 
enabled
----------------------------------------------------------------------------------------------------------------------------------------------------------------------

                 Key: WICKET-2665
                 URL: https://issues.apache.org/jira/browse/WICKET-2665
             Project: Wicket
          Issue Type: Bug
          Components: wicket
    Affects Versions: 1.4.5, 1.4.4
         Environment: Wicket 1.4.5 portlet 
Deployed on Liferay 5.2.3 (using JBoss 4.2.3 on windows X)

            Reporter: Brevard Swart


If you look at eth JIRA WICKET-2570 fix it adds the following lines:

+                                                       if 
(!component.isEnabledInHierarchy())
+                                                       {
+                                                               throw new 
WicketRuntimeException("Submit Button " +
+                                                                       
submittingComponent.getInputName() + " (path=" +
+                                                                       
component.getPageRelativePath() + ") is not enabled");
+                                                       }

This fix above breaks our code if I go back to version 1.4.3 this goes away. 

If you have a scenarion where you have added two ajax buttons on a form 
disabling them using org.apache.wicket.Component.setEnabled, alternating and 
enabling one while disabling the other. Then once you have clicked on the 
button (say Button Y) a second time you get the error:

org.apache.wicket.WicketRuntimeException: Submit Button X ...  is not enabled

I have a wicket form inside a wick panel that is inside another wicket panel 
(if I do a complete re-render on the root panel after each click the error will 
not occur). The order in which the buttons have been added to the form 
determine which button onclick will fail. This failure will occur when Submit 
Button Y is clicked a second time it will complain that Submit Button X is not 
enabled. We have tried disabling these buttons in either the onBeforeRender of 
the buttons or the form but both fail.

Current button states:
Button Y - isEnabled = true
Button Y - isEnabledInHierarchy = true
Button X - isEnabled = false
Button X - isEnabledInHierarchy = false

Submit Button Y clicked!

Current button states:
Button Y - isEnabled = false
Button Y - isEnabledInHierarchy = false
Button X - isEnabled = true
Button X- isEnabledInHierarchy = true

Submit Button X clicked:

Current button states:
Button Y - isEnabled = true
Button Y - isEnabledInHierarchy = true
Button X - isEnabled = false
Button X- isEnabledInHierarchy = false

Submit Button Y clicked!

ERROR!!!!

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to