ajax update on context menu is clonning the element

UI Components for JSF
Post Reply
herbu
Posts: 24
Joined: 09 Oct 2013, 19:13

15 Jan 2018, 17:45

Hi,

please notice that this issue is related to primefaces 6.2 rc1 !

When I do the ajax-update on the element that contains context menu somehow (???) the context menu element is beeing cloned - with the same id (please see below)

Code: Select all

	
	<h:form id="test">
		<p:panel id="a">
			<p:commandButton type="submit" 
				update=":test:b"
				process="@this" /> 	
		</p:panel>
		
		<p:panel id="b">
			<p:dataTable id="dTable" widgetVar="w_dTable">
			</p:dataTable> 
		
			<p:contextMenu id="cmTable" for="dTable">
			</p:contextMenu>
	
		</p:panel>
	</h:form>


Now, everytime I click the buton the context-menu element <div> is clonned under the "body" element (can't insert picture - one may see this is code inspector)


Code: Select all

<body>
	<form id="test" name="test" method="post" action="/asr/test.xhtml" enctype="application/x-www-form-urlencoded">
		<input name="test" value="test" type="hidden">
			<div id="test:a" class="ui-panel ui-widget ui-widget-content ui-corner-all" data-widget="widget_test_a">
				<div id="test:a_content" class="ui-panel-content ui-widget-content">
				.....
	</form>

	<div id="textarea_simulator" style="position: absolute; top: 0px; left: 0px; visibility: hidden;"></div>
	<div id="test:cmTable" class="ui-menu ui-menu-dynamic ui-contextmenu ui-widget ui-widget-content ui-corner-all ui-helper-clearfix ui-shadow aqq" role="menubar">
		<div tabindex="0" class="ui-helper-hidden-accessible"></div>
		<ul class="ui-menu-list ui-helper-reset"></ul>
	</div>
	<div id="test:cmTable" class="ui-menu ui-menu-dynamic ui-contextmenu ui-widget ui-widget-content ui-corner-all ui-helper-clearfix ui-shadow aqq" role="menubar">
		<div tabindex="0" class="ui-helper-hidden-accessible"></div>
		<ul class="ui-menu-list ui-helper-reset"></ul>
	</div>
	<div id="test:cmTable" class="ui-menu ui-menu-dynamic ui-contextmenu ui-widget ui-widget-content ui-corner-all ui-helper-clearfix ui-shadow aqq" role="menubar">
		<div tabindex="0" class="ui-helper-hidden-accessible"></div>
		<ul class="ui-menu-list ui-helper-reset"></ul>
	</div>
	<div id="test:cmTable" class="ui-menu ui-menu-dynamic ui-contextmenu ui-widget ui-widget-content ui-corner-all ui-helper-clearfix ui-shadow aqq" role="menubar">
		<div tabindex="0" class="ui-helper-hidden-accessible"></div>
		<ul class="ui-menu-list ui-helper-reset"></ul>
	</div>
	<div id="test:cmTable" class="ui-menu ui-menu-dynamic ui-contextmenu ui-widget ui-widget-content ui-corner-all ui-helper-clearfix ui-shadow aqq" role="menubar">
		<div tabindex="0" class="ui-helper-hidden-accessible"></div>
		<ul class="ui-menu-list ui-helper-reset"></ul>
	</div>
</body>
In my case I need to get to the context menu element from javascript (some magic on beforeshow) and getElemetByID is giving me the first one - when the last one is really shown.


Regards,
herbu

primefaces 6.2 RC1 !!!

tandraschko
PrimeFaces Core Developer
Posts: 3979
Joined: 03 Dec 2010, 14:11
Location: Bavaria, DE
Contact:

15 Jan 2018, 18:00

Does it work fine on 6.1?
If yes: Please create a issue with all informations and a small reproducable example.
Thomas Andraschko

PrimeFaces | PrimeFaces Extensions

Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE

Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko

herbu
Posts: 24
Joined: 09 Oct 2013, 19:13

16 Jan 2018, 12:09

Hi,

verified with 6.0, 6.1 - works OK

6.2 RC1 reported on github.

/herbu

RueKow
Posts: 331
Joined: 21 Jun 2011, 23:34
Location: Germany - Wiesbaden

28 Jan 2018, 13:08

I had a similar problem with overlay of SelectOneMenu. Did you already create an issue? If yes, please announce issue number.
Rüdiger

PrimeFaces 11.0 | Ultima 2.0
Mojarra 2.3 | Tomcat 8/9 | Win7/10 | OS X 10.14

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 26 guests