You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Ivan Vasilev (JIRA)" <ji...@apache.org> on 2010/12/31 13:51:48 UTC

[jira] Created: (WICKET-3293) Ajax form submit and third party HTML editors

Ajax form submit and third party HTML editors
---------------------------------------------

                 Key: WICKET-3293
                 URL: https://issues.apache.org/jira/browse/WICKET-3293
             Project: Wicket
          Issue Type: Bug
          Components: wicket
    Affects Versions: 1.5-M3
         Environment: Any
            Reporter: Ivan Vasilev


There is a form with two textarea elements in it. 
The first textarea is converted into a CKEditor (http://ckeditor.com/) and the second one is converted into dijit.Editor (http://docs.dojocampus.org/dijit/Editor).
There are two submit buttons - one Ajax and one non-ajax.
When the form is submitted with page reload (non ajax) the values from the two textarea elements are correctly submitted to the server.
However, if the form is submitted via ajax the values from the two textarea elements are not sent to the server. This can be observed in the attached quickstart.

This issue involves third party tools, so in a sense it's not a wicket problem, but I decided to create an issue for two reasons:
1. There is a repeated pattern with two different editors, which (as far as I know) have nothing in common.
2. There is a different behavior when the form is submitted via ajax (doesn't work) and with page reload (works). 

Thanks.

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


[jira] Commented: (WICKET-3293) Ajax form submit and third party HTML editors

Posted by "Ivan Vasilev (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-3293?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12976406#action_12976406 ] 

Ivan Vasilev commented on WICKET-3293:
--------------------------------------

Just for the record I think I found a workaround for this issue. I added a hidden input field to the form and an AjaxPreprocessingCallDecorator to the AjaxButton that submits the form. Before the form is submitted the call decorator retrieves the value from the editor and sets it to the hidden input field. On the server side the value from the editor is retrieved via the hidden field. 

> Ajax form submit and third party HTML editors
> ---------------------------------------------
>
>                 Key: WICKET-3293
>                 URL: https://issues.apache.org/jira/browse/WICKET-3293
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5-M3
>         Environment: Any
>            Reporter: Ivan Vasilev
>            Assignee: Igor Vaynberg
>         Attachments: quickstart.rar
>
>
> There is a form with two textarea elements in it. 
> The first textarea is converted into a CKEditor (http://ckeditor.com/) and the second one is converted into dijit.Editor (http://docs.dojocampus.org/dijit/Editor).
> There are two submit buttons - one Ajax and one non-ajax.
> When the form is submitted with page reload (non ajax) the values from the two textarea elements are correctly submitted to the server.
> However, if the form is submitted via ajax the values from the two textarea elements are not sent to the server. This can be observed in the attached quickstart.
> This issue involves third party tools, so in a sense it's not a wicket problem, but I decided to create an issue for two reasons:
> 1. There is a repeated pattern with two different editors, which (as far as I know) have nothing in common.
> 2. There is a different behavior when the form is submitted via ajax (doesn't work) and with page reload (works). 
> Thanks.

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


[jira] Updated: (WICKET-3293) Ajax form submit and third party HTML editors

Posted by "Ivan Vasilev (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-3293?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ivan Vasilev updated WICKET-3293:
---------------------------------

    Attachment: quickstart.rar

The quickstart is 1.6 MB, because of the included CKEditor

> Ajax form submit and third party HTML editors
> ---------------------------------------------
>
>                 Key: WICKET-3293
>                 URL: https://issues.apache.org/jira/browse/WICKET-3293
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5-M3
>         Environment: Any
>            Reporter: Ivan Vasilev
>         Attachments: quickstart.rar
>
>
> There is a form with two textarea elements in it. 
> The first textarea is converted into a CKEditor (http://ckeditor.com/) and the second one is converted into dijit.Editor (http://docs.dojocampus.org/dijit/Editor).
> There are two submit buttons - one Ajax and one non-ajax.
> When the form is submitted with page reload (non ajax) the values from the two textarea elements are correctly submitted to the server.
> However, if the form is submitted via ajax the values from the two textarea elements are not sent to the server. This can be observed in the attached quickstart.
> This issue involves third party tools, so in a sense it's not a wicket problem, but I decided to create an issue for two reasons:
> 1. There is a repeated pattern with two different editors, which (as far as I know) have nothing in common.
> 2. There is a different behavior when the form is submitted via ajax (doesn't work) and with page reload (works). 
> Thanks.

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


[jira] Commented: (WICKET-3293) Ajax form submit and third party HTML editors

Posted by "Martin Grigorov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-3293?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12976249#action_12976249 ] 

Martin Grigorov commented on WICKET-3293:
-----------------------------------------

I didn't have a look at the quickstart but I think I know what happens.
Both JS libraries generate DOM and use their own logic to map the rich content to the data to be submitted.
For example Dojo parser generates a bunch of DOM nodes when encountering attribute dojoType="someType" and then often ignores the 'domNode' (this is the original/parsed node) for its internal working.
Dojo interepts normal form submit (via events) and serializes the "internal knowledge" to the form element value. With Wicket Ajax submit Dojo is not involved at all - Wicket itself serializes all form elements and submits a newly created form thru iframe. 
It will be hard for Wicket to know the internals of different JS libraries out there.

> Ajax form submit and third party HTML editors
> ---------------------------------------------
>
>                 Key: WICKET-3293
>                 URL: https://issues.apache.org/jira/browse/WICKET-3293
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5-M3
>         Environment: Any
>            Reporter: Ivan Vasilev
>         Attachments: quickstart.rar
>
>
> There is a form with two textarea elements in it. 
> The first textarea is converted into a CKEditor (http://ckeditor.com/) and the second one is converted into dijit.Editor (http://docs.dojocampus.org/dijit/Editor).
> There are two submit buttons - one Ajax and one non-ajax.
> When the form is submitted with page reload (non ajax) the values from the two textarea elements are correctly submitted to the server.
> However, if the form is submitted via ajax the values from the two textarea elements are not sent to the server. This can be observed in the attached quickstart.
> This issue involves third party tools, so in a sense it's not a wicket problem, but I decided to create an issue for two reasons:
> 1. There is a repeated pattern with two different editors, which (as far as I know) have nothing in common.
> 2. There is a different behavior when the form is submitted via ajax (doesn't work) and with page reload (works). 
> Thanks.

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


[jira] Resolved: (WICKET-3293) Ajax form submit and third party HTML editors

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-3293?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Igor Vaynberg resolved WICKET-3293.
-----------------------------------

    Resolution: Won't Fix
      Assignee: Igor Vaynberg

the only way to fix this is to write an integration between the rich editor and wicket that is ajax-aware. this problem is not unique to wicket's ajax, it affects all ajax implementations because, like martin pointed out, the rich editors mess with DOM and need to be notified prior to an ajax form submit to dump the value into the old tag. feel free to create a wicket-stuff project that integrates the editors.

> Ajax form submit and third party HTML editors
> ---------------------------------------------
>
>                 Key: WICKET-3293
>                 URL: https://issues.apache.org/jira/browse/WICKET-3293
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5-M3
>         Environment: Any
>            Reporter: Ivan Vasilev
>            Assignee: Igor Vaynberg
>         Attachments: quickstart.rar
>
>
> There is a form with two textarea elements in it. 
> The first textarea is converted into a CKEditor (http://ckeditor.com/) and the second one is converted into dijit.Editor (http://docs.dojocampus.org/dijit/Editor).
> There are two submit buttons - one Ajax and one non-ajax.
> When the form is submitted with page reload (non ajax) the values from the two textarea elements are correctly submitted to the server.
> However, if the form is submitted via ajax the values from the two textarea elements are not sent to the server. This can be observed in the attached quickstart.
> This issue involves third party tools, so in a sense it's not a wicket problem, but I decided to create an issue for two reasons:
> 1. There is a repeated pattern with two different editors, which (as far as I know) have nothing in common.
> 2. There is a different behavior when the form is submitted via ajax (doesn't work) and with page reload (works). 
> Thanks.

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