[JBoss JIRA] (RF-13780) Random JavaScript error due to missing attribute 'richfaces.RICH_CONTAINER'
by Brian Leathem (JIRA)
[ https://issues.jboss.org/browse/RF-13780?page=com.atlassian.jira.plugin.s... ]
Brian Leathem edited comment on RF-13780 at 8/14/14 3:09 PM:
-------------------------------------------------------------
[~michaelb80] refer to [this guide|https://github.com/richfaces/richfaces/wiki/Debugging-RichFaces] on debugging RichFaces. Also, try with RF 4.5.0.Alpha3.
was (Author: bleathem):
[~michaelb80] refer to this guide on debugging RichFaces. Also, try with RF 4.5.0.Alpha3.
> 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, 3 months
[JBoss JIRA] (RF-13780) Random JavaScript error due to missing attribute 'richfaces.RICH_CONTAINER'
by Brian Leathem (JIRA)
[ https://issues.jboss.org/browse/RF-13780?page=com.atlassian.jira.plugin.s... ]
Brian Leathem commented on RF-13780:
------------------------------------
Could be dealing with a stale DOM reference, something that's been removed in an AJAX update.
> 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, 3 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:
--------------------------------
[~michpetrov] thanks for the hint. I tried to debug into the JavaScript, but in a complex xhtml where the problem does not occur every time, this is really hard to catch...
However in several attempts I could at least create a state as follows once:
There is a rich:tree on the page. Once the page loads, the function {code}attachToDom{code} is invoked for the tree and all its visible nodes. I didn't see any problems when the components are registered.
When the page was loaded, a click on one of the tree expander icons produces a function call to {code}richfaces.ui.TreeNode.emitToggleEvent{code}
This function calls
{code}
richfaces.$ = function(source) {
var element = richfaces.getDomElement( source );
...
{code}
In firebug I see that the "element" is evaluated to the expander icon. Since it is a rather complex page layout the ids of the components are pretty long (....tree:treeModelAdapter.0.treeModelAdapter.2:treeNode.rf-tr-nd.rf-tr-nd-colps), but I think that's one of the treeNode-ids for which the component was attached before. Looking at the debugger {code}element[richfaces.RICH_CONTAINER]{code} evaluates to an Object, however {code}element[richfaces.RICH_CONTAINER][component]{code} evaluates to "null", leading to the problem described above.
So maybe there is a wrong condition under which the "component" is set to "null"?
Maybe the function "detach" being invoked at some wrong point in time?
{code}
detach: function(source) {
source = source || this.id;
var element = richfaces.getDomElement(source);
element && element[richfaces.RICH_CONTAINER] && (element[richfaces.RICH_CONTAINER].component = null);
},
{code}
At least that's the only spot I found where the "component" is set back to "null".
Do you have any ideas about how to pinpoint 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, 3 months
[JBoss JIRA] (RF-13778) RF-45 cyclic dependency on richfaces-parent
by Brian Leathem (JIRA)
[ https://issues.jboss.org/browse/RF-13778?page=com.atlassian.jira.plugin.s... ]
Brian Leathem updated RF-13778:
-------------------------------
Fix Version/s: 4.5.0.Beta1
> 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
>
>
> 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, 3 months
[JBoss JIRA] (RF-13777) Upgrade Graphene do 2.1.0.Alpha1
by Brian Leathem (JIRA)
[ https://issues.jboss.org/browse/RF-13777?page=com.atlassian.jira.plugin.s... ]
Brian Leathem updated RF-13777:
-------------------------------
Fix Version/s: 4.5.0.Beta1
> Upgrade Graphene do 2.1.0.Alpha1
> --------------------------------
>
> Key: RF-13777
> URL: https://issues.jboss.org/browse/RF-13777
> Project: RichFaces
> Issue Type: Component Upgrade
> Security Level: Public(Everyone can see)
> Components: tests - functional
> Affects Versions: 4.5.0.Beta1
> Reporter: Juraj Húska
> Assignee: Juraj Húska
> Fix For: 4.5.0.Beta1
>
>
> Upgrade of Graphene to 2.1.0.Alpha1 would have following benefits:
> * there is a fix which will enable testing of fileUpload component
> * there is a screenshooter which can replace the custom solution in RF
> * in 2.1.x will be added XHRHalter, which will make testing of {{a4j:attachQueue}} and {{a4j:queue}} more deterministic.
> Even it is in Alpha version, we consider it pretty stable. And if we want upgrade we should do it ASAP.
--
This message was sent by Atlassian JIRA
(v6.2.6#6264)
10 years, 3 months
[JBoss JIRA] (RF-13776) a4j:ajax problem with hierarchical component IDs
by Brian Leathem (JIRA)
[ https://issues.jboss.org/browse/RF-13776?page=com.atlassian.jira.plugin.s... ]
Brian Leathem updated RF-13776:
-------------------------------
Fix Version/s: 4.5.0.Beta2
> a4j:ajax problem with hierarchical component IDs
> ------------------------------------------------
>
> Key: RF-13776
> URL: https://issues.jboss.org/browse/RF-13776
> Project: RichFaces
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: component-a4j-core
> Affects Versions: 4.3.7
> Environment: RichFaces 4.3.7
> Mojarra 2.1.29
> Java 7 Update 67 (x64)
> Tomcat 7.0.52 (x64)
> Reporter: Michael B
> Fix For: 4.5.0.Beta2
>
>
> First of all: this is a bug report related to RF-12616.
> The actionListener of an a4j:ajax-enhanced component is not invoked on the server side. In a nutshell the problem is due to the request parameter "javax.faces.source" not matching the id of the component for which the AjaxBehaviorEvent is bound.
> The problem occurs when you assign hierarchical component ids in your xhtml.
> Here is a condensed snippet xhtml illustrating the problem:
> {code:title=Snippet|borderStyle=solid}
> <rich:treeNode id="treeNode">
> <h:selectBooleanCheckbox id="treeNodeSelectBox">
> <a4j:ajax event="click" execute="@this" listener="#{someManagedBean.onCheckboxClick}" />
> </h:selectBooleanCheckbox>
> </rich:treeNode>
> {code}
> As you can see, the id of the selectBooleanCheckbox begins with the id of the treeNode.
> The RichFaces JavaScript handler introduced a function to obviously evaluate the correct component id for the event (which is then passed as request parameter 'javax.faces.source' in the AJAX request).
> {code:title=RichFaces JS-Snippet|borderStyle=solid}
> richfaces.ajax = function(source, event, options) {
> var options = options || {};
>
> var sourceId = getSourceId(source, options);
> var sourceElement = getSourceElement(source);
>
> // event source re-targeting finds a RichFaces component root
> // to setup javax.faces.source correctly - RF-12616)
> if (sourceElement) {
> source = searchForComponentRootOrReturn(sourceElement);
> }
>
> ...
> /*
> * Returns RichFaces component root for given element in the list of ancestors of sourceElement.
> * Otherwise returns sourceElement if RichFaces component root can't be located.
> */
> var searchForComponentRootOrReturn = function(sourceElement) {
> if (sourceElement.id && !richfaces.$(sourceElement)) {
> var parentElement = false;
> jQuery(sourceElement).parents().each(function() {
> if (this.id && sourceElement.id.indexOf(this.id) == 0) { // otherwise parent element is definitely not JSF component
> var suffix = sourceElement.id.substring(this.id.length); // extract suffix
> if (suffix.match(/^[a-zA-Z]*$/) && richfaces.$(this)) {
> parentElement = this;
> return false;
> }
> }
> });
> if (parentElement !== false) {
> return parentElement;
> }
> }
> return sourceElement;
> };
> {code}
> The problem is within the function "searchForComponentRootOrReturn" which in this special case of id-hierarchy evaluates to the wrong element. The correct element to be returned here would be the "sourceElement" (selectBooleanCheckbox with the id "treeNodeSelectBox" in the example above), but the code evaluates to a "parentElement" (treeNode in the example above) due to its id "treeNode" being a prefix of the component which fired the event.
> It took me a whole day to figure that one out, since there is no useful output neither in a4j:log nor in server side logging in a case where the parameter "javax.faces.source" does not match the component id. In fact the AJAX request is executed just fine, only the event is never queued...
> (See Mojarra HtmlBasicRenderer => decodeBehaviors and its check method isBehaviorSource)
--
This message was sent by Atlassian JIRA
(v6.2.6#6264)
10 years, 3 months
[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:
------------------------------------
The property is set in the {{attachToDom}} method in richfaces-base-component.js. It should always be set, this is how RF components are bound to the elements. It's not going to be set if it cannot find the element - i.e. there would have to be something wrong with the id.
> 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, 3 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 updated RF-13780:
---------------------------
Description:
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.
was:
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.
> 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, 3 months
[JBoss JIRA] (RF-13780) Random JavaScript error due to missing attribute 'richfaces.RICH_CONTAINER'
by Michael B (JIRA)
Michael B created RF-13780:
------------------------------
Summary: 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.
--
This message was sent by Atlassian JIRA
(v6.2.6#6264)
10 years, 3 months