Re: BUG: Ajax Panel Replacement Issue on Fireforx only (Kind of Complex Scenario)
Great. On 11/2/07, Matej Knopp [EMAIL PROTECTED] wrote: Thanks, I've assigned the issue to me, will look at it as soon as I have time. -Matej On 11/1/07, Francisco Diaz Trepat - gmail [EMAIL PROTECTED] wrote: Done, I reported the issue. Attached the Ziped QuickStart and added the FIX or a Fix in the form of a Comment. Please let me know as I might done something incorrectly like filling the correct values for the properties of the Issue. Example: it is not major, it is minor. things like that. f(t) On 11/1/07, Matej Knopp [EMAIL PROTECTED] wrote: Yeah, that would work. Cheers, -Matej On 11/1/07, Francisco Diaz Trepat - gmail [EMAIL PROTECTED] wrote: Matej I've got the QuickStart. I've loaded it with Netbeans 6 beta 2 with the maven plugin. Everything compiled and ran perfectly. I added the panels that show the issue. Now what? Do I Zip the root project folder with all inside and attach it to a JIRA? thanks, f(t) On 10/31/07, Matej Knopp [EMAIL PROTECTED] wrote: Well, it's the last resort for you, but first resort for me :) Issues that are easily reproduce (quickstart) can expect to be resolved sooner, that's how it works. -Matej On 10/31/07, Francisco Diaz Trepat - gmail [EMAIL PROTECTED] wrote: Ok I wanted to leave the QuickStart the last resort. I'll get right on it. Jira + QuickStart. We must all contribute. :-) f(t) On 10/31/07, Matej Knopp [EMAIL PROTECTED] wrote: So even better than html page would be a quickstart attched to jira issue that you create about this problem :-) Cheers, -Matej On 10/31/07, Matej Knopp [EMAIL PROTECTED] wrote: Hi, I got your point. But I need a complete html file to be able to reproduce it with as little effort as possible :) My time is quite limited lately :( I don't mind fixing this in wicket, but I need to make sure that this is the right fix and has no side-effect. -Matej On 10/31/07, Francisco Diaz Trepat - gmail [EMAIL PROTECTED] wrote: Hi Matej. Have you read the the forwarded part of the last message? Because that is where I explained the behavior. Basically in Firefox if I replace a panel with two subpanels the second subpanel doesn't get replaced. Please check out the message bellow, the one I forwarded. If you see the org/apache/wicket/ajax/wicket-ajax.js in wicket-1.3.0-beta4.jar. You will see the code for the * Wicket.replaceOuterHtml* In there, I understand that there are two main things going on: 1) There is some code that it is not used and so, in our version we commented it. 2) And most important, we fixed a the issue for us by moving the nodes in the tree herarchy that appears wrongly in the get * range.createContextualFragment*() function from the Gecko (firefox) engine. If there are many subpanels, the range uncorrectly parses the content, resulting in a fragment that contains many childs instead of one. The HTML is explained bellow, if that explanation fails I'll try to send you a file. ok? Our function basically call the * Wicket.replaceOuterHtml=function (){ blah, blah* to replace the one in the framework with the fixed one. And we call the replacement on a window.setTimeOut() on the specific page in which we have the panel with subpanels. thanks, f(t) On 10/30/07, Matej Knopp [EMAIL PROTECTED] wrote: Sorry, I'm not sure I follow. there is some code in replaceOuterHtml that seems redundant so it could be like this: Wicket.replaceOuterHtml = function(element, text) { if (Wicket.Browser.isIE()) { Wicket.replaceOuterHtmlIE(element, text); } else if (Wicket.Browser.isSafari() || Wicket.Browser.isOpera()) { Wicket.replaceOuterHtmlSafari(element, text); } else /* GECKO */ { // create range and fragment var range = element.ownerDocument.createRange(); range.selectNode(element); var fragment = range.createContextualFragment (text); element.parentNode.replaceChild(fragment, element); } }
Re: BUG: Ajax Panel Replacement Issue on Fireforx only (Kind of Complex Scenario)
Thanks, I've assigned the issue to me, will look at it as soon as I have time. -Matej On 11/1/07, Francisco Diaz Trepat - gmail [EMAIL PROTECTED] wrote: Done, I reported the issue. Attached the Ziped QuickStart and added the FIX or a Fix in the form of a Comment. Please let me know as I might done something incorrectly like filling the correct values for the properties of the Issue. Example: it is not major, it is minor. things like that. f(t) On 11/1/07, Matej Knopp [EMAIL PROTECTED] wrote: Yeah, that would work. Cheers, -Matej On 11/1/07, Francisco Diaz Trepat - gmail [EMAIL PROTECTED] wrote: Matej I've got the QuickStart. I've loaded it with Netbeans 6 beta 2 with the maven plugin. Everything compiled and ran perfectly. I added the panels that show the issue. Now what? Do I Zip the root project folder with all inside and attach it to a JIRA? thanks, f(t) On 10/31/07, Matej Knopp [EMAIL PROTECTED] wrote: Well, it's the last resort for you, but first resort for me :) Issues that are easily reproduce (quickstart) can expect to be resolved sooner, that's how it works. -Matej On 10/31/07, Francisco Diaz Trepat - gmail [EMAIL PROTECTED] wrote: Ok I wanted to leave the QuickStart the last resort. I'll get right on it. Jira + QuickStart. We must all contribute. :-) f(t) On 10/31/07, Matej Knopp [EMAIL PROTECTED] wrote: So even better than html page would be a quickstart attched to jira issue that you create about this problem :-) Cheers, -Matej On 10/31/07, Matej Knopp [EMAIL PROTECTED] wrote: Hi, I got your point. But I need a complete html file to be able to reproduce it with as little effort as possible :) My time is quite limited lately :( I don't mind fixing this in wicket, but I need to make sure that this is the right fix and has no side-effect. -Matej On 10/31/07, Francisco Diaz Trepat - gmail [EMAIL PROTECTED] wrote: Hi Matej. Have you read the the forwarded part of the last message? Because that is where I explained the behavior. Basically in Firefox if I replace a panel with two subpanels the second subpanel doesn't get replaced. Please check out the message bellow, the one I forwarded. If you see the org/apache/wicket/ajax/wicket-ajax.js in wicket-1.3.0-beta4.jar. You will see the code for the * Wicket.replaceOuterHtml* In there, I understand that there are two main things going on: 1) There is some code that it is not used and so, in our version we commented it. 2) And most important, we fixed a the issue for us by moving the nodes in the tree herarchy that appears wrongly in the get * range.createContextualFragment*() function from the Gecko (firefox) engine. If there are many subpanels, the range uncorrectly parses the content, resulting in a fragment that contains many childs instead of one. The HTML is explained bellow, if that explanation fails I'll try to send you a file. ok? Our function basically call the * Wicket.replaceOuterHtml=function (){ blah, blah* to replace the one in the framework with the fixed one. And we call the replacement on a window.setTimeOut() on the specific page in which we have the panel with subpanels. thanks, f(t) On 10/30/07, Matej Knopp [EMAIL PROTECTED] wrote: Sorry, I'm not sure I follow. there is some code in replaceOuterHtml that seems redundant so it could be like this: Wicket.replaceOuterHtml = function(element, text) { if (Wicket.Browser.isIE()) { Wicket.replaceOuterHtmlIE(element, text); } else if (Wicket.Browser.isSafari() || Wicket.Browser.isOpera()) { Wicket.replaceOuterHtmlSafari(element, text); } else /* GECKO */ { // create range and fragment var range = element.ownerDocument.createRange(); range.selectNode(element); var fragment = range.createContextualFragment(text); element.parentNode.replaceChild(fragment, element); } } Still I'm not sure what the problem is that your code solves. Can you please provide me a html file where the replaceOuterHtml call fails? -Matej Francisco Diaz
Re: BUG: Ajax Panel Replacement Issue on Fireforx only (Kind of Complex Scenario)
Matej I've got the QuickStart. I've loaded it with Netbeans 6 beta 2 with the maven plugin. Everything compiled and ran perfectly. I added the panels that show the issue. Now what? Do I Zip the root project folder with all inside and attach it to a JIRA? thanks, f(t) On 10/31/07, Matej Knopp [EMAIL PROTECTED] wrote: Well, it's the last resort for you, but first resort for me :) Issues that are easily reproduce (quickstart) can expect to be resolved sooner, that's how it works. -Matej On 10/31/07, Francisco Diaz Trepat - gmail [EMAIL PROTECTED] wrote: Ok I wanted to leave the QuickStart the last resort. I'll get right on it. Jira + QuickStart. We must all contribute. :-) f(t) On 10/31/07, Matej Knopp [EMAIL PROTECTED] wrote: So even better than html page would be a quickstart attched to jira issue that you create about this problem :-) Cheers, -Matej On 10/31/07, Matej Knopp [EMAIL PROTECTED] wrote: Hi, I got your point. But I need a complete html file to be able to reproduce it with as little effort as possible :) My time is quite limited lately :( I don't mind fixing this in wicket, but I need to make sure that this is the right fix and has no side-effect. -Matej On 10/31/07, Francisco Diaz Trepat - gmail [EMAIL PROTECTED] wrote: Hi Matej. Have you read the the forwarded part of the last message? Because that is where I explained the behavior. Basically in Firefox if I replace a panel with two subpanels the second subpanel doesn't get replaced. Please check out the message bellow, the one I forwarded. If you see the org/apache/wicket/ajax/wicket-ajax.js in wicket-1.3.0-beta4.jar. You will see the code for the * Wicket.replaceOuterHtml* In there, I understand that there are two main things going on: 1) There is some code that it is not used and so, in our version we commented it. 2) And most important, we fixed a the issue for us by moving the nodes in the tree herarchy that appears wrongly in the get * range.createContextualFragment*() function from the Gecko (firefox) engine. If there are many subpanels, the range uncorrectly parses the content, resulting in a fragment that contains many childs instead of one. The HTML is explained bellow, if that explanation fails I'll try to send you a file. ok? Our function basically call the *Wicket.replaceOuterHtml=function (){ blah, blah* to replace the one in the framework with the fixed one. And we call the replacement on a window.setTimeOut() on the specific page in which we have the panel with subpanels. thanks, f(t) On 10/30/07, Matej Knopp [EMAIL PROTECTED] wrote: Sorry, I'm not sure I follow. there is some code in replaceOuterHtml that seems redundant so it could be like this: Wicket.replaceOuterHtml = function(element, text) { if (Wicket.Browser.isIE()) { Wicket.replaceOuterHtmlIE(element, text); } else if (Wicket.Browser.isSafari() || Wicket.Browser.isOpera()) { Wicket.replaceOuterHtmlSafari(element, text); } else /* GECKO */ { // create range and fragment var range = element.ownerDocument.createRange(); range.selectNode(element); var fragment = range.createContextualFragment(text); element.parentNode.replaceChild(fragment, element); } } Still I'm not sure what the problem is that your code solves. Can you please provide me a html file where the replaceOuterHtml call fails? -Matej Francisco Diaz Trepat - gmail wrote / napísal(a): Hi a cowerker here might have found something here. We have fix the issue by replacing the *Wicket.replaceOuterHtml* function. Could this be a BUG? I have forwarded the initial message that explains the behavior. Here is the code that fixed our problem: f(t) // // Hack that demonstrates a possible fix for a problem with Gecko based browsers. // The problem happens in this line: //var fragment = range.createContextualFragment(text); // If there are many subpanels, the range uncorrectly parses the content, resulting // in a fragment that contains many childs instead of one. // The first child is the first subpanel, and the rest are the other subpanels, // which are incorrectly hang at the same level as the main panel, instead of being // childs
Re: BUG: Ajax Panel Replacement Issue on Fireforx only (Kind of Complex Scenario)
Yeah, that would work. Cheers, -Matej On 11/1/07, Francisco Diaz Trepat - gmail [EMAIL PROTECTED] wrote: Matej I've got the QuickStart. I've loaded it with Netbeans 6 beta 2 with the maven plugin. Everything compiled and ran perfectly. I added the panels that show the issue. Now what? Do I Zip the root project folder with all inside and attach it to a JIRA? thanks, f(t) On 10/31/07, Matej Knopp [EMAIL PROTECTED] wrote: Well, it's the last resort for you, but first resort for me :) Issues that are easily reproduce (quickstart) can expect to be resolved sooner, that's how it works. -Matej On 10/31/07, Francisco Diaz Trepat - gmail [EMAIL PROTECTED] wrote: Ok I wanted to leave the QuickStart the last resort. I'll get right on it. Jira + QuickStart. We must all contribute. :-) f(t) On 10/31/07, Matej Knopp [EMAIL PROTECTED] wrote: So even better than html page would be a quickstart attched to jira issue that you create about this problem :-) Cheers, -Matej On 10/31/07, Matej Knopp [EMAIL PROTECTED] wrote: Hi, I got your point. But I need a complete html file to be able to reproduce it with as little effort as possible :) My time is quite limited lately :( I don't mind fixing this in wicket, but I need to make sure that this is the right fix and has no side-effect. -Matej On 10/31/07, Francisco Diaz Trepat - gmail [EMAIL PROTECTED] wrote: Hi Matej. Have you read the the forwarded part of the last message? Because that is where I explained the behavior. Basically in Firefox if I replace a panel with two subpanels the second subpanel doesn't get replaced. Please check out the message bellow, the one I forwarded. If you see the org/apache/wicket/ajax/wicket-ajax.js in wicket-1.3.0-beta4.jar. You will see the code for the * Wicket.replaceOuterHtml* In there, I understand that there are two main things going on: 1) There is some code that it is not used and so, in our version we commented it. 2) And most important, we fixed a the issue for us by moving the nodes in the tree herarchy that appears wrongly in the get * range.createContextualFragment*() function from the Gecko (firefox) engine. If there are many subpanels, the range uncorrectly parses the content, resulting in a fragment that contains many childs instead of one. The HTML is explained bellow, if that explanation fails I'll try to send you a file. ok? Our function basically call the *Wicket.replaceOuterHtml=function (){ blah, blah* to replace the one in the framework with the fixed one. And we call the replacement on a window.setTimeOut() on the specific page in which we have the panel with subpanels. thanks, f(t) On 10/30/07, Matej Knopp [EMAIL PROTECTED] wrote: Sorry, I'm not sure I follow. there is some code in replaceOuterHtml that seems redundant so it could be like this: Wicket.replaceOuterHtml = function(element, text) { if (Wicket.Browser.isIE()) { Wicket.replaceOuterHtmlIE(element, text); } else if (Wicket.Browser.isSafari() || Wicket.Browser.isOpera()) { Wicket.replaceOuterHtmlSafari(element, text); } else /* GECKO */ { // create range and fragment var range = element.ownerDocument.createRange(); range.selectNode(element); var fragment = range.createContextualFragment(text); element.parentNode.replaceChild(fragment, element); } } Still I'm not sure what the problem is that your code solves. Can you please provide me a html file where the replaceOuterHtml call fails? -Matej Francisco Diaz Trepat - gmail wrote / napísal(a): Hi a cowerker here might have found something here. We have fix the issue by replacing the *Wicket.replaceOuterHtml* function. Could this be a BUG? I have forwarded the initial message that explains the behavior. Here is the code that fixed our problem: f(t) // // Hack that demonstrates a possible fix for a problem with Gecko based browsers. // The problem happens in this line: //var fragment = range.createContextualFragment(text); // If there are many subpanels, the range uncorrectly parses the content, resulting
Re: BUG: Ajax Panel Replacement Issue on Fireforx only (Kind of Complex Scenario)
Done, I reported the issue. Attached the Ziped QuickStart and added the FIX or a Fix in the form of a Comment. Please let me know as I might done something incorrectly like filling the correct values for the properties of the Issue. Example: it is not major, it is minor. things like that. f(t) On 11/1/07, Matej Knopp [EMAIL PROTECTED] wrote: Yeah, that would work. Cheers, -Matej On 11/1/07, Francisco Diaz Trepat - gmail [EMAIL PROTECTED] wrote: Matej I've got the QuickStart. I've loaded it with Netbeans 6 beta 2 with the maven plugin. Everything compiled and ran perfectly. I added the panels that show the issue. Now what? Do I Zip the root project folder with all inside and attach it to a JIRA? thanks, f(t) On 10/31/07, Matej Knopp [EMAIL PROTECTED] wrote: Well, it's the last resort for you, but first resort for me :) Issues that are easily reproduce (quickstart) can expect to be resolved sooner, that's how it works. -Matej On 10/31/07, Francisco Diaz Trepat - gmail [EMAIL PROTECTED] wrote: Ok I wanted to leave the QuickStart the last resort. I'll get right on it. Jira + QuickStart. We must all contribute. :-) f(t) On 10/31/07, Matej Knopp [EMAIL PROTECTED] wrote: So even better than html page would be a quickstart attched to jira issue that you create about this problem :-) Cheers, -Matej On 10/31/07, Matej Knopp [EMAIL PROTECTED] wrote: Hi, I got your point. But I need a complete html file to be able to reproduce it with as little effort as possible :) My time is quite limited lately :( I don't mind fixing this in wicket, but I need to make sure that this is the right fix and has no side-effect. -Matej On 10/31/07, Francisco Diaz Trepat - gmail [EMAIL PROTECTED] wrote: Hi Matej. Have you read the the forwarded part of the last message? Because that is where I explained the behavior. Basically in Firefox if I replace a panel with two subpanels the second subpanel doesn't get replaced. Please check out the message bellow, the one I forwarded. If you see the org/apache/wicket/ajax/wicket-ajax.js in wicket-1.3.0-beta4.jar. You will see the code for the * Wicket.replaceOuterHtml* In there, I understand that there are two main things going on: 1) There is some code that it is not used and so, in our version we commented it. 2) And most important, we fixed a the issue for us by moving the nodes in the tree herarchy that appears wrongly in the get * range.createContextualFragment*() function from the Gecko (firefox) engine. If there are many subpanels, the range uncorrectly parses the content, resulting in a fragment that contains many childs instead of one. The HTML is explained bellow, if that explanation fails I'll try to send you a file. ok? Our function basically call the * Wicket.replaceOuterHtml=function (){ blah, blah* to replace the one in the framework with the fixed one. And we call the replacement on a window.setTimeOut() on the specific page in which we have the panel with subpanels. thanks, f(t) On 10/30/07, Matej Knopp [EMAIL PROTECTED] wrote: Sorry, I'm not sure I follow. there is some code in replaceOuterHtml that seems redundant so it could be like this: Wicket.replaceOuterHtml = function(element, text) { if (Wicket.Browser.isIE()) { Wicket.replaceOuterHtmlIE(element, text); } else if (Wicket.Browser.isSafari() || Wicket.Browser.isOpera()) { Wicket.replaceOuterHtmlSafari(element, text); } else /* GECKO */ { // create range and fragment var range = element.ownerDocument.createRange(); range.selectNode(element); var fragment = range.createContextualFragment(text); element.parentNode.replaceChild(fragment, element); } } Still I'm not sure what the problem is that your code solves. Can you please provide me a html file where the replaceOuterHtml call fails? -Matej Francisco Diaz Trepat - gmail wrote / napísal(a): Hi a cowerker here might have found something here. We have fix the issue by replacing the *Wicket.replaceOuterHtml* function. Could this be a BUG? I have forwarded the initial message that explains the behavior.
Re: BUG: Ajax Panel Replacement Issue on Fireforx only (Kind of Complex Scenario)
Hi Matej. Have you read the the forwarded part of the last message? Because that is where I explained the behavior. Basically in Firefox if I replace a panel with two subpanels the second subpanel doesn't get replaced. Please check out the message bellow, the one I forwarded. If you see the org/apache/wicket/ajax/wicket-ajax.js in wicket-1.3.0-beta4.jar. You will see the code for the * Wicket.replaceOuterHtml* In there, I understand that there are two main things going on: 1) There is some code that it is not used and so, in our version we commented it. 2) And most important, we fixed a the issue for us by moving the nodes in the tree herarchy that appears wrongly in the get * range.createContextualFragment*() function from the Gecko (firefox) engine. If there are many subpanels, the range uncorrectly parses the content, resulting in a fragment that contains many childs instead of one. The HTML is explained bellow, if that explanation fails I'll try to send you a file. ok? Our function basically call the *Wicket.replaceOuterHtml=function(){ blah, blah* to replace the one in the framework with the fixed one. And we call the replacement on a window.setTimeOut() on the specific page in which we have the panel with subpanels. thanks, f(t) On 10/30/07, Matej Knopp [EMAIL PROTECTED] wrote: Sorry, I'm not sure I follow. there is some code in replaceOuterHtml that seems redundant so it could be like this: Wicket.replaceOuterHtml = function(element, text) { if (Wicket.Browser.isIE()) { Wicket.replaceOuterHtmlIE(element, text); } else if (Wicket.Browser.isSafari() || Wicket.Browser.isOpera()) { Wicket.replaceOuterHtmlSafari(element, text); } else /* GECKO */ { // create range and fragment var range = element.ownerDocument.createRange(); range.selectNode(element); var fragment = range.createContextualFragment(text); element.parentNode.replaceChild(fragment, element); } } Still I'm not sure what the problem is that your code solves. Can you please provide me a html file where the replaceOuterHtml call fails? -Matej Francisco Diaz Trepat - gmail wrote / napísal(a): Hi a cowerker here might have found something here. We have fix the issue by replacing the *Wicket.replaceOuterHtml* function. Could this be a BUG? I have forwarded the initial message that explains the behavior. Here is the code that fixed our problem: f(t) // // Hack that demonstrates a possible fix for a problem with Gecko based browsers. // The problem happens in this line: //var fragment = range.createContextualFragment(text); // If there are many subpanels, the range uncorrectly parses the content, resulting // in a fragment that contains many childs instead of one. // The first child is the first subpanel, and the rest are the other subpanels, // which are incorrectly hang at the same level as the main panel, instead of being // childs of it. function replaceWicketReplaceOuterHtml() { Wicket.replaceOuterHtml = function(element, text) { if (Wicket.Browser.isIE()) { Wicket.replaceOuterHtmlIE(element, text); } else if (Wicket.Browser.isSafari() || Wicket.Browser.isOpera()) { Wicket.replaceOuterHtmlSafari(element, text); } else /* GECKO */ { // create range and fragment var range = element.ownerDocument.createRange(); range.selectNode(element); var fragment = range.createContextualFragment(text); // The following code seems useless, and then is commented out // get the elements to be added //var elements = new Array(); //for (var i = 0; i fragment.childNodes.length; ++i) //elements.push(fragment.childNodes[i]); // move additional subnodes to the correct place in the dom if (fragment.childNodes.length 1) { // the for clause intentionally starts from 1, // to fix only the wrongly hanging subnodes. for (var i = 1; i fragment.childNodes.length; ++i) { var otherNode = fragment.childNodes[i]; fragment.childNodes[0].childNodes[0].appendChild(otherNode); } } element.parentNode.replaceChild(fragment, element); } } } window.setTimeout(replaceWicketReplaceOuterHtml, 1000); // -- Forwarded message -- From: Francisco Diaz Trepat - gmail [EMAIL PROTECTED] Date: Oct 23, 2007 10:27 PM Subject: Re: Ajax Panel Replacement Issue on Fireforx only (Kind of Complex Scenario) To: users@wicket.apache.org Thanks Matej, I will but further ahead. I'll try to see what is going on with more detail by using FIREBUG toolbar or something of the sort. If everything
Re: BUG: Ajax Panel Replacement Issue on Fireforx only (Kind of Complex Scenario)
Hi, I got your point. But I need a complete html file to be able to reproduce it with as little effort as possible :) My time is quite limited lately :( I don't mind fixing this in wicket, but I need to make sure that this is the right fix and has no side-effect. -Matej On 10/31/07, Francisco Diaz Trepat - gmail [EMAIL PROTECTED] wrote: Hi Matej. Have you read the the forwarded part of the last message? Because that is where I explained the behavior. Basically in Firefox if I replace a panel with two subpanels the second subpanel doesn't get replaced. Please check out the message bellow, the one I forwarded. If you see the org/apache/wicket/ajax/wicket-ajax.js in wicket-1.3.0-beta4.jar. You will see the code for the * Wicket.replaceOuterHtml* In there, I understand that there are two main things going on: 1) There is some code that it is not used and so, in our version we commented it. 2) And most important, we fixed a the issue for us by moving the nodes in the tree herarchy that appears wrongly in the get * range.createContextualFragment*() function from the Gecko (firefox) engine. If there are many subpanels, the range uncorrectly parses the content, resulting in a fragment that contains many childs instead of one. The HTML is explained bellow, if that explanation fails I'll try to send you a file. ok? Our function basically call the *Wicket.replaceOuterHtml=function(){ blah, blah* to replace the one in the framework with the fixed one. And we call the replacement on a window.setTimeOut() on the specific page in which we have the panel with subpanels. thanks, f(t) On 10/30/07, Matej Knopp [EMAIL PROTECTED] wrote: Sorry, I'm not sure I follow. there is some code in replaceOuterHtml that seems redundant so it could be like this: Wicket.replaceOuterHtml = function(element, text) { if (Wicket.Browser.isIE()) { Wicket.replaceOuterHtmlIE(element, text); } else if (Wicket.Browser.isSafari() || Wicket.Browser.isOpera()) { Wicket.replaceOuterHtmlSafari(element, text); } else /* GECKO */ { // create range and fragment var range = element.ownerDocument.createRange(); range.selectNode(element); var fragment = range.createContextualFragment(text); element.parentNode.replaceChild(fragment, element); } } Still I'm not sure what the problem is that your code solves. Can you please provide me a html file where the replaceOuterHtml call fails? -Matej Francisco Diaz Trepat - gmail wrote / napísal(a): Hi a cowerker here might have found something here. We have fix the issue by replacing the *Wicket.replaceOuterHtml* function. Could this be a BUG? I have forwarded the initial message that explains the behavior. Here is the code that fixed our problem: f(t) // // Hack that demonstrates a possible fix for a problem with Gecko based browsers. // The problem happens in this line: //var fragment = range.createContextualFragment(text); // If there are many subpanels, the range uncorrectly parses the content, resulting // in a fragment that contains many childs instead of one. // The first child is the first subpanel, and the rest are the other subpanels, // which are incorrectly hang at the same level as the main panel, instead of being // childs of it. function replaceWicketReplaceOuterHtml() { Wicket.replaceOuterHtml = function(element, text) { if (Wicket.Browser.isIE()) { Wicket.replaceOuterHtmlIE(element, text); } else if (Wicket.Browser.isSafari() || Wicket.Browser.isOpera()) { Wicket.replaceOuterHtmlSafari(element, text); } else /* GECKO */ { // create range and fragment var range = element.ownerDocument.createRange(); range.selectNode(element); var fragment = range.createContextualFragment(text); // The following code seems useless, and then is commented out // get the elements to be added //var elements = new Array(); //for (var i = 0; i fragment.childNodes.length; ++i) //elements.push(fragment.childNodes[i]); // move additional subnodes to the correct place in the dom if (fragment.childNodes.length 1) { // the for clause intentionally starts from 1, // to fix only the wrongly hanging subnodes. for (var i = 1; i fragment.childNodes.length; ++i) { var otherNode = fragment.childNodes[i]; fragment.childNodes[0].childNodes[0].appendChild(otherNode); } } element.parentNode.replaceChild(fragment, element); } } } window.setTimeout(replaceWicketReplaceOuterHtml, 1000); //
Re: BUG: Ajax Panel Replacement Issue on Fireforx only (Kind of Complex Scenario)
Ok I wanted to leave the QuickStart the last resort. I'll get right on it. Jira + QuickStart. We must all contribute. :-) f(t) On 10/31/07, Matej Knopp [EMAIL PROTECTED] wrote: So even better than html page would be a quickstart attched to jira issue that you create about this problem :-) Cheers, -Matej On 10/31/07, Matej Knopp [EMAIL PROTECTED] wrote: Hi, I got your point. But I need a complete html file to be able to reproduce it with as little effort as possible :) My time is quite limited lately :( I don't mind fixing this in wicket, but I need to make sure that this is the right fix and has no side-effect. -Matej On 10/31/07, Francisco Diaz Trepat - gmail [EMAIL PROTECTED] wrote: Hi Matej. Have you read the the forwarded part of the last message? Because that is where I explained the behavior. Basically in Firefox if I replace a panel with two subpanels the second subpanel doesn't get replaced. Please check out the message bellow, the one I forwarded. If you see the org/apache/wicket/ajax/wicket-ajax.js in wicket-1.3.0-beta4.jar. You will see the code for the * Wicket.replaceOuterHtml* In there, I understand that there are two main things going on: 1) There is some code that it is not used and so, in our version we commented it. 2) And most important, we fixed a the issue for us by moving the nodes in the tree herarchy that appears wrongly in the get * range.createContextualFragment*() function from the Gecko (firefox) engine. If there are many subpanels, the range uncorrectly parses the content, resulting in a fragment that contains many childs instead of one. The HTML is explained bellow, if that explanation fails I'll try to send you a file. ok? Our function basically call the *Wicket.replaceOuterHtml=function(){ blah, blah* to replace the one in the framework with the fixed one. And we call the replacement on a window.setTimeOut() on the specific page in which we have the panel with subpanels. thanks, f(t) On 10/30/07, Matej Knopp [EMAIL PROTECTED] wrote: Sorry, I'm not sure I follow. there is some code in replaceOuterHtml that seems redundant so it could be like this: Wicket.replaceOuterHtml = function(element, text) { if (Wicket.Browser.isIE()) { Wicket.replaceOuterHtmlIE(element, text); } else if (Wicket.Browser.isSafari() || Wicket.Browser.isOpera()) { Wicket.replaceOuterHtmlSafari(element, text); } else /* GECKO */ { // create range and fragment var range = element.ownerDocument.createRange(); range.selectNode(element); var fragment = range.createContextualFragment(text); element.parentNode.replaceChild(fragment, element); } } Still I'm not sure what the problem is that your code solves. Can you please provide me a html file where the replaceOuterHtml call fails? -Matej Francisco Diaz Trepat - gmail wrote / napísal(a): Hi a cowerker here might have found something here. We have fix the issue by replacing the *Wicket.replaceOuterHtml* function. Could this be a BUG? I have forwarded the initial message that explains the behavior. Here is the code that fixed our problem: f(t) // // Hack that demonstrates a possible fix for a problem with Gecko based browsers. // The problem happens in this line: //var fragment = range.createContextualFragment(text); // If there are many subpanels, the range uncorrectly parses the content, resulting // in a fragment that contains many childs instead of one. // The first child is the first subpanel, and the rest are the other subpanels, // which are incorrectly hang at the same level as the main panel, instead of being // childs of it. function replaceWicketReplaceOuterHtml() { Wicket.replaceOuterHtml = function(element, text) { if (Wicket.Browser.isIE()) { Wicket.replaceOuterHtmlIE(element, text); } else if (Wicket.Browser.isSafari() || Wicket.Browser.isOpera()) { Wicket.replaceOuterHtmlSafari(element, text); } else /* GECKO */ { // create range and fragment var range = element.ownerDocument.createRange(); range.selectNode(element); var fragment = range.createContextualFragment(text); // The following code seems useless, and then is commented out // get the elements to be added //var elements = new Array(); //for (var i = 0; i fragment.childNodes.length; ++i) //elements.push(fragment.childNodes[i]);
Re: BUG: Ajax Panel Replacement Issue on Fireforx only (Kind of Complex Scenario)
Well, it's the last resort for you, but first resort for me :) Issues that are easily reproduce (quickstart) can expect to be resolved sooner, that's how it works. -Matej On 10/31/07, Francisco Diaz Trepat - gmail [EMAIL PROTECTED] wrote: Ok I wanted to leave the QuickStart the last resort. I'll get right on it. Jira + QuickStart. We must all contribute. :-) f(t) On 10/31/07, Matej Knopp [EMAIL PROTECTED] wrote: So even better than html page would be a quickstart attched to jira issue that you create about this problem :-) Cheers, -Matej On 10/31/07, Matej Knopp [EMAIL PROTECTED] wrote: Hi, I got your point. But I need a complete html file to be able to reproduce it with as little effort as possible :) My time is quite limited lately :( I don't mind fixing this in wicket, but I need to make sure that this is the right fix and has no side-effect. -Matej On 10/31/07, Francisco Diaz Trepat - gmail [EMAIL PROTECTED] wrote: Hi Matej. Have you read the the forwarded part of the last message? Because that is where I explained the behavior. Basically in Firefox if I replace a panel with two subpanels the second subpanel doesn't get replaced. Please check out the message bellow, the one I forwarded. If you see the org/apache/wicket/ajax/wicket-ajax.js in wicket-1.3.0-beta4.jar. You will see the code for the * Wicket.replaceOuterHtml* In there, I understand that there are two main things going on: 1) There is some code that it is not used and so, in our version we commented it. 2) And most important, we fixed a the issue for us by moving the nodes in the tree herarchy that appears wrongly in the get * range.createContextualFragment*() function from the Gecko (firefox) engine. If there are many subpanels, the range uncorrectly parses the content, resulting in a fragment that contains many childs instead of one. The HTML is explained bellow, if that explanation fails I'll try to send you a file. ok? Our function basically call the *Wicket.replaceOuterHtml=function(){ blah, blah* to replace the one in the framework with the fixed one. And we call the replacement on a window.setTimeOut() on the specific page in which we have the panel with subpanels. thanks, f(t) On 10/30/07, Matej Knopp [EMAIL PROTECTED] wrote: Sorry, I'm not sure I follow. there is some code in replaceOuterHtml that seems redundant so it could be like this: Wicket.replaceOuterHtml = function(element, text) { if (Wicket.Browser.isIE()) { Wicket.replaceOuterHtmlIE(element, text); } else if (Wicket.Browser.isSafari() || Wicket.Browser.isOpera()) { Wicket.replaceOuterHtmlSafari(element, text); } else /* GECKO */ { // create range and fragment var range = element.ownerDocument.createRange(); range.selectNode(element); var fragment = range.createContextualFragment(text); element.parentNode.replaceChild(fragment, element); } } Still I'm not sure what the problem is that your code solves. Can you please provide me a html file where the replaceOuterHtml call fails? -Matej Francisco Diaz Trepat - gmail wrote / napísal(a): Hi a cowerker here might have found something here. We have fix the issue by replacing the *Wicket.replaceOuterHtml* function. Could this be a BUG? I have forwarded the initial message that explains the behavior. Here is the code that fixed our problem: f(t) // // Hack that demonstrates a possible fix for a problem with Gecko based browsers. // The problem happens in this line: //var fragment = range.createContextualFragment(text); // If there are many subpanels, the range uncorrectly parses the content, resulting // in a fragment that contains many childs instead of one. // The first child is the first subpanel, and the rest are the other subpanels, // which are incorrectly hang at the same level as the main panel, instead of being // childs of it. function replaceWicketReplaceOuterHtml() { Wicket.replaceOuterHtml = function(element, text) { if (Wicket.Browser.isIE()) { Wicket.replaceOuterHtmlIE(element, text); } else if (Wicket.Browser.isSafari() || Wicket.Browser.isOpera()) { Wicket.replaceOuterHtmlSafari(element, text); } else /* GECKO */ { // create range and fragment var range = element.ownerDocument.createRange();
Re: BUG: Ajax Panel Replacement Issue on Fireforx only (Kind of Complex Scenario)
Sorry, I'm not sure I follow. there is some code in replaceOuterHtml that seems redundant so it could be like this: Wicket.replaceOuterHtml = function(element, text) { if (Wicket.Browser.isIE()) { Wicket.replaceOuterHtmlIE(element, text); } else if (Wicket.Browser.isSafari() || Wicket.Browser.isOpera()) { Wicket.replaceOuterHtmlSafari(element, text); } else /* GECKO */ { // create range and fragment var range = element.ownerDocument.createRange(); range.selectNode(element); var fragment = range.createContextualFragment(text); element.parentNode.replaceChild(fragment, element); } } Still I'm not sure what the problem is that your code solves. Can you please provide me a html file where the replaceOuterHtml call fails? -Matej Francisco Diaz Trepat - gmail wrote / napísal(a): Hi a cowerker here might have found something here. We have fix the issue by replacing the *Wicket.replaceOuterHtml* function. Could this be a BUG? I have forwarded the initial message that explains the behavior. Here is the code that fixed our problem: f(t) // // Hack that demonstrates a possible fix for a problem with Gecko based browsers. // The problem happens in this line: //var fragment = range.createContextualFragment(text); // If there are many subpanels, the range uncorrectly parses the content, resulting // in a fragment that contains many childs instead of one. // The first child is the first subpanel, and the rest are the other subpanels, // which are incorrectly hang at the same level as the main panel, instead of being // childs of it. function replaceWicketReplaceOuterHtml() { Wicket.replaceOuterHtml = function(element, text) { if (Wicket.Browser.isIE()) { Wicket.replaceOuterHtmlIE(element, text); } else if (Wicket.Browser.isSafari() || Wicket.Browser.isOpera()) { Wicket.replaceOuterHtmlSafari(element, text); } else /* GECKO */ { // create range and fragment var range = element.ownerDocument.createRange(); range.selectNode(element); var fragment = range.createContextualFragment(text); // The following code seems useless, and then is commented out // get the elements to be added //var elements = new Array(); //for (var i = 0; i fragment.childNodes.length; ++i) //elements.push(fragment.childNodes[i]); // move additional subnodes to the correct place in the dom if (fragment.childNodes.length 1) { // the for clause intentionally starts from 1, // to fix only the wrongly hanging subnodes. for (var i = 1; i fragment.childNodes.length; ++i) { var otherNode = fragment.childNodes[i]; fragment.childNodes[0].childNodes[0].appendChild(otherNode); } } element.parentNode.replaceChild(fragment, element); } } } window.setTimeout(replaceWicketReplaceOuterHtml, 1000); // -- Forwarded message -- From: Francisco Diaz Trepat - gmail [EMAIL PROTECTED] Date: Oct 23, 2007 10:27 PM Subject: Re: Ajax Panel Replacement Issue on Fireforx only (Kind of Complex Scenario) To: users@wicket.apache.org Thanks Matej, I will but further ahead. I'll try to see what is going on with more detail by using FIREBUG toolbar or something of the sort. If everything else fails I'll provide a QuickStart. Thanks, f(t) On 10/23/07, Matej Knopp [EMAIL PROTECTED] wrote: Can you provide a quickstart? -Matej On 10/23/07, Francisco Diaz Trepat - gmail [EMAIL PROTECTED] wrote: Hi. I'm going to try to explain the best that I can and without posting code at first the issue that is happening. I have the following panels A and C. A has two instances of B nested inside of it. C is empty: [ ==PANEL-A== [ ==PANEL-B1== ] [ ==PANEL-B2== ] ] [ ==PANEL-C== ] What happens is that on another Panel that represent the Page content, lets call it ContentPanel I need to toggle between panels A and C with the click of an Ajax Link. The first state is with panel C that it is empty (actually with lots of HiddenFields, but empty visually). On click I need to Show the A panel that has viewable content. Finally on another click I need to go back to the original state of C panel. So far so good. The issue is as follows: The problem happens on Firefox only (latest version 2.0.0.8) (on IE 6 and 7 it is not an issue as everything works fine). What happens is that I click on the link, and panel A shows perfectly. But when I click again to put the C panel back, the A panel gets Partially removed, that is panel A's first panel B instance B1 gets removed, but B2 is not removed and it is still