[JBoss JIRA] (RF-13780) Random JavaScript error due to missing attribute 'richfaces.RICH_CONTAINER'
by Michal Petrov (JIRA)
[ https://issues.jboss.org/browse/RF-13780?page=com.atlassian.jira.plugin.s... ]
Michal Petrov commented on RF-13780:
------------------------------------
[~michaelb80], going from 4.3.x to 4.5 requires an update in POM (unless you've been extending the Java code). The guide is a bit out of date but that's still the bulk of it. It should be trivial to migrate.
> Random JavaScript error due to missing attribute 'richfaces.RICH_CONTAINER'
> ---------------------------------------------------------------------------
>
> Key: RF-13780
> URL: https://issues.jboss.org/browse/RF-13780
> Project: RichFaces
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: component, component-tree
> Affects Versions: 4.3.7
> Environment: RichFaces 4.3.7
> Mojarra 2.1.29
> Java 7 Update 67 (x64)
> Tomcat 7.0.52 (x64)
> Firefox 31
> Reporter: Michael B
>
> First of all: this is a bug report which may be related to RF-13776, since it also originates in the same spot of the JavaScript library of RichFaces.
> Preface:
> The problem is difficult to reproduce systematically, since it only seems to occur in one of n cases of loading one and the same complex xhtml (with exactly the same data from the backing bean).
> The problem is described based on the rich:tree component when clicking on the expand icon of a treeNode which fires a "ToggleEvent".
> Occasionally there is a JavaScript error in the last line of
> {code}
> richfaces.ui.TreeNode.emitToggleEvent = function(nodeId) {
> var node = document.getElementById(nodeId);
> if (!node) {
> return;
> }
> richfaces.$(node).__fireToggleEvent();
> };
> {code}
> When the problem occurs, the expression {code}richfaces.$(node){code} evaluates to 'undefined'.
> Debugging into the function when the problem occurs:
> {code:title=richfaces.$|borderStyle=solid}
> richfaces.$ = function(source) {
> var element = richfaces.getDomElement( source );
> if(element)
> {
> return( element[richfaces.RICH_CONTAINER] || {} )["component"]
> }
> };
> {code}
> While the element is correctly evaluated to the treeNode/treeNodeToggle-source, the expression {code}element[richfaces.RICH_CONTAINER]{code} evaluates to 'undefined'.
> Reloading the page one or more times produces correct results, where the attribute is set.
> To be able to provide a reproducable example of the problem, please provide some information under which circumstances the property may not be set correctly for some components. Please also give us a hint, where to debug into the RF JavaScript code to find the spot where this property is set.
> Although the problem doesn't occur all the time, it happens quite often with the effect of breaking the entire application. So for future versions I would suggest a check if {code}richfaces.$(xyz){code} evalutes to a valid result, before invoking any operations on the result and maybe write a message to the a4j:log in cases where a valid result is expected but not returned.
--
This message was sent by Atlassian JIRA
(v6.2.6#6264)
10 years, 4 months
[JBoss JIRA] (RF-13780) Random JavaScript error due to missing attribute 'richfaces.RICH_CONTAINER'
by Michael B (JIRA)
[ https://issues.jboss.org/browse/RF-13780?page=com.atlassian.jira.plugin.s... ]
Michael B edited comment on RF-13780 at 8/18/14 5:40 AM:
---------------------------------------------------------
[~bleathem] it seems you are right - it looks like a problem after an AJAX update. - I'll get to that in a moment...
First, thanks for the link to the debug guide, - besides ui:debug, we're already using what's described there.
Trying with RF 4.5.0 Alpha 3 unfortunately is not an option at this point in time, because we are already far behind our project schedule due to several problems with JSF(Mojarra) and RF. Also migrating a really big application to RF 4.5 (even if its just for testing) takes time we don't have right now and by the looks of it is no trivial matter - at least if I consider the migration guide [https://github.com/richfaces/richfaces/wiki/Migration-from-RichFaces-4-to...].
Reproducing the problem with a small test application (as we usually do it) failed on the first try. But maybe we can afford a little more time to trying to reproduce the problem in that environment and then migrating the test application to RF 4.5 ...
But back to the original problem - we tried to debug a little further with the big application and what we've found so far seems to confirm that the problem lies in an AJAX update:
# The "toggleType" of the tree is set to "ajax", because there's some data loading and calculations to be done when toggling the tree
# Clicking on a tree expander icon fires the ajax request
# The partial response is evaluated and updates several components
# One of the components in the partial response update is {code}<...>:tree:treeModelAdapter.0.treeModelAdapter.2:treeNode{code} BTW: "limitRender" is not respected if set on the tree! (which causes other problems - maybe also this one?!) - so that's why there are updates to other components like messages etc. as well.
# The partial response is handled by this function: {code} var ajaxOnComplete = function (data) {
var type = data.type;
var responseXML = data.responseXML;
if (data.type == 'event' && data.status == 'complete' && responseXML) {
var partialResponse = jQuery(responseXML).children("partial-response");
if (partialResponse && partialResponse.length) {
var elements = partialResponse.children('changes').children('update, delete');
jQuery.each(elements, function () {
richfaces.cleanDom(jQuery(this).attr('id'));
});
}
}
};{code}
# For every updated or deleted component "richfaces.cleanDom" is invoked. "cleanDom" calls "cleanComponent" which in the end calls "detach" (already shown in a previous post above)
# This leads to the tree node {code}<...>:tree:treeModelAdapter.0.treeModelAdapter.2:treeNode.rf-tr-nd.rf-tr-nd-colps{code} losing its "component" attachment.
# After cleanig the DOM, the components are attached to the elements. I can see - amongst others - a call to "attachToDom" for the ID {code}<...>:tree:treeModelAdapter.0.treeModelAdapter.2:treeNode.rf-tr-nd.rf-tr-nd-exp{code}
# After processing the partial response the toggleEvent is fired as already described above.
# The function "richfaces.$" doesn't find the tree node component anymore, because it has been detached and re-attached to the expanded node just a moment ago
was (Author: michaelb80):
[~bleathem] it seems you are right - it looks like a problem after an AJAX update. - I'll get to that in a moment...
First, thanks for the link to the debug guide, - besides ui:debug, we're already using what's described there.
Trying with RF 4.5.0 Alpha 3 unfortunately is not an option at this point in time, because we are already far behind our project schedule due to several problems with JSF(Mojarra) and RF. Also migrating a really big application to RF 4.5 (even if its just for testing) takes time we don't have right now and by the looks of it is no trivial matter - at least if I consider the migration guide [https://github.com/richfaces/richfaces/wiki/Migration-from-RichFaces-4-to...].
Reproducing the problem with a small test application (as we usually do it) failed on the first try. But maybe we can afford a little more time to trying to reproduce the problem in that environment and then migrating the test application to RF 4.5 ...
But back to the original problem - we tried to debug a little further with the big application and what we've found so far seems to confirm that the problem lies in an AJAX update:
# The "toggleType" of the tree is set to "ajax", because there's some data loading and calculations to be done when toggling the tree
# Clicking on a tree expander icon fires the ajax request
# The partial response is evaluated and updates several components
# One of the components in the partial response update is {code}<...>:tree:treeModelAdapter.0.treeModelAdapter.2:treeNode{code} BTW: "limitRender" is not respected if set on the tree! (which btw causes other problems) - so that's why there are updates to other components like messages etc. as well.
# The partial response is handled by this function: {code} var ajaxOnComplete = function (data) {
var type = data.type;
var responseXML = data.responseXML;
if (data.type == 'event' && data.status == 'complete' && responseXML) {
var partialResponse = jQuery(responseXML).children("partial-response");
if (partialResponse && partialResponse.length) {
var elements = partialResponse.children('changes').children('update, delete');
jQuery.each(elements, function () {
richfaces.cleanDom(jQuery(this).attr('id'));
});
}
}
};{code}
# For every updated or deleted component "richfaces.cleanDom" is invoked. "cleanDom" calls "cleanComponent" which in the end calls "detach" (already shown in a previous post above)
# Thise leads to the tree node {code}<...>:tree:treeModelAdapter.0.treeModelAdapter.2:treeNode.rf-tr-nd.rf-tr-nd-colps{code} losing its "component" attachment.
# After cleanig the DOM, the components are attached to the elements. I can see - amongst others - a call to "attachToDom" for the ID {code}<...>:tree:treeModelAdapter.0.treeModelAdapter.2:treeNode.rf-tr-nd.rf-tr-nd-exp{code}
# After processing the partial response the toggleEvent is fired as already described above. The source id for that event is {code}<...>:tree:treeModelAdapter.0.treeModelAdapter.2:treeNode.rf-tr-nd.rf-tr-nd-colps{code} - Note that the ID for the event source is still *rf-tr-nd-colps*!
# The function "richfaces.$" doesn't find the tree node component by that event ID anymore, because it has been detached and re-attached to the expanded node just a moment ago
Including the state dependent IDs as part of the event handling IDs may be is what's causing the problem - because they do change during the AJAX update...- What do you think?
Also, what can we do to work around the problem?
> Random JavaScript error due to missing attribute 'richfaces.RICH_CONTAINER'
> ---------------------------------------------------------------------------
>
> Key: RF-13780
> URL: https://issues.jboss.org/browse/RF-13780
> Project: RichFaces
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: component, component-tree
> Affects Versions: 4.3.7
> Environment: RichFaces 4.3.7
> Mojarra 2.1.29
> Java 7 Update 67 (x64)
> Tomcat 7.0.52 (x64)
> Firefox 31
> Reporter: Michael B
>
> First of all: this is a bug report which may be related to RF-13776, since it also originates in the same spot of the JavaScript library of RichFaces.
> Preface:
> The problem is difficult to reproduce systematically, since it only seems to occur in one of n cases of loading one and the same complex xhtml (with exactly the same data from the backing bean).
> The problem is described based on the rich:tree component when clicking on the expand icon of a treeNode which fires a "ToggleEvent".
> Occasionally there is a JavaScript error in the last line of
> {code}
> richfaces.ui.TreeNode.emitToggleEvent = function(nodeId) {
> var node = document.getElementById(nodeId);
> if (!node) {
> return;
> }
> richfaces.$(node).__fireToggleEvent();
> };
> {code}
> When the problem occurs, the expression {code}richfaces.$(node){code} evaluates to 'undefined'.
> Debugging into the function when the problem occurs:
> {code:title=richfaces.$|borderStyle=solid}
> richfaces.$ = function(source) {
> var element = richfaces.getDomElement( source );
> if(element)
> {
> return( element[richfaces.RICH_CONTAINER] || {} )["component"]
> }
> };
> {code}
> While the element is correctly evaluated to the treeNode/treeNodeToggle-source, the expression {code}element[richfaces.RICH_CONTAINER]{code} evaluates to 'undefined'.
> Reloading the page one or more times produces correct results, where the attribute is set.
> To be able to provide a reproducable example of the problem, please provide some information under which circumstances the property may not be set correctly for some components. Please also give us a hint, where to debug into the RF JavaScript code to find the spot where this property is set.
> Although the problem doesn't occur all the time, it happens quite often with the effect of breaking the entire application. So for future versions I would suggest a check if {code}richfaces.$(xyz){code} evalutes to a valid result, before invoking any operations on the result and maybe write a message to the a4j:log in cases where a valid result is expected but not returned.
--
This message was sent by Atlassian JIRA
(v6.2.6#6264)
10 years, 4 months
[JBoss JIRA] (RF-13780) Random JavaScript error due to missing attribute 'richfaces.RICH_CONTAINER'
by Michael B (JIRA)
[ https://issues.jboss.org/browse/RF-13780?page=com.atlassian.jira.plugin.s... ]
Michael B edited comment on RF-13780 at 8/18/14 5:14 AM:
---------------------------------------------------------
[~bleathem] it seems you are right - it looks like a problem after an AJAX update. - I'll get to that in a moment...
First, thanks for the link to the debug guide, - besides ui:debug, we're already using what's described there.
Trying with RF 4.5.0 Alpha 3 unfortunately is not an option at this point in time, because we are already far behind our project schedule due to several problems with JSF(Mojarra) and RF. Also migrating a really big application to RF 4.5 (even if its just for testing) takes time we don't have right now and by the looks of it is no trivial matter - at least if I consider the migration guide [https://github.com/richfaces/richfaces/wiki/Migration-from-RichFaces-4-to...].
Reproducing the problem with a small test application (as we usually do it) failed on the first try. But maybe we can afford a little more time to trying to reproduce the problem in that environment and then migrating the test application to RF 4.5 ...
But back to the original problem - we tried to debug a little further with the big application and what we've found so far seems to confirm that the problem lies in an AJAX update:
# The "toggleType" of the tree is set to "ajax", because there's some data loading and calculations to be done when toggling the tree
# Clicking on a tree expander icon fires the ajax request
# The partial response is evaluated and updates several components
# One of the components in the partial response update is {code}<...>:tree:treeModelAdapter.0.treeModelAdapter.2:treeNode{code} BTW: "limitRender" is not respected if set on the tree! (which btw causes other problems) - so that's why there are updates to other components like messages etc. as well.
# The partial response is handled by this function: {code} var ajaxOnComplete = function (data) {
var type = data.type;
var responseXML = data.responseXML;
if (data.type == 'event' && data.status == 'complete' && responseXML) {
var partialResponse = jQuery(responseXML).children("partial-response");
if (partialResponse && partialResponse.length) {
var elements = partialResponse.children('changes').children('update, delete');
jQuery.each(elements, function () {
richfaces.cleanDom(jQuery(this).attr('id'));
});
}
}
};{code}
# For every updated or deleted component "richfaces.cleanDom" is invoked. "cleanDom" calls "cleanComponent" which in the end calls "detach" (already shown in a previous post above)
# Thise leads to the tree node {code}div#<...>:tree:treeModelAdapter.0.treeModelAdapter.2:treeNode.rf-tr-nd.rf-tr-nd-colps{code} losing its "component" attachment.
# After cleanig the DOM, the components are attached to the elements. I can see - amongst others - a call to "attachToDom" for the ID {code}<...>:tree:treeModelAdapter.0.treeModelAdapter.2:treeNode.rf-tr-nd.rf-tr-nd-exp{code}
# After processing the partial response the toggleEvent is fired as already described above. The source id for that event is {code}<...>:tree:treeModelAdapter.0.treeModelAdapter.2:treeNode.rf-tr-nd.rf-tr-nd-colps{code} - Note that the ID for the event source is still *rf-tr-nd-colps*!
# The function "richfaces.$" doesn't find the tree node component by that event ID anymore, because it has been detached and re-attached to the expanded node just a moment ago
Including the state dependent IDs as part of the event handling IDs may be is what's causing the problem - because they do change during the AJAX update...- What do you think?
Also, what can we do to work around the problem?
was (Author: michaelb80):
[~bleathem] it seems you are right - it looks like a problem after an AJAX update. - I'll get to that in a moment...
First, thanks for the link to the debug guide, - besides ui:debug, we're already using what's described there.
Trying with RF 4.5.0 Alpha 3 unfortunately is not an option at this point in time, because we are already far behind our project schedule due to several problems with JSF(Mojarra) and RF. Also migrating a really big application to RF 4.5 (even if its just for testing) takes time we don't have right now and by the looks of it is no trivial matter - at least if I consider the migration guide [https://github.com/richfaces/richfaces/wiki/Migration-from-RichFaces-4-to...].
Reproducing the problem with a small test application (as we usually do it) failed on the first try. But maybe we can afford a little more time to trying to reproduce the problem in that environment and then migrating the test application to RF 4.5 ...
But back to the original problem - we tried to debug a little further with the big application and what we've found so far seems to confirm that the problem lies in an AJAX update:
# The "toggleType" of the tree is set to "ajax", because there's some data loading and calculations to be done when toggling the tree
# Clicking on a tree expander icon fires the ajax request
# The partial response is evaluated and updates several components
# One of the components in the partial response update is {code}<...>:tree:treeModelAdapter.0.treeModelAdapter.2:treeNode{code} BTW: "limitRender" is not respected if set on the tree! (which btw causes other problems) - so that's why there are updates to other components like messages etc. as well.
# The partial response is handled by this function: {code} var ajaxOnComplete = function (data) {
var type = data.type;
var responseXML = data.responseXML;
if (data.type == 'event' && data.status == 'complete' && responseXML) {
var partialResponse = jQuery(responseXML).children("partial-response");
if (partialResponse && partialResponse.length) {
var elements = partialResponse.children('changes').children('update, delete');
jQuery.each(elements, function () {
richfaces.cleanDom(jQuery(this).attr('id'));
});
}
}
};{code}
# For every updated or deleted component "richfaces.cleanDom" is invoked. "cleanDom" calls "cleanComponent" which in the end calls "detach" (already shown in a previous post above)
# Thise leads to the tree node {code}div#<...>:tree:treeModelAdapter.0.treeModelAdapter.2:treeNode.rf-tr-nd.rf-tr-nd-colps{code} losing its "component" attachment.
# After cleanig the DOM, the components are attached to the elements. I can see - amongst others - a call to "attachToDom" for the ID {code}<...>:tree:treeModelAdapter.0.treeModelAdapter.2:treeNode.rf-tr-nd.rf-tr-nd-exp{code}
# After processing the partial response the toggleEvent is fired as already described above. The source id for that event is {code}div#<...>:tree:treeModelAdapter.0.treeModelAdapter.2:treeNode.rf-tr-nd.rf-tr-nd-colps{code} - Note that the ID for the event source is still *rf-tr-nd-colps*!
# The function "richfaces.$" doesn't find the tree node component by that event ID anymore, because it has been detached and re-attached to the expanded node just a moment ago
Including the state dependent IDs as part of the event handling IDs may be is what's causing the problem - because they do change during the AJAX update...- What do you think?
Also, what can we do to work around the problem?
> Random JavaScript error due to missing attribute 'richfaces.RICH_CONTAINER'
> ---------------------------------------------------------------------------
>
> Key: RF-13780
> URL: https://issues.jboss.org/browse/RF-13780
> Project: RichFaces
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: component, component-tree
> Affects Versions: 4.3.7
> Environment: RichFaces 4.3.7
> Mojarra 2.1.29
> Java 7 Update 67 (x64)
> Tomcat 7.0.52 (x64)
> Firefox 31
> Reporter: Michael B
>
> First of all: this is a bug report which may be related to RF-13776, since it also originates in the same spot of the JavaScript library of RichFaces.
> Preface:
> The problem is difficult to reproduce systematically, since it only seems to occur in one of n cases of loading one and the same complex xhtml (with exactly the same data from the backing bean).
> The problem is described based on the rich:tree component when clicking on the expand icon of a treeNode which fires a "ToggleEvent".
> Occasionally there is a JavaScript error in the last line of
> {code}
> richfaces.ui.TreeNode.emitToggleEvent = function(nodeId) {
> var node = document.getElementById(nodeId);
> if (!node) {
> return;
> }
> richfaces.$(node).__fireToggleEvent();
> };
> {code}
> When the problem occurs, the expression {code}richfaces.$(node){code} evaluates to 'undefined'.
> Debugging into the function when the problem occurs:
> {code:title=richfaces.$|borderStyle=solid}
> richfaces.$ = function(source) {
> var element = richfaces.getDomElement( source );
> if(element)
> {
> return( element[richfaces.RICH_CONTAINER] || {} )["component"]
> }
> };
> {code}
> While the element is correctly evaluated to the treeNode/treeNodeToggle-source, the expression {code}element[richfaces.RICH_CONTAINER]{code} evaluates to 'undefined'.
> Reloading the page one or more times produces correct results, where the attribute is set.
> To be able to provide a reproducable example of the problem, please provide some information under which circumstances the property may not be set correctly for some components. Please also give us a hint, where to debug into the RF JavaScript code to find the spot where this property is set.
> Although the problem doesn't occur all the time, it happens quite often with the effect of breaking the entire application. So for future versions I would suggest a check if {code}richfaces.$(xyz){code} evalutes to a valid result, before invoking any operations on the result and maybe write a message to the a4j:log in cases where a valid result is expected but not returned.
--
This message was sent by Atlassian JIRA
(v6.2.6#6264)
10 years, 4 months
[JBoss JIRA] (RF-13780) Random JavaScript error due to missing attribute 'richfaces.RICH_CONTAINER'
by Michael B (JIRA)
[ https://issues.jboss.org/browse/RF-13780?page=com.atlassian.jira.plugin.s... ]
Michael B edited comment on RF-13780 at 8/18/14 5:14 AM:
---------------------------------------------------------
[~bleathem] it seems you are right - it looks like a problem after an AJAX update. - I'll get to that in a moment...
First, thanks for the link to the debug guide, - besides ui:debug, we're already using what's described there.
Trying with RF 4.5.0 Alpha 3 unfortunately is not an option at this point in time, because we are already far behind our project schedule due to several problems with JSF(Mojarra) and RF. Also migrating a really big application to RF 4.5 (even if its just for testing) takes time we don't have right now and by the looks of it is no trivial matter - at least if I consider the migration guide [https://github.com/richfaces/richfaces/wiki/Migration-from-RichFaces-4-to...].
Reproducing the problem with a small test application (as we usually do it) failed on the first try. But maybe we can afford a little more time to trying to reproduce the problem in that environment and then migrating the test application to RF 4.5 ...
But back to the original problem - we tried to debug a little further with the big application and what we've found so far seems to confirm that the problem lies in an AJAX update:
# The "toggleType" of the tree is set to "ajax", because there's some data loading and calculations to be done when toggling the tree
# Clicking on a tree expander icon fires the ajax request
# The partial response is evaluated and updates several components
# One of the components in the partial response update is {code}<...>:tree:treeModelAdapter.0.treeModelAdapter.2:treeNode{code} BTW: "limitRender" is not respected if set on the tree! (which btw causes other problems) - so that's why there are updates to other components like messages etc. as well.
# The partial response is handled by this function: {code} var ajaxOnComplete = function (data) {
var type = data.type;
var responseXML = data.responseXML;
if (data.type == 'event' && data.status == 'complete' && responseXML) {
var partialResponse = jQuery(responseXML).children("partial-response");
if (partialResponse && partialResponse.length) {
var elements = partialResponse.children('changes').children('update, delete');
jQuery.each(elements, function () {
richfaces.cleanDom(jQuery(this).attr('id'));
});
}
}
};{code}
# For every updated or deleted component "richfaces.cleanDom" is invoked. "cleanDom" calls "cleanComponent" which in the end calls "detach" (already shown in a previous post above)
# Thise leads to the tree node {code}<...>:tree:treeModelAdapter.0.treeModelAdapter.2:treeNode.rf-tr-nd.rf-tr-nd-colps{code} losing its "component" attachment.
# After cleanig the DOM, the components are attached to the elements. I can see - amongst others - a call to "attachToDom" for the ID {code}<...>:tree:treeModelAdapter.0.treeModelAdapter.2:treeNode.rf-tr-nd.rf-tr-nd-exp{code}
# After processing the partial response the toggleEvent is fired as already described above. The source id for that event is {code}<...>:tree:treeModelAdapter.0.treeModelAdapter.2:treeNode.rf-tr-nd.rf-tr-nd-colps{code} - Note that the ID for the event source is still *rf-tr-nd-colps*!
# The function "richfaces.$" doesn't find the tree node component by that event ID anymore, because it has been detached and re-attached to the expanded node just a moment ago
Including the state dependent IDs as part of the event handling IDs may be is what's causing the problem - because they do change during the AJAX update...- What do you think?
Also, what can we do to work around the problem?
was (Author: michaelb80):
[~bleathem] it seems you are right - it looks like a problem after an AJAX update. - I'll get to that in a moment...
First, thanks for the link to the debug guide, - besides ui:debug, we're already using what's described there.
Trying with RF 4.5.0 Alpha 3 unfortunately is not an option at this point in time, because we are already far behind our project schedule due to several problems with JSF(Mojarra) and RF. Also migrating a really big application to RF 4.5 (even if its just for testing) takes time we don't have right now and by the looks of it is no trivial matter - at least if I consider the migration guide [https://github.com/richfaces/richfaces/wiki/Migration-from-RichFaces-4-to...].
Reproducing the problem with a small test application (as we usually do it) failed on the first try. But maybe we can afford a little more time to trying to reproduce the problem in that environment and then migrating the test application to RF 4.5 ...
But back to the original problem - we tried to debug a little further with the big application and what we've found so far seems to confirm that the problem lies in an AJAX update:
# The "toggleType" of the tree is set to "ajax", because there's some data loading and calculations to be done when toggling the tree
# Clicking on a tree expander icon fires the ajax request
# The partial response is evaluated and updates several components
# One of the components in the partial response update is {code}<...>:tree:treeModelAdapter.0.treeModelAdapter.2:treeNode{code} BTW: "limitRender" is not respected if set on the tree! (which btw causes other problems) - so that's why there are updates to other components like messages etc. as well.
# The partial response is handled by this function: {code} var ajaxOnComplete = function (data) {
var type = data.type;
var responseXML = data.responseXML;
if (data.type == 'event' && data.status == 'complete' && responseXML) {
var partialResponse = jQuery(responseXML).children("partial-response");
if (partialResponse && partialResponse.length) {
var elements = partialResponse.children('changes').children('update, delete');
jQuery.each(elements, function () {
richfaces.cleanDom(jQuery(this).attr('id'));
});
}
}
};{code}
# For every updated or deleted component "richfaces.cleanDom" is invoked. "cleanDom" calls "cleanComponent" which in the end calls "detach" (already shown in a previous post above)
# Thise leads to the tree node {code}div#<...>:tree:treeModelAdapter.0.treeModelAdapter.2:treeNode.rf-tr-nd.rf-tr-nd-colps{code} losing its "component" attachment.
# After cleanig the DOM, the components are attached to the elements. I can see - amongst others - a call to "attachToDom" for the ID {code}<...>:tree:treeModelAdapter.0.treeModelAdapter.2:treeNode.rf-tr-nd.rf-tr-nd-exp{code}
# After processing the partial response the toggleEvent is fired as already described above. The source id for that event is {code}<...>:tree:treeModelAdapter.0.treeModelAdapter.2:treeNode.rf-tr-nd.rf-tr-nd-colps{code} - Note that the ID for the event source is still *rf-tr-nd-colps*!
# The function "richfaces.$" doesn't find the tree node component by that event ID anymore, because it has been detached and re-attached to the expanded node just a moment ago
Including the state dependent IDs as part of the event handling IDs may be is what's causing the problem - because they do change during the AJAX update...- What do you think?
Also, what can we do to work around the problem?
> Random JavaScript error due to missing attribute 'richfaces.RICH_CONTAINER'
> ---------------------------------------------------------------------------
>
> Key: RF-13780
> URL: https://issues.jboss.org/browse/RF-13780
> Project: RichFaces
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: component, component-tree
> Affects Versions: 4.3.7
> Environment: RichFaces 4.3.7
> Mojarra 2.1.29
> Java 7 Update 67 (x64)
> Tomcat 7.0.52 (x64)
> Firefox 31
> Reporter: Michael B
>
> First of all: this is a bug report which may be related to RF-13776, since it also originates in the same spot of the JavaScript library of RichFaces.
> Preface:
> The problem is difficult to reproduce systematically, since it only seems to occur in one of n cases of loading one and the same complex xhtml (with exactly the same data from the backing bean).
> The problem is described based on the rich:tree component when clicking on the expand icon of a treeNode which fires a "ToggleEvent".
> Occasionally there is a JavaScript error in the last line of
> {code}
> richfaces.ui.TreeNode.emitToggleEvent = function(nodeId) {
> var node = document.getElementById(nodeId);
> if (!node) {
> return;
> }
> richfaces.$(node).__fireToggleEvent();
> };
> {code}
> When the problem occurs, the expression {code}richfaces.$(node){code} evaluates to 'undefined'.
> Debugging into the function when the problem occurs:
> {code:title=richfaces.$|borderStyle=solid}
> richfaces.$ = function(source) {
> var element = richfaces.getDomElement( source );
> if(element)
> {
> return( element[richfaces.RICH_CONTAINER] || {} )["component"]
> }
> };
> {code}
> While the element is correctly evaluated to the treeNode/treeNodeToggle-source, the expression {code}element[richfaces.RICH_CONTAINER]{code} evaluates to 'undefined'.
> Reloading the page one or more times produces correct results, where the attribute is set.
> To be able to provide a reproducable example of the problem, please provide some information under which circumstances the property may not be set correctly for some components. Please also give us a hint, where to debug into the RF JavaScript code to find the spot where this property is set.
> Although the problem doesn't occur all the time, it happens quite often with the effect of breaking the entire application. So for future versions I would suggest a check if {code}richfaces.$(xyz){code} evalutes to a valid result, before invoking any operations on the result and maybe write a message to the a4j:log in cases where a valid result is expected but not returned.
--
This message was sent by Atlassian JIRA
(v6.2.6#6264)
10 years, 4 months
[JBoss JIRA] (RF-13780) Random JavaScript error due to missing attribute 'richfaces.RICH_CONTAINER'
by Michael B (JIRA)
[ https://issues.jboss.org/browse/RF-13780?page=com.atlassian.jira.plugin.s... ]
Michael B commented on RF-13780:
--------------------------------
[~bleathem] it seems you are right - it looks like a problem after an AJAX update. - I'll get to that in a moment...
First, thanks for the link to the debug guide, - besides ui:debug, we're already using what's described there.
Trying with RF 4.5.0 Alpha 3 unfortunately is not an option at this point in time, because we are already far behind our project schedule due to several problems with JSF(Mojarra) and RF. Also migrating a really big application to RF 4.5 (even if its just for testing) takes time we don't have right now and by the looks of it is no trivial matter - at least if I consider the migration guide [https://github.com/richfaces/richfaces/wiki/Migration-from-RichFaces-4-to...].
Reproducing the problem with a small test application (as we usually do it) failed on the first try. But maybe we can afford a little more time to trying to reproduce the problem in that environment and then migrating the test application to RF 4.5 ...
But back to the original problem - we tried to debug a little further with the big application and what we've found so far seems to confirm that the problem lies in an AJAX update:
# The "toggleType" of the tree is set to "ajax", because there's some data loading and calculations to be done when toggling the tree
# Clicking on a tree expander icon fires the ajax request
# The partial response is evaluated and updates several components
# One of the components in the partial response update is {code}<...>:tree:treeModelAdapter.0.treeModelAdapter.2:treeNode{code} BTW: "limitRender" is not respected if set on the tree! (which btw causes other problems) - so that's why there are updates to other components like messages etc. as well.
# The partial response is handled by this function: {code} var ajaxOnComplete = function (data) {
var type = data.type;
var responseXML = data.responseXML;
if (data.type == 'event' && data.status == 'complete' && responseXML) {
var partialResponse = jQuery(responseXML).children("partial-response");
if (partialResponse && partialResponse.length) {
var elements = partialResponse.children('changes').children('update, delete');
jQuery.each(elements, function () {
richfaces.cleanDom(jQuery(this).attr('id'));
});
}
}
};{code}
# For every updated or deleted component "richfaces.cleanDom" is invoked. "cleanDom" calls "cleanComponent" which in the end calls "detach" (already shown in a previous post above)
# Thise leads to the tree node {code}div#<...>:tree:treeModelAdapter.0.treeModelAdapter.2:treeNode.rf-tr-nd.rf-tr-nd-colps{code} losing its "component" attachment.
# After cleanig the DOM, the components are attached to the elements. I can see - amongst others - a call to "attachToDom" for the ID {code}<...>:tree:treeModelAdapter.0.treeModelAdapter.2:treeNode.rf-tr-nd.rf-tr-nd-exp{code}
# After processing the partial response the toggleEvent is fired as already described above. The source id for that event is {code}div#<...>:tree:treeModelAdapter.0.treeModelAdapter.2:treeNode.rf-tr-nd.rf-tr-nd-colps{code} - Note that the ID for the event source is still *rf-tr-nd-colps*!
# The function "richfaces.$" doesn't find the tree node component by that event ID anymore, because it has been detached and re-attached to the expanded node just a moment ago
Including the state dependent IDs as part of the event handling IDs may be is what's causing the problem - because they do change during the AJAX update...- What do you think?
Also, what can we do to work around the problem?
> Random JavaScript error due to missing attribute 'richfaces.RICH_CONTAINER'
> ---------------------------------------------------------------------------
>
> Key: RF-13780
> URL: https://issues.jboss.org/browse/RF-13780
> Project: RichFaces
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: component, component-tree
> Affects Versions: 4.3.7
> Environment: RichFaces 4.3.7
> Mojarra 2.1.29
> Java 7 Update 67 (x64)
> Tomcat 7.0.52 (x64)
> Firefox 31
> Reporter: Michael B
>
> First of all: this is a bug report which may be related to RF-13776, since it also originates in the same spot of the JavaScript library of RichFaces.
> Preface:
> The problem is difficult to reproduce systematically, since it only seems to occur in one of n cases of loading one and the same complex xhtml (with exactly the same data from the backing bean).
> The problem is described based on the rich:tree component when clicking on the expand icon of a treeNode which fires a "ToggleEvent".
> Occasionally there is a JavaScript error in the last line of
> {code}
> richfaces.ui.TreeNode.emitToggleEvent = function(nodeId) {
> var node = document.getElementById(nodeId);
> if (!node) {
> return;
> }
> richfaces.$(node).__fireToggleEvent();
> };
> {code}
> When the problem occurs, the expression {code}richfaces.$(node){code} evaluates to 'undefined'.
> Debugging into the function when the problem occurs:
> {code:title=richfaces.$|borderStyle=solid}
> richfaces.$ = function(source) {
> var element = richfaces.getDomElement( source );
> if(element)
> {
> return( element[richfaces.RICH_CONTAINER] || {} )["component"]
> }
> };
> {code}
> While the element is correctly evaluated to the treeNode/treeNodeToggle-source, the expression {code}element[richfaces.RICH_CONTAINER]{code} evaluates to 'undefined'.
> Reloading the page one or more times produces correct results, where the attribute is set.
> To be able to provide a reproducable example of the problem, please provide some information under which circumstances the property may not be set correctly for some components. Please also give us a hint, where to debug into the RF JavaScript code to find the spot where this property is set.
> Although the problem doesn't occur all the time, it happens quite often with the effect of breaking the entire application. So for future versions I would suggest a check if {code}richfaces.$(xyz){code} evalutes to a valid result, before invoking any operations on the result and maybe write a message to the a4j:log in cases where a valid result is expected but not returned.
--
This message was sent by Atlassian JIRA
(v6.2.6#6264)
10 years, 4 months
[JBoss JIRA] (RF-13778) RF-45 cyclic dependency on richfaces-parent
by Marek Novotny (JIRA)
[ https://issues.jboss.org/browse/RF-13778?page=com.atlassian.jira.plugin.s... ]
Marek Novotny commented on RF-13778:
------------------------------------
[~bleathem] thanks, that approach is fine. We didn't want to separate richfaces-parent or have 2 different versions in RF 4.5.
> RF-45 cyclic dependency on richfaces-parent
> -------------------------------------------
>
> Key: RF-13778
> URL: https://issues.jboss.org/browse/RF-13778
> Project: RichFaces
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: build/distribution
> Affects Versions: 4.5.0.Alpha3
> Reporter: Pavol Pitonak
> Priority: Blocker
> Fix For: 4.5.0.Beta1
>
> Original Estimate: 2 hours
> Remaining Estimate: 2 hours
>
> Historically there is a dependency in .../jsf-tests/pom.xml on richfaces-parent which used to be a standalone project/repo in 4.3.x
> {code}
> <parent>
> <groupId>org.richfaces</groupId>
> <artifactId>richfaces-parent</artifactId>
> <version>12</version>
> </parent>
> {code}
> However nowadays in 4.5.x there is playing the role of parent the
> richfaces/pom.xml
> https://github.com/richfaces/richfaces/blob/master/pom.xml
> {code}
> <groupId>org.richfaces</groupId>
> <artifactId>richfaces-parent</artifactId>
> <packaging>pom</packaging>
> <version>4.5.0-SNAPSHOT</version>
> <name>RichFaces Parent</name>
> {code}
> which makes a cyclic dependency
> jsf-test --> richfaces --> jsf-test
> as there are inside https://github.com/richfaces/richfaces/blob/master/build/pom.xml
> referenced dependencies for jsf-tests
> {code}
> <dependency>
> <groupId>org.jboss.test-jsf</groupId>
> <artifactId>htmlunit-client</artifactId>
> <version>${version.jsf-test}</version>
> <exclusions>
> <exclusion>
> <groupId>javax.servlet</groupId>
> <artifactId>javax.servlet-api</artifactId>
> </exclusion>
> </exclusions>
> </dependency>
> <dependency>
> <groupId>org.jboss.test-jsf</groupId>
> <artifactId>jsf-test-stage</artifactId>
> <version>${version.jsf-test}</version>
> </dependency>
> <dependency>
> <groupId>org.jboss.test-jsf</groupId>
> <artifactId>jsf-mock</artifactId>
> <version>${version.jsf-test}</version>
> </dependency>
> <dependency>
> <groupId>org.jboss.test-jsf</groupId>
> <artifactId>jsf-mockito</artifactId>
> <version>${version.jsf-test}</version>
> </dependency>
> <dependency>
> <groupId>org.jboss.test-jsf</groupId>
> <artifactId>jsf-test-scriptunit</artifactId>
> <version>${version.jsf-test}</version>
> </dependency>
> {code}
--
This message was sent by Atlassian JIRA
(v6.2.6#6264)
10 years, 4 months
[JBoss JIRA] (RF-11453) Add autocomplete functionality to the rich:select component
by Brian Leathem (JIRA)
[ https://issues.jboss.org/browse/RF-11453?page=com.atlassian.jira.plugin.s... ]
Brian Leathem commented on RF-11453:
------------------------------------
[~michpetrov] please review the attached PR and merge accordingly. There are undoubtedly issues that remain but I think enough of the feature is now present to warrant merging the branch.
Run the components-demo select sample for a working sample of the feature.
> Add autocomplete functionality to the rich:select component
> -----------------------------------------------------------
>
> Key: RF-11453
> URL: https://issues.jboss.org/browse/RF-11453
> Project: RichFaces
> Issue Type: Feature Request
> Security Level: Public(Everyone can see)
> Components: component-selects
> Reporter: Cody Lerum
> Assignee: Brian Leathem
> Fix For: 4.5.0.Beta1
>
> Original Estimate: 3 days
> Time Spent: 2 days
> Remaining Estimate: 1 day
>
> Add an "autocompleteMethod" to rich:select
--
This message was sent by Atlassian JIRA
(v6.2.6#6264)
10 years, 4 months