You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Wen Tong Allan (JIRA)" <ji...@apache.org> on 2008/02/15 22:30:08 UTC

[jira] Created: (WICKET-1349) Wicket Ajax response generates a "^" character

Wicket Ajax response generates a "^" character 
-----------------------------------------------

                 Key: WICKET-1349
                 URL: https://issues.apache.org/jira/browse/WICKET-1349
             Project: Wicket
          Issue Type: Bug
          Components: wicket
    Affects Versions: 1.3.1
         Environment: IE6 and IE7
            Reporter: Wen Tong Allan



I have a page that uses AjaxFallbackDefaultDataTable (using SortableDataProvider ). The markup contains user-define javascript that I added. When I try to do some action (delete row) with the table, the page doesn't refresh in IE6 and IE7. I checked the Wicket Ajax Debugger and it displays:

>  >  ERROR: Error while parsing response: Object required
>  >  INFO: Invoking post-call handler(s)...
>  >  INFO: invoking failure handler(s)...

I also noticed that the user-define javascript that was returned by the ajax debugger was appended by "^". (See javascript below):

                // enable disable button.
                function setButtonState() {
                    var formObj = eval(document.getElementsByName("contactListForm")[0]^);
                    var state = anyChecked(formObj);

                    document.getElementsByName("deleteContactsButton")[0]^.disabled = !state;
                    document.getElementsByName("newContactGroupButton")[0]^.disabled = !state;
                    document.getElementsByName("newEventButton")[0]^.disabled = !state;
                }

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


[jira] Resolved: (WICKET-1349) Wicket Ajax response generates a "^" character in the javascript code

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

Igor Vaynberg resolved WICKET-1349.
-----------------------------------

    Resolution: Invalid
      Assignee: Igor Vaynberg

the ^ character was in wicket ajax console which shows the raw output. this raw output is escaped and doesnt make it into final markup which is added to the page.

> Wicket Ajax response generates a "^" character in the javascript code
> ---------------------------------------------------------------------
>
>                 Key: WICKET-1349
>                 URL: https://issues.apache.org/jira/browse/WICKET-1349
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.1
>         Environment: IE6 and IE7
>            Reporter: Wen Tong Allan
>            Assignee: Igor Vaynberg
>
> I have a page that uses AjaxFallbackDefaultDataTable (using SortableDataProvider ). The markup contains user-define javascript that I added. When I try to do some action (delete row) with the table, the page doesn't refresh in IE6 and IE7. I checked the Wicket Ajax Debugger and it displays:
> >  >  ERROR: Error while parsing response: Object required
> >  >  INFO: Invoking post-call handler(s)...
> >  >  INFO: invoking failure handler(s)...
> I also noticed that the user-define javascript that was returned by the ajax debugger was appended by "^". (See javascript below):
>                 // enable disable button.
>                 function setButtonState() {
>                     var formObj = eval(document.getElementsByName("contactListForm")[0]^);
>                     var state = anyChecked(formObj);
>                     document.getElementsByName("deleteContactsButton")[0]^.disabled = !state;
>                     document.getElementsByName("newContactGroupButton")[0]^.disabled = !state;
>                     document.getElementsByName("newEventButton")[0]^.disabled = !state;
>                 }

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


[jira] Commented: (WICKET-1349) Wicket Ajax response generates a "^" character in the javascript code

Posted by "Conrad Hesse (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-1349?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12652430#action_12652430 ] 

Conrad Hesse commented on WICKET-1349:
--------------------------------------

I am having the same issue with 1.4 RC1

> Wicket Ajax response generates a "^" character in the javascript code
> ---------------------------------------------------------------------
>
>                 Key: WICKET-1349
>                 URL: https://issues.apache.org/jira/browse/WICKET-1349
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.1
>         Environment: IE6 and IE7
>            Reporter: Wen Tong Allan
>            Assignee: Igor Vaynberg
>
> I have a page that uses AjaxFallbackDefaultDataTable (using SortableDataProvider ). The markup contains user-define javascript that I added. When I try to do some action (delete row) with the table, the page doesn't refresh in IE6 and IE7. I checked the Wicket Ajax Debugger and it displays:
> >  >  ERROR: Error while parsing response: Object required
> >  >  INFO: Invoking post-call handler(s)...
> >  >  INFO: invoking failure handler(s)...
> I also noticed that the user-define javascript that was returned by the ajax debugger was appended by "^". (See javascript below):
>                 // enable disable button.
>                 function setButtonState() {
>                     var formObj = eval(document.getElementsByName("contactListForm")[0]^);
>                     var state = anyChecked(formObj);
>                     document.getElementsByName("deleteContactsButton")[0]^.disabled = !state;
>                     document.getElementsByName("newContactGroupButton")[0]^.disabled = !state;
>                     document.getElementsByName("newEventButton")[0]^.disabled = !state;
>                 }

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


