Return-Path: Delivered-To: apmail-myfaces-dev-archive@www.apache.org Received: (qmail 88213 invoked from network); 11 May 2010 02:43:56 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 11 May 2010 02:43:56 -0000 Received: (qmail 26196 invoked by uid 500); 11 May 2010 02:43:56 -0000 Delivered-To: apmail-myfaces-dev-archive@myfaces.apache.org Received: (qmail 26089 invoked by uid 500); 11 May 2010 02:43:56 -0000 Mailing-List: contact dev-help@myfaces.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "MyFaces Development" Delivered-To: mailing list dev@myfaces.apache.org Received: (qmail 26082 invoked by uid 99); 11 May 2010 02:43:55 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 May 2010 02:43:55 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 May 2010 02:43:51 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o4B2hUQ0000641 for ; Tue, 11 May 2010 02:43:30 GMT Message-ID: <18455301.12171273545810302.JavaMail.jira@thor> Date: Mon, 10 May 2010 22:43:30 -0400 (EDT) From: "Mark Li (JIRA)" To: dev@myfaces.apache.org Subject: [jira] Commented: (MYFACES-2640) (JSF.js) Ajax Render component problem, replace with whole fragment not one element. In-Reply-To: <334855626.650281270175787184.JavaMail.jira@brutus.apache.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/MYFACES-2640?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12866030#action_12866030 ] Mark Li commented on MYFACES-2640: ---------------------------------- Hey Werner, Ok discuss this on the users mailinglist . > (JSF.js) Ajax Render component problem, replace with whole fragment not one element. > ------------------------------------------------------------------------------------ > > Key: MYFACES-2640 > URL: https://issues.apache.org/jira/browse/MYFACES-2640 > Project: MyFaces Core > Issue Type: Bug > Components: JSR-314 > Affects Versions: 2.0.0-beta-3 > Environment: tomcat 6.0.20 java (mac os x ) > Reporter: Mark Li > Fix For: 2.0.1-SNAPSHOT > > Original Estimate: 4h > Remaining Estimate: 4h > > after ajax submit, jsf.js will re-render some element depending on jsf.ajax.request({render:" some elements "}); > but this js code will cause some problem. > jsf.js: > myfaces._impl._util._Utils.replaceHtmlItem = function (request, context, itemIdToReplace, newTag, form) { > ...... > var fragment = range.createContextualFragment(newTag); > evalNode = item.parentNode.replaceChild(fragment, item) > ..... > } > sometime fragment will has more than one childNodes, or the childNode not has clientId, but the childNode of childNode has clientId. > this will cause html unstable. > Please fix it. > this is my suggestion: > myfaces._impl._util._Utils.replaceHtmlItem = function (request, context, itemIdToReplace, newTag, form) { > ............. > Orginal: > var fragment = range.createContextualFragment(newTag); > evalNode = item.parentNode.replaceChild(fragment, item) > fix: > var fragment = range.createContextualFragment(newTag); > var replaceItem = myfaces._impl._util._Utils.findHtmlItemFromFragment(fragment, itemIdToReplace); > if(replaceItem == null)replaceItem = fragment; > evalNode = item.parentNode.replaceChild(replaceItem, item) > .................. > } > myfaces._impl._util._Utils.findHtmlItemFromFragment = function(fragment, itemId){ > if(fragment.childNodes == null) > return null; > for(var i = 0; i < fragment.childNodes.length ; i++ ){ > var c = fragment.childNodes[i]; > if(c.id == itemId) > return c; > } > for(var i = 0; i < fragment.childNodes.length ; i++ ){ > var c = fragment.childNodes[i]; > var item = myfaces._impl._util._Utils.findHtmlItemFromFragment(c, itemId); > if(item != null) > return item; > } > return null; > }; -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.