Return-Path: Delivered-To: apmail-myfaces-dev-archive@www.apache.org Received: (qmail 88505 invoked from network); 23 May 2005 18:40:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 23 May 2005 18:40:50 -0000 Received: (qmail 88761 invoked by uid 500); 23 May 2005 18:40:49 -0000 Delivered-To: apmail-myfaces-dev-archive@myfaces.apache.org Received: (qmail 88652 invoked by uid 500); 23 May 2005 18:40:48 -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 88608 invoked by uid 99); 23 May 2005 18:40:48 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from ajax-1.apache.org (HELO ajax.apache.org) (192.87.106.226) by apache.org (qpsmtpd/0.28) with ESMTP; Mon, 23 May 2005 11:40:46 -0700 Received: from ajax.apache.org (ajax.apache.org [127.0.0.1]) by ajax.apache.org (Postfix) with ESMTP id 37B8D2F3 for ; Mon, 23 May 2005 20:10:59 +0200 (CEST) Message-ID: <890934886.1116871859227.JavaMail.jira@ajax.apache.org> Date: Mon, 23 May 2005 20:10:59 +0200 (CEST) From: "Grant Smith (JIRA)" To: dev@myfaces.apache.org Subject: [jira] Closed: (MYFACES-243) ClientId not used, so JSCookMenu fires multiple actions in tables In-Reply-To: <811493944.1116019685461.JavaMail.jira@ajax.apache.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/MYFACES-243?page=all ] Grant Smith closed MYFACES-243: ------------------------------- Resolution: Fixed Final patch fixed navigation problem > ClientId not used, so JSCookMenu fires multiple actions in tables > ----------------------------------------------------------------- > > Key: MYFACES-243 > URL: http://issues.apache.org/jira/browse/MYFACES-243 > Project: MyFaces > Type: Bug > Versions: 1.0.9 beta > Reporter: Neal Haggard > Assignee: sean schofield > Fix For: Nightly Build > Attachments: patch.txt, patch2.txt > > The fix to add the id to the action (so that the proper action can be fired on decode) works fine for multiple JSCookMenu components on the same page, however when a JSCookMenu is placed in something that uses the component as a template (such as within a HtmlDataTable's Column), the NamingContainer doesn't get invoked, so a click on an action triggers once for every row in the table. > The simple fix is to change the call to getId() to getClientId(context), however, that also requires a change to processDecodes, to change the .indexOf(":") to .lastIndexOf(":"). > There are also some other underlying issues with the id in the rest of the component. The Javascript that defines the menu uses a generic variable name of 'menuBar'. If you have more than one JSCookMenu on the page with different CommandNavigationItems, you will only get the last one. > The solution to this is to supplement the JavaScript variable name with the clientId, much like the div later in encodeEnd. > I've tied all these changes together by creating a private method called getMenuId() which encapsulates the logic behind getting the clientId(context) and converting all the colons(:) to underscores(_). Then in encodeChildren(), encodeEnd() and encodeNavigationMenuItems(), I use this method, so that the same id is used throughout. > Also included in my patch is a quick-fix to allow null labels to not print out the default value (1). > Hopefully this will be a useful addition to the MyFaces Community. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira