Return-Path: X-Original-To: apmail-myfaces-dev-archive@www.apache.org Delivered-To: apmail-myfaces-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6B82A11C0B for ; Wed, 25 Jun 2014 00:48:25 +0000 (UTC) Received: (qmail 33806 invoked by uid 500); 25 Jun 2014 00:48:25 -0000 Delivered-To: apmail-myfaces-dev-archive@myfaces.apache.org Received: (qmail 33712 invoked by uid 500); 25 Jun 2014 00:48:24 -0000 Mailing-List: contact dev-help@myfaces.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "MyFaces Development" Delivered-To: mailing list dev@myfaces.apache.org Received: (qmail 32833 invoked by uid 99); 25 Jun 2014 00:48:24 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Jun 2014 00:48:24 +0000 Date: Wed, 25 Jun 2014 00:48:24 +0000 (UTC) From: "Leonardo Uribe (JIRA)" To: dev@myfaces.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (MYFACES-3904) jsf.util.Chain() is rendered with wrong event source MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/MYFACES-3904?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Leonardo Uribe updated MYFACES-3904: ------------------------------------ Status: Patch Available (was: Open) > jsf.util.Chain() is rendered with wrong event source > ---------------------------------------------------- > > Key: MYFACES-3904 > URL: https://issues.apache.org/jira/browse/MYFACES-3904 > Project: MyFaces Core > Issue Type: Bug > Affects Versions: 2.2.0 > Reporter: Sven Linstaedt > Attachments: MYFACES-3904-1.patch > > > When applying multiple behaviors to an component, they are rendered to be executed in chain by using jsf.util.chain(). So far so good. > When applying a behavior to a component, that renders multiple html input elements like h:selectManyCheckbox or h:selectOneRadio, the javascript is generated for every html elements, from which everyone gets it's own id rendered by appending a ongoing number to the clientId of the component. In the myfaces renderer code these Ids are called itemId. > The problem is, when you apply multiple behaviors to components, which render multiple html input elements: in this case all behaviors are wrapped in a chained call, which unfortunately receives not the itemId of the currently rendered html element as the source parameter, but the clientId of the component. According to the spec, the source parameter should contain "the DOM element that triggered this Ajax request, or an id string of the element to use as the triggering element." > Because the event handler is bound to the html input element and not to it's parent html "wrapping" element used for layouting, the wrong event source is rendered in my option, which leads to the following side effect: Behavior scripts, that reference the current event producing html element via "this" will receive a different calling context ("this), if chain together with multiple behaviors than, if they would as single behavior, leading to all behavior scripts referencing "this" to run in the wrong context and often doing nothing meaningful at all. > E.g.: chained invocation of > {code} > > {code} > and > {code} > > {code} > is rendered as: > {code} > > {code} -- This message was sent by Atlassian JIRA (v6.2#6252)