Search code examples
primefacesjsf-2

p:selectOneMenu inside dialog


I'm a opening a primefaces dialog using the next method:

RequestContext.getCurrentInstance().openDialog ("mydialog");

Inside mydialog.xhtml there is a p:selectOneMenu.

When the drop-down list appears inside dialog window the dialog shows its vertical scrollbar. Therefore whole dialog should be scrolled to see all items. But I think should be shown over dialog window.


Solution

  • The PrimeFaces dialog framework (that is what you are using, not a normal p:dialog) is using an iframe to provide the functionality that makes this dialog framework different from a normal dialog.

    You cannot have 'overflow' from an iframe to the parent so this is just not goint to work for non-native components. This means that e.g. a plain jsf h:selectOneMenu might overflow since it renders to a plain html input. Whereas the p:selectOneMenu renders to stylable html.

    But... Maybe if the two documents are from the same origin, as is often the case with the PF dialog framework, you might be able to overcome some things by playing with the overflow attribute and maybe the z-index.

    See also