You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Martin Grigorov (JIRA)" <ji...@apache.org> on 2015/10/18 10:55:05 UTC
[jira] [Commented] (WICKET-6006) ModalWindow.closeCurrent() causes
414 status error
[ https://issues.apache.org/jira/browse/WICKET-6006?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14962232#comment-14962232 ]
Martin Grigorov commented on WICKET-6006:
-----------------------------------------
I don't see anything in https://github.com/apache/wicket/blob/master/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/modal/res/modal.js#L791-L854 that would cause form submit or usage of Wicket.Form.
#closeCurrent() just calls target.appendJavaScript(getCloseJavacriptInternal());
#close() calls #getCloseJavacript() that by default just delegates to #getCloseJavacriptInternal().
Please attach a quickstart app.
> ModalWindow.closeCurrent() causes 414 status error
> --------------------------------------------------
>
> Key: WICKET-6006
> URL: https://issues.apache.org/jira/browse/WICKET-6006
> Project: Wicket
> Issue Type: Bug
> Components: wicket-extensions
> Affects Versions: 6.20.0, 7.0.0
> Reporter: Martijn Dashorst
> Priority: Minor
>
> 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).
> {code}
> 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())));
> }
> {code}
> 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...
> https://github.com/apache/wicket/blob/master/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js#L656
> 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?
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)