Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
6.20.0, 7.0.0
-
None
Description
When you have a panel inside a modal window, and the panel contains a form with e.g. a textarea, and you fill the textarea with about 10k of text, when the modal window is closed using closeCurrent() you get a 414 status error stating that the URL is too long (depends on the backend server).
public ModalPanel1(String id) { super(id); Form<?> form = new Form<>("form"); add(form); add(new AjaxLink<Void>("closeCancel") { @Override public void onClick(AjaxRequestTarget target) { ModalWindow.closeCurrent(target); } }); StringBuilder sb = new StringBuilder(); for (int i = 0; i < 10000; i++) sb.append("a"); form.add(new TextArea<>("bigFingTextField", Model.of(sb.toString()))); }
Closing the window using ModalWindow.closeCurrent() will add the serializedForm of the modal window's contents (See line 656 of wicket-ajax-debug.js) to the URL that's sent to wicket. If the form inside the panel contains lots of data, this will exceed the maximum URL length...
The workaround is of course to use ModalWindow#close(IPartialPageRequestHandler) instead, however, why is ModalWindow#closeCurrent() even there, and why doesn't it properly close the window with the same behavior as the instance method?
Attachments
Attachments
Issue Links
- is broken by
-
WICKET-5948 wicket-ajax.js probably doesn't traverse the children of <div> or <span>
- Resolved
- is related to
-
WICKET-6050 Wicket Ajax (Wicket.From.serializeElement) causes 400 bad request
- Resolved