WICKET-6264 Form: improve error message for disabled/invisible 
IFormSubmittingComponent


Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/fc8bd692
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/fc8bd692
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/fc8bd692

Branch: refs/heads/master
Commit: fc8bd6921c05d7bc94fdbfd217201c44314dac85
Parents: bfdb00f
Author: Martin Tzvetanov Grigorov <[email protected]>
Authored: Mon Oct 31 20:42:16 2016 +0100
Committer: Martin Tzvetanov Grigorov <[email protected]>
Committed: Tue Nov 1 08:29:46 2016 +0100

----------------------------------------------------------------------
 .../java/org/apache/wicket/markup/html/form/Form.java | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/wicket/blob/fc8bd692/wicket-core/src/main/java/org/apache/wicket/markup/html/form/Form.java
----------------------------------------------------------------------
diff --git 
a/wicket-core/src/main/java/org/apache/wicket/markup/html/form/Form.java 
b/wicket-core/src/main/java/org/apache/wicket/markup/html/form/Form.java
index e48fa3d..55a7679 100644
--- a/wicket-core/src/main/java/org/apache/wicket/markup/html/form/Form.java
+++ b/wicket-core/src/main/java/org/apache/wicket/markup/html/form/Form.java
@@ -815,16 +815,22 @@ public class Form<T> extends WebMarkupContainer
 
                        if (!component.isVisibleInHierarchy())
                        {
+                               Page page = findPage();
                                throw new WicketRuntimeException("Submit Button 
" +
-                                       submittingComponent.getInputName() + " 
(path=" +
-                                       component.getPageRelativePath() + ") is 
not visible");
+                                               
submittingComponent.getInputName() + " (path=" +
+                                               component.getPath() + ", 
pageClass=" +
+                                               (page == null ? "<unknown>" : 
page.getPageClass().getName()) +
+                                               ") is not visible");
                        }
 
                        if (!component.isEnabledInHierarchy())
                        {
+                               Page page = findPage();
                                throw new WicketRuntimeException("Submit Button 
" +
-                                       submittingComponent.getInputName() + " 
(path=" +
-                                       component.getPageRelativePath() + ") is 
not enabled");
+                                               
submittingComponent.getInputName() + " (path=" +
+                                               component.getPath() + ", 
pageClass=" +
+                                               (page == null ? "<unknown>" : 
page.getPageClass().getName()) +
+                                               ") is not enabled");
                        }
                }
                

Reply via email to