[JBoss JIRA] (RF-12860) AccordionItem.js with error cause browser crash
by David Lee (JIRA)
[ https://issues.jboss.org/browse/RF-12860?page=com.atlassian.jira.plugin.s... ]
David Lee commented on RF-12860:
--------------------------------
Looks like because I add this line:
Array.prototype.remove = function(s) {
for (var i = 0; i < this.length; i++) {
if (s == this[i])
this.splice(i, 1);
}
};
So when AccordionItem.js tried to get the items in Array, it get the "remove" which doesn't have "__header"
> AccordionItem.js with error cause browser crash
> -----------------------------------------------
>
> Key: RF-12860
> URL: https://issues.jboss.org/browse/RF-12860
> Project: RichFaces
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: component-output
> Affects Versions: 4.3.0.Final
> Environment: JBOSS7/JSF2/FirefoxESR10 or Chrome25.0.1
> Reporter: David Lee
> Assignee: Jan Papousek
> Labels: javascript, rich:accordionItem
> Fix For: 4.3.2
>
>
> Put the rich:accordionItem and rich:extendedDataTable on same page,
> and just click on any column for sort.
> The firebug will show an error:
> items[i].__header is not a function
> [Break On This Error]
> h -= items[i].__header().outerHeight();
> Looks like accordionItem.js line48 been triggered when sort:
> $(document).one("javascriptServiceComplete", function () {
> item.__fitToHeight(item.getTogglePanel());
> });
> And after this happened, my whole thing crashed.
> Now more sortable or click for any action.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
11 years, 8 months
[JBoss JIRA] (RF-12860) AccordionItem.js with error cause browser crash
by David Lee (JIRA)
[ https://issues.jboss.org/browse/RF-12860?page=com.atlassian.jira.plugin.s... ]
David Lee commented on RF-12860:
--------------------------------
Hi Jan,
I been tried for your code,
and true...it won't happened.
And I tried to find what's wrong in my code,
I found if I add the following JavaScript it will crash.
But I add these code to your code it's fine.
Still trying to debug.
<script type="text/javascript">
//<![CDATA[
/*
* For Map
*
*/
Array.prototype.remove = function(s) {
for (var i = 0; i < this.length; i++) {
if (s == this[i])
this.splice(i, 1);
}
};
function Map() {
this.keys = new Array();
this.data = new Object();
this.put = function(key, value) {
if(this.data[key] == null){
this.keys.push(key);
}
this.data[key] = value;
};
this.get = function(key) {
return this.data[key];
};
this.remove = function(key) {
this.keys.remove(key);
this.data[key] = null;
};
this.each = function(fn){
if(typeof fn != 'function'){
return;
}
var len = this.keys.length;
for(var i=0;i<len;i++){
var k = this.keys[i];
fn(k,this.data[k],i);
}
};
this.entrys = function() {
var len = this.keys.length;
var entrys = new Array(len);
for (var i = 0; i < len; i++) {
entrys[i] = {
key : this.keys[i],
value : this.data[i]
};
}
return entrys;
};
this.isEmpty = function() {
return this.keys.length == 0;
};
this.size = function(){
return this.keys.length;
};
this.toString = function(){
var s = "{";
for(var i=0;i<this.keys.length;i++,s+=','){
var k = this.keys[i];
s += k+"="+this.data[k];
}
s+="}";
return s;
};
}
//]]>
</script>
> AccordionItem.js with error cause browser crash
> -----------------------------------------------
>
> Key: RF-12860
> URL: https://issues.jboss.org/browse/RF-12860
> Project: RichFaces
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: component-output
> Affects Versions: 4.3.0.Final
> Environment: JBOSS7/JSF2/FirefoxESR10 or Chrome25.0.1
> Reporter: David Lee
> Assignee: Jan Papousek
> Labels: javascript, rich:accordionItem
> Fix For: 4.3.2
>
>
> Put the rich:accordionItem and rich:extendedDataTable on same page,
> and just click on any column for sort.
> The firebug will show an error:
> items[i].__header is not a function
> [Break On This Error]
> h -= items[i].__header().outerHeight();
> Looks like accordionItem.js line48 been triggered when sort:
> $(document).one("javascriptServiceComplete", function () {
> item.__fitToHeight(item.getTogglePanel());
> });
> And after this happened, my whole thing crashed.
> Now more sortable or click for any action.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
11 years, 8 months
[JBoss JIRA] (RF-12862) Evaluate how hard it would be to migrate jsf-test for components (using HtmlUnitEnvironment) to fundamental tests
by Brian Leathem (JIRA)
[ https://issues.jboss.org/browse/RF-12862?page=com.atlassian.jira.plugin.s... ]
Brian Leathem commented on RF-12862:
------------------------------------
That might be a good approach to explore then, to keep the execution speed of the current unit tests fast.
> Evaluate how hard it would be to migrate jsf-test for components (using HtmlUnitEnvironment) to fundamental tests
> -----------------------------------------------------------------------------------------------------------------
>
> Key: RF-12862
> URL: https://issues.jboss.org/browse/RF-12862
> Project: RichFaces
> Issue Type: Task
> Security Level: Public(Everyone can see)
> Components: tests - functional
> Reporter: Lukáš Fryč
> Fix For: 5.0.0.Alpha1
>
>
> The advantage of migrating the tests is improved debuggability.
> It seems that migration of the component-specific tests is pretty straight-forward, the proof of concept was done for [{{AjaxValidationTest}}|https://github.com/richfaces/richfaces5/commit/bf0f460dada7530cfc43de7837ce98c073bbb5af#diff-8].
> We need to evaluate how much of similar tests we have and if it's worth to migrate them.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
11 years, 8 months