[richfaces-issues] [JBoss JIRA] (RF-12715) richfaces.js searchForComponentRootOrReturn doesn't recognize non-richfaces components

Lukáš Fryč (JIRA) jira-events at lists.jboss.org
Fri Jan 11 05:19:08 EST 2013


    [ https://issues.jboss.org/browse/RF-12715?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12745242#comment-12745242 ] 

Lukáš Fryč edited comment on RF-12715 at 1/11/13 5:18 AM:
----------------------------------------------------------

Another option how to fix {{searchForComponentRootOrReturn}} would be following alghoritm searching through parents:

Check the parent only if behaviorSource has form
{code}
#{clientId}[a-zA-Z]
{code}

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 alghoritm searching through parents:

Use this only if behaviorSource has form
{code}
#{clientId}[a-zA-Z]
{code}

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



More information about the richfaces-issues mailing list