[
https://issues.apache.org/jira/browse/WICKET-7123?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17889678#comment-17889678
]
ASF GitHub Bot commented on WICKET-7123:
----------------------------------------
martin-g commented on code in PR #971:
URL: https://github.com/apache/wicket/pull/971#discussion_r1801218984
##########
wicket-examples/src/main/java/org/apache/wicket/examples/forminput/FormInput.html:
##########
@@ -81,6 +98,40 @@
<div id="feedbackPanel">
<span wicket:id="feedback"/>
</div>
+
+ <h2 class="example-title"><wicket:message
key="FormInput.formHierarchyExample"/></h2>
+
+ <form wicket:id="parentForm" class="parent-form">
+ <h3><wicket:message key="FormInput.parentForm"/></h3>
+
+ <div class="gap-1">
+ <label for="parentText"><wicket:message
key="FormInput.parentTextLabel"/></label>
+ <input type="text" wicket:id="parentText"
id="parentText"/>
+ <input type="submit" wicket:id="parentSubmit"
wicket:message="value:FormInput.parentSubmit"/>
+ </div>
+
+ <form wicket:id="childForm" class="child-form">
+ <h3><wicket:message key="FormInput.childForm"/></h3>
+
+ <div class="gap-1">
+ <label for="childText"><wicket:message
key="FormInput.childTextLabel"/></label>
+ <input type="text" wicket:id="childText"
id="childText"/>
+ <input type="submit" wicket:id="childSubmit"
wicket:message="value:FormInput.childSubmit"/>
+ </div>
+ </form>
+ </form>
+
+ <div wicket:id="parentFormDataTable" class="parent-data-table">
+ <h3><wicket:message key="FormInput.submittedData"/></h3>
+ <div class="gap-1">
+ <wicket:message key="FormInput.parentTextLabel"/>
+ <td wicket:id="parentData"/>
Review Comment:
Why `<td>` ? There is no `<table>` around ?
> Form.setDefaultButton() supports only one button per form hierarchy
> -------------------------------------------------------------------
>
> Key: WICKET-7123
> URL: https://issues.apache.org/jira/browse/WICKET-7123
> Project: Wicket
> Issue Type: Improvement
> Components: wicket-core
> Affects Versions: 10.1.0
> Reporter: Viliam Repan
> Priority: Major
>
> Currently Form.setDefaultButton() support only one button per whole form
> hierarchy, which is a problem when there are multiple forms on page of for
> example popup. It complicates even further when those default submit buttons
> have custom visibility/enabled state.
> Current implementation puts hidden field in root form which stores name of
> submit button and then creates client JS click() via jquery.
> This should be easy doable directly on form where the default button is
> located without the need to pass it to root form.
> What do you think about this?
> PR available here https://github.com/apache/wicket/pull/968
--
This message was sent by Atlassian Jira
(v8.20.10#820010)