-
2. Re: rendered attribute not working on a reRender.... why?
peterlen Apr 2, 2010 10:36 AM (in response to ilya_shaikovsky)Ilya,
Thanks for the response. The a4j outputPanel on the RichFaces component library page basically states the same thing as the page reference you listed. When I saw that I wrapped my context menu in an outputPanel so it looked like:
<a:outputPanel id="myMenu" >
<rich:contextMenu event="oncontextmenu" rendered="#{DataFolders.displayDataTreeRootPasteMenu}" submitMode="ajax">
<rich:menuItem value="Paste" onClick="alert('not yet implemented')"/>
</rich:contextMenu>
</a:outputPanel>
When I ran this, it still did not seem to work and that is what I posted the question. After going through it all again, I decided to run a test to see if the issue was a rendered attribute on the context menu. I added an outputText component inside the outputPanel and used the same rendered logic as was on the context menu. It is defined like:
<a:outputPanel id="myMenu" >
<h:outputText value="Hello there" rendered="#{DataFolders.displayDataTreeRootPasteMenu}"/>
<rich:contextMenu event="oncontextmenu" rendered="#{DataFolders.displayDataTreeRootPasteMenu}" submitMode="ajax">
<rich:menuItem value="Paste" onClick="alert('not yet implemented')"/>
</rich:contextMenu>
</a:outputPanel>
When I ran it, the outputText was displayed, or not displayed, based on the "rendered" value just as it was suppose to. The context menu does not have that same behavior.
So now the issue is why is the rendered attribute not being evaluated for a context menu component like it is for other components. Is it that context menus are not suppose use a rendered attribute? or something else.
Any thoughts on this new twist?
Thanks - Peter
-
3. Re: rendered attribute not working on a reRender.... why?
peterlen Apr 2, 2010 11:37 AM (in response to peterlen)It is all working now. I did a slight switch to not use the render attribute on the context menu but to use a disabled attribute to the menuItem instead.