[jira] Commented: (WICKET-1349) Wicket Ajax response generates a "^" character in the javascript code

Posted by "Erik van Oosten (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-1349?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12625300#action_12625300 ] 

Erik van Oosten commented on WICKET-1349:
-----------------------------------------

We are using AjaxRequestTarget while at the client side we use jquery only and therefore also have problems with the '^' in the raw stream.

By replacing the AjaxRequestTarget#encode method with the following, you get proper XML escaping.

	/**
	 * Encodes a string so it is safe to use inside CDATA blocks
	 *
	 * @param str
	 * @return encoded string
	 */
	protected String encode(String str)
	{
		if (str == null)
		{
			return null;
		}

		return Strings.replaceAll(str, "]", "]]]><![CDATA[").toString();
	}


> Wicket Ajax response generates a "^" character in the javascript code
> ---------------------------------------------------------------------
>
>                 Key: WICKET-1349
>                 URL: https://issues.apache.org/jira/browse/WICKET-1349
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.1
>         Environment: IE6 and IE7
>            Reporter: Wen Tong Allan
>            Assignee: Igor Vaynberg
>
> I have a page that uses AjaxFallbackDefaultDataTable (using SortableDataProvider ). The markup contains user-define javascript that I added. When I try to do some action (delete row) with the table, the page doesn't refresh in IE6 and IE7. I checked the Wicket Ajax Debugger and it displays:
> >  >  ERROR: Error while parsing response: Object required
> >  >  INFO: Invoking post-call handler(s)...
> >  >  INFO: invoking failure handler(s)...
> I also noticed that the user-define javascript that was returned by the ajax debugger was appended by "^". (See javascript below):
>                 // enable disable button.
>                 function setButtonState() {
>                     var formObj = eval(document.getElementsByName("contactListForm")[0]^);
>                     var state = anyChecked(formObj);
>                     document.getElementsByName("deleteContactsButton")[0]^.disabled = !state;
>                     document.getElementsByName("newContactGroupButton")[0]^.disabled = !state;
>                     document.getElementsByName("newEventButton")[0]^.disabled = !state;
>                 }

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


[jira] Commented: (WICKET-1349) Wicket Ajax response generates a "^" character in the javascript code

Posted by "Erik van Oosten (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-1349?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12629479#action_12629479 ] 

Erik van Oosten commented on WICKET-1349:
-----------------------------------------

Note, the code above will also require changes in the ajax code. The ajax code currently only retrieves the first text node for every type of response, with the escaping from above it should get all text nodes and concatenate them (like a XPath query would do). Actually, you should *always* get all text nodes as most XML DOM parsers (if not, all) do not guarantee that they put all consecutive text in a single text node.

The fix above is not complete, it should also give back another encoding string (method getEncodingName()).

> Wicket Ajax response generates a "^" character in the javascript code
> ---------------------------------------------------------------------
>
>                 Key: WICKET-1349
>                 URL: https://issues.apache.org/jira/browse/WICKET-1349
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.1
>         Environment: IE6 and IE7
>            Reporter: Wen Tong Allan
>            Assignee: Igor Vaynberg
>
> I have a page that uses AjaxFallbackDefaultDataTable (using SortableDataProvider ). The markup contains user-define javascript that I added. When I try to do some action (delete row) with the table, the page doesn't refresh in IE6 and IE7. I checked the Wicket Ajax Debugger and it displays:
> >  >  ERROR: Error while parsing response: Object required
> >  >  INFO: Invoking post-call handler(s)...
> >  >  INFO: invoking failure handler(s)...
> I also noticed that the user-define javascript that was returned by the ajax debugger was appended by "^". (See javascript below):
>                 // enable disable button.
>                 function setButtonState() {
>                     var formObj = eval(document.getElementsByName("contactListForm")[0]^);
>                     var state = anyChecked(formObj);
>                     document.getElementsByName("deleteContactsButton")[0]^.disabled = !state;
>                     document.getElementsByName("newContactGroupButton")[0]^.disabled = !state;
>                     document.getElementsByName("newEventButton")[0]^.disabled = !state;
>                 }

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


[jira] Reopened: (WICKET-1349) Wicket Ajax response generates a "^" character in the javascript code

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

Martijn Dashorst reopened WICKET-1349:
--------------------------------------


We have seen this too in our app. IE sucks. Somehow IE refuses to parse the XML response. Not sure how/why other than that those redmond programmers don't know jack about programming.

> Wicket Ajax response generates a "^" character in the javascript code
> ---------------------------------------------------------------------
>
>                 Key: WICKET-1349
>                 URL: https://issues.apache.org/jira/browse/WICKET-1349
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.1
>         Environment: IE6 and IE7
>            Reporter: Wen Tong Allan
>            Assignee: Igor Vaynberg
>
> I have a page that uses AjaxFallbackDefaultDataTable (using SortableDataProvider ). The markup contains user-define javascript that I added. When I try to do some action (delete row) with the table, the page doesn't refresh in IE6 and IE7. I checked the Wicket Ajax Debugger and it displays:
> >  >  ERROR: Error while parsing response: Object required
> >  >  INFO: Invoking post-call handler(s)...
> >  >  INFO: invoking failure handler(s)...
> I also noticed that the user-define javascript that was returned by the ajax debugger was appended by "^". (See javascript below):
>                 // enable disable button.
>                 function setButtonState() {
>                     var formObj = eval(document.getElementsByName("contactListForm")[0]^);
>                     var state = anyChecked(formObj);
>                     document.getElementsByName("deleteContactsButton")[0]^.disabled = !state;
>                     document.getElementsByName("newContactGroupButton")[0]^.disabled = !state;
>                     document.getElementsByName("newEventButton")[0]^.disabled = !state;
>                 }

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


[jira] Commented: (WICKET-1349) Wicket Ajax response generates a "^" character in the javascript code

Posted by "H Q T (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-1349?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12589765#action_12589765 ] 

H Q T commented on WICKET-1349:
-------------------------------

I have this issue also - where I put javascript functions in a panel between <wicket:head> tags in a panel markup. When I refresh that panel in IE it doesn't work. I notice that when on IE the generated ajax response shown on the wicket debugger shows "^" symbols. While on firefox the same action does not generate javascript  with the "^" symbol.

I solved this by putting my javascript into a separate .js file and put a reference to it from the panel <wicket:head> tag instead   of putting the js script there. This works for me and the parent container gets refreshed on ajax submit. I'm curious though how I can find out more why does the javascript placed between <wicket:head> causes one output on IE and a different one on FF.

> Wicket Ajax response generates a "^" character in the javascript code
> ---------------------------------------------------------------------
>
>                 Key: WICKET-1349
>                 URL: https://issues.apache.org/jira/browse/WICKET-1349
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.1
>         Environment: IE6 and IE7
>            Reporter: Wen Tong Allan
>            Assignee: Igor Vaynberg
>
> I have a page that uses AjaxFallbackDefaultDataTable (using SortableDataProvider ). The markup contains user-define javascript that I added. When I try to do some action (delete row) with the table, the page doesn't refresh in IE6 and IE7. I checked the Wicket Ajax Debugger and it displays:
> >  >  ERROR: Error while parsing response: Object required
> >  >  INFO: Invoking post-call handler(s)...
> >  >  INFO: invoking failure handler(s)...
> I also noticed that the user-define javascript that was returned by the ajax debugger was appended by "^". (See javascript below):
>                 // enable disable button.
>                 function setButtonState() {
>                     var formObj = eval(document.getElementsByName("contactListForm")[0]^);
>                     var state = anyChecked(formObj);
>                     document.getElementsByName("deleteContactsButton")[0]^.disabled = !state;
>                     document.getElementsByName("newContactGroupButton")[0]^.disabled = !state;
>                     document.getElementsByName("newEventButton")[0]^.disabled = !state;
>                 }

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


[jira] Resolved: (WICKET-1349) Wicket Ajax response generates a "^" character in the javascript code

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

Igor Vaynberg resolved WICKET-1349.
-----------------------------------

    Resolution: Cannot Reproduce

> Wicket Ajax response generates a "^" character in the javascript code
> ---------------------------------------------------------------------
>
>                 Key: WICKET-1349
>                 URL: https://issues.apache.org/jira/browse/WICKET-1349
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.1
>         Environment: IE6 and IE7
>            Reporter: Wen Tong Allan
>            Assignee: Igor Vaynberg
>
> I have a page that uses AjaxFallbackDefaultDataTable (using SortableDataProvider ). The markup contains user-define javascript that I added. When I try to do some action (delete row) with the table, the page doesn't refresh in IE6 and IE7. I checked the Wicket Ajax Debugger and it displays:
> >  >  ERROR: Error while parsing response: Object required
> >  >  INFO: Invoking post-call handler(s)...
> >  >  INFO: invoking failure handler(s)...
> I also noticed that the user-define javascript that was returned by the ajax debugger was appended by "^". (See javascript below):
>                 // enable disable button.
>                 function setButtonState() {
>                     var formObj = eval(document.getElementsByName("contactListForm")[0]^);
>                     var state = anyChecked(formObj);
>                     document.getElementsByName("deleteContactsButton")[0]^.disabled = !state;
>                     document.getElementsByName("newContactGroupButton")[0]^.disabled = !state;
>                     document.getElementsByName("newEventButton")[0]^.disabled = !state;
>                 }

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


[jira] Updated: (WICKET-1349) Wicket Ajax response generates a "^" character in the javascript code

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

Wen Tong Allan updated WICKET-1349:
-----------------------------------

    Summary: Wicket Ajax response generates a "^" character in the javascript code  (was: Wicket Ajax response generates a "^" character )

> Wicket Ajax response generates a "^" character in the javascript code
> ---------------------------------------------------------------------
>
>                 Key: WICKET-1349
>                 URL: https://issues.apache.org/jira/browse/WICKET-1349
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.1
>         Environment: IE6 and IE7
>            Reporter: Wen Tong Allan
>
> I have a page that uses AjaxFallbackDefaultDataTable (using SortableDataProvider ). The markup contains user-define javascript that I added. When I try to do some action (delete row) with the table, the page doesn't refresh in IE6 and IE7. I checked the Wicket Ajax Debugger and it displays:
> >  >  ERROR: Error while parsing response: Object required
> >  >  INFO: Invoking post-call handler(s)...
> >  >  INFO: invoking failure handler(s)...
> I also noticed that the user-define javascript that was returned by the ajax debugger was appended by "^". (See javascript below):
>                 // enable disable button.
>                 function setButtonState() {
>                     var formObj = eval(document.getElementsByName("contactListForm")[0]^);
>                     var state = anyChecked(formObj);
>                     document.getElementsByName("deleteContactsButton")[0]^.disabled = !state;
>                     document.getElementsByName("newContactGroupButton")[0]^.disabled = !state;
>                     document.getElementsByName("newEventButton")[0]^.disabled = !state;
>                 }

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


[jira] Commented: (WICKET-1349) Wicket Ajax response generates a "^" character in the javascript code

Posted by "robert mcguinness (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-1349?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12924660#action_12924660 ] 

robert mcguinness commented on WICKET-1349:
-------------------------------------------

Was able to reproduce with Wicket 1.4.12 and Firefox 3.6.11:

<wicket:head>
    <script type="text/javascript">
        $(document).ready(function(){
        	var textField = $(":text:first");
        	textField.live("focus", function() {
            	$("input[name='suggestedUserId']").attr("checked",false);            	
            });
        	
        	var radios = $("input[name='suggestedUserId']");
        	radios.live("click", function() {
        		textField.val($(this).val());
        	});
        
        	
        });
    </script>
</wicket:head>

returns:

<script type="text/javascript" id="com-availity-axi-web-component-panel-UserIdInUsePanel-0">
        $(document).ready(function(){
            var textField = $(":text:first");
            textField.live("focus", function() {
                $("input[name='suggestedUserId']^").attr("checked",false);                
            });
            
            var radios = $("input[name='suggestedUserId']^");
            radios.live("click", function() {
                textField.val($(this).val());
            });
        
            
        });
 </script>


> Wicket Ajax response generates a "^" character in the javascript code
> ---------------------------------------------------------------------
>
>                 Key: WICKET-1349
>                 URL: https://issues.apache.org/jira/browse/WICKET-1349
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.1
>         Environment: IE6 and IE7
>            Reporter: Wen Tong Allan
>            Assignee: Igor Vaynberg
>
> I have a page that uses AjaxFallbackDefaultDataTable (using SortableDataProvider ). The markup contains user-define javascript that I added. When I try to do some action (delete row) with the table, the page doesn't refresh in IE6 and IE7. I checked the Wicket Ajax Debugger and it displays:
> >  >  ERROR: Error while parsing response: Object required
> >  >  INFO: Invoking post-call handler(s)...
> >  >  INFO: invoking failure handler(s)...
> I also noticed that the user-define javascript that was returned by the ajax debugger was appended by "^". (See javascript below):
>                 // enable disable button.
>                 function setButtonState() {
>                     var formObj = eval(document.getElementsByName("contactListForm")[0]^);
>                     var state = anyChecked(formObj);
>                     document.getElementsByName("deleteContactsButton")[0]^.disabled = !state;
>                     document.getElementsByName("newContactGroupButton")[0]^.disabled = !state;
>                     document.getElementsByName("newEventButton")[0]^.disabled = !state;
>                 }

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