[
https://issues.jboss.org/browse/RF-12715?page=com.atlassian.jira.plugin.s...
]
Lukáš Fryč edited comment on RF-12715 at 1/11/13 5:24 AM:
----------------------------------------------------------
Another option how to fix {{searchForComponentRootOrReturn}} would be following idea:
Each RichFaces component's subelements (potential behavior sources) has following form
of IDs:
{code}
#{clientId}[a-zA-Z]
{code}
So we can check that a parent (in the chain of ancestors of {{sourceElement}}) has
following form of ID:
{code}
#{parentId}[a-zA-Z]
{code}
and additionally it is RichFaces component (which we check using DOM attachment technique:
{{RichFaces.$(...)}}).
Algorithm:
{code}
var sourceElementId, parentElementId;
if (parentElementId && sourceElementId.indexOf(parentElementId) == 0) { //
otherwise parent element is definitely not JSF component
var suffix = sourceElementId.substring(pareintId.length); // extract suffix
var parent_is_subelement_of_jsf_component = suffix.match(/[a-zA-Z]/); // match suffix
for basic characters
}
{code}
We can enforce the pattern {{[a-zA-Z]}} for element IDs for component's elements which
acts as behavior sources (in fact, this is common practice now).
was (Author: lfryc):
Another option how to fix {{searchForComponentRootOrReturn}} would be following idea:
Each RichFaces component's subelements (potential behavior sources) has following form
of IDs:
{code}
#{clientId}[a-zA-Z]
{code}
So we can check the parent only if behaviorSource has form:
{code}
#{parentId}[a-zA-Z]
{code}
and additionally it is RichFaces component (which we check using DOM attachment technique:
{{RichFaces.$(...)}}).
Algorithm:
{code}
var sourceElementId, parentElementId;
if (parentElementId && sourceElementId.indexOf(parentElementId) == 0) { //
otherwise parent element is definitely not JSF component
var suffix = sourceElementId.substring(pareintId.length); // extract suffix
var parent_is_subelement_of_jsf_component = suffix.match(/[a-zA-Z]/); // match suffix
for basic characters
}
{code}
We can enforce the pattern {{[a-zA-Z]}} for element IDs for component's elements which
acts as behavior sources (in fact, this is common practice now).
richfaces.js searchForComponentRootOrReturn doesn't recognize
non-richfaces components
--------------------------------------------------------------------------------------
Key: RF-12715
URL:
https://issues.jboss.org/browse/RF-12715
Project: RichFaces
Issue Type: Feature Request
Security Level: Public(Everyone can see)
Components: component-a4j-core
Affects Versions: 4.3.0.CR1
Reporter: Brian Leathem
Assignee: Brian Leathem
Priority: Blocker
Labels: regression
Fix For: 4.3.0.CR1
Original Estimate: 1 hour
Remaining Estimate: 1 hour
The searchForComponentRootOrReturn function in richfaces.js was created to correct the
source element of jsf events to jsf components. However the check of whether an element
belongs to a component fails for non JSF components.
A concrete example of this failure can be seen when an event generates from a nested
_f:ajax_ tag.
--
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