[richfaces-issues] [JBoss JIRA] Commented: (RF-2735) Error to clear node content by innerHTML when re-rendering

Rafael Rueda (JIRA) jira-events at lists.jboss.org
Wed Jul 29 15:52:29 EDT 2009


    [ https://jira.jboss.org/jira/browse/RF-2735?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12478137#action_12478137 ] 

Rafael Rueda commented on RF-2735:
----------------------------------

Hi, we solved this issue in our project. we use richfaces 3.3.1 version.
We fix the file AJAX.js (richfaces-impl-3.3.1.GA.jar\org\ajax4jsf\javascript\scripts). The solucion is to replace old code with the new code in the specific line. 

Line: 
1394

Old Code:
oldnode.outerHTML = new XMLSerializer().serializeToString( newnode );

New Code:
if(Sarissa._SARISSA_IS_IE)
                {
                    if(  oldnode.tagName.match( /(tbody|thead|tfoot|tr|th|td)/i ) ) {
                        LOG.debug( "Replace content of node by IE hack" );
                        var temp = document.createElement( "div" );
                        temp.innerHTML = '<table style="display: none">'+new XMLSerializer().serializeToString( newnode )+'</table>';
                        anchor.replaceChild( temp.getElementsByTagName( newnode.tagName ).item( 0 ), oldnode );
                    }
                    else if( oldnode.tagName.match( /(div|span|dd|dl|dt)/i ))
                    {
                        var temp = document.createElement( "div" );
                        temp.innerHTML = new XMLSerializer().serializeToString( newnode );
                        anchor.replaceChild( temp.getElementsByTagName( newnode.tagName ).item( 0 ), oldnode );                   
                    }
                    else {
                        LOG.debug( "Replace content of node by outerHTML()" );
                        oldnode.outerHTML = new XMLSerializer().serializeToString( newnode );
                    }                   
                }

> Error to clear node content by innerHTML when re-rendering 
> -----------------------------------------------------------
>
>                 Key: RF-2735
>                 URL: https://jira.jboss.org/jira/browse/RF-2735
>             Project: RichFaces
>          Issue Type: Bug
>    Affects Versions: 3.2.0
>            Reporter: Nick Belaevski
>            Assignee: Nick Belaevski
>            Priority: Minor
>             Fix For: Future
>
>
> debug[20:56:36,276]: Such element exist in document
> debug[20:56:36,289]: Attempt to update part of page for Id: j_id213:output
> debug[20:56:36,303]: call selectSingleNode for id= j_id213:output
> debug[20:56:36,318]: Replace content of node by outerHTML()
> error[20:56:36,333]: Error to clear node content by innerHTML Unknown runtime error
> debug[20:56:36,350]: search for elements by name 'script'  in element input
> debug[20:56:36,364]: selectNodes found 0
> debug[20:56:36,379]: Scripts in updated part count : 0
> debug[20:56:36,395]: Update part of page for Id: j_id213:output successful
> debug[20:56:36,410]: Attempt to update part of page for Id: j_id213:j_id214:29:j_id215
> debug[20:56:36,427]: call selectSingleNode for id= j_id213:j_id214:29:j_id215
> debug[20:56:36,446]: Replace content of node by outerHTML()
> error[20:56:36,461]: Error to clear node content by innerHTML Unknown runtime error
> For page:
> <ui:composition xmlns="http://www.w3.org/1999/xhtml" 
>       xmlns:ui="http://java.sun.com/jsf/facelets" 
>       xmlns:h="http://java.sun.com/jsf/html" 
>       xmlns:f="http://java.sun.com/jsf/core" 
>       xmlns:a4j="http://richfaces.org/a4j" 
>       xmlns:rich="http://richfaces.org/rich"> 
> <p>This tree uses "ajax" switch type, note that for collapse/expand operations it will be Ajax request to the server. You may see short delay in this case.</p><br/> 
> <h:form> 
> <h:inputText id="output" />
> <rich:tree style="width:300px" value="#{library.data}" var="item" nodeFace="#{item.type}"> 
> <rich:treeNode type="artist" iconLeaf="/images/tree/singer.gif" icon="/images/tree/singer.gif" reRender="output"> 
> <h:outputText value="1 #{item.name}" /> 
> </rich:treeNode> 
> <rich:treeNode type="album" iconLeaf="/images/tree/disc.gif" icon="/images/tree/disc.gif"> 
> <h:outputText value="#{item.title}" /> 
> </rich:treeNode> 
> <rich:treeNode type="song" iconLeaf="/images/tree/song.gif" icon="/images/tree/song.gif"> 
> <h:outputText value="#{item.title}" /> 
> </rich:treeNode> 
> </rich:tree> 
> </h:form> 
> <a4j:log popup="false"></a4j:log> 
> </ui:composition> 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the richfaces-issues mailing list