From issues at jboss.org Tue May 27 17:59:56 2014 Content-Type: multipart/mixed; boundary="===============0254802598187152881==" MIME-Version: 1.0 From: Brian Leathem (JIRA) To: richfaces-issues at lists.jboss.org Subject: [richfaces-issues] [JBoss JIRA] (RF-13645) contextMenu for extendedDataTable breaks after ajax render of contextMenu Date: Tue, 27 May 2014 17:59:56 -0400 Message-ID: In-Reply-To: JIRA.12541972.1401187344000@jira02.app.mwc.hst.phx2.redhat.com --===============0254802598187152881== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable [ https://issues.jboss.org/browse/RF-13645?page=3Dcom.atlassian.jira.p= lugin.system.issuetabpanels:all-tabpanel ] Brian Leathem updated RF-13645: ------------------------------- Description: = Anything that causes an ajax re-render of a contextMenu which is attached t= o an extendedDataTable causes the contextMenu to subsequently be broken, tr= iggering a JavaScript error instead of displaying the menu. The error seems= to be this: {quote} Cannot call method 'show' of null in menu-base.js (at line 108 there is a c= all to this.popup, but popup is null) {quote} The reason I need to ajax re-render the context menu is because in my situt= ation it's held within a tab panel, and if it doesn't get re-rendered then = it stops working after switching tabs using ajax mode (though it also break= s if the contextMenu is held outside of the tab panel, so that isn't a pote= ntial solution). = I created a stripped down example of my specific situation, with two extend= ed data tables, each held in a different tab within a tab panel, and one co= ntext menu for each table. Changing tabs will cause the context menu to bre= ak without it explicitly being called in a render list. The same kind of br= eak occurs if the contextMenu is called as part of any ajax render list: {code} = = = = = = = = = = = = Co= ntext Menu 1 Item = = = = = = = = = = Co= ntext Menu 2 Item = = = = = = = {code} And a simple test bean: {code} import org.apache.myfaces.extensions.cdi.core.api.scope.conversation.ViewAc= cessScoped; = import javax.inject.Named; = import java.io.Serializable; = import java.util.ArrayList;import java.util.List; = @Named = @ViewAccessScoped = public class TestBean implements Serializable { = List items =3D new ArrayList<>(); = public TestBean() { = items.add("one"); = items.add("two"); = items.add("three"); = } = public void addItem(){ = items.add("another"); = } = public List getItems() { = return items; = } = } = {code} The above test situation works fine in richfaces 4.3.1, 4.3.2, 4.3.3 and 4.= 3.4, but breaks when upgraded to 4.3.5.Final. = = There was a different bug fixed in 4.3.5 which seems highly related to this= , but opposite, making me wonder if whatever was done there caused this bug= instead (but it's just a guess): RF-11973 was: Look here: https://community.jboss.org/message/873478?et=3Dwatches.email.thread#873478 > contextMenu for extendedDataTable breaks after ajax render of contextMenu > ------------------------------------------------------------------------- > > Key: RF-13645 > URL: https://issues.jboss.org/browse/RF-13645 > Project: RichFaces > Issue Type: Bug > Security Level: Public(Everyone can see) = > Components: component-menu > Affects Versions: 4.3.5, 4.3.6 > Environment: WIN7 / JBOSS AS 7.1.1 > Reporter: Steffen Michel > Priority: Blocker > > Anything that causes an ajax re-render of a contextMenu which is attached= to an extendedDataTable causes the contextMenu to subsequently be broken, = triggering a JavaScript error instead of displaying the menu. The error see= ms to be this: > {quote} > Cannot call method 'show' of null in menu-base.js (at line 108 there is a= call to this.popup, but popup is null) > {quote} > The reason I need to ajax re-render the context menu is because in my sit= utation it's held within a tab panel, and if it doesn't get re-rendered the= n it stops working after switching tabs using ajax mode (though it also bre= aks if the contextMenu is held outside of the tab panel, so that isn't a po= tential solution). > = > I created a stripped down example of my specific situation, with two exte= nded data tables, each held in a different tab within a tab panel, and one = context menu for each table. Changing tabs will cause the context menu to b= reak without it explicitly being called in a render list. The same kind of = break occurs if the contextMenu is called as part of any ajax render list: > {code} > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> = > = > = > = > = > = > = > = > = > = > = > = > actionListener=3D"#{testBean.addItem}">= Context Menu 1 Item = > = > = > = > = > = > = > = > = > = > actionListener=3D"#{testBean.addItem}">= Context Menu 2 Item = > = > = > = > = > = > = > {code} > And a simple test bean: > {code} > import org.apache.myfaces.extensions.cdi.core.api.scope.conversation.View= AccessScoped; = > import javax.inject.Named; = > import java.io.Serializable; = > import java.util.ArrayList;import java.util.List; = > @Named = > @ViewAccessScoped = > public class TestBean implements Serializable { = > List items =3D new ArrayList<>(); = > public TestBean() { = > items.add("one"); = > items.add("two"); = > items.add("three"); = > } = > public void addItem(){ = > items.add("another"); = > } = > public List getItems() { = > return items; = > } = > } = > {code} > The above test situation works fine in richfaces 4.3.1, 4.3.2, 4.3.3 and = 4.3.4, but breaks when upgraded to 4.3.5.Final. > = > = > There was a different bug fixed in 4.3.5 which seems highly related to th= is, but opposite, making me wonder if whatever was done there caused this b= ug instead (but it's just a guess): RF-11973 -- This message was sent by Atlassian JIRA (v6.2.3#6260) --===============0254802598187152881==--