RF 4.5. CR1 - popupPanel doesn't work properly (autosize and tooltip)
bluez974 Oct 10, 2014 5:27 AMHello,
On RF 4.5 CR1, the autosize attribute doesn't apply when the content of the popup is dynamically updated. Is there a javascript method that i could call on the oncomplete of my event to force the popup resizing ?
Moreover, a tooltip inside the popup won't show on top of the popup but behind it.
An issue was created about the autosize attribute when passing from RF 4.3.5 to 4.3.7
Here is a simple example to reproduce the issue.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:a4j="http://richfaces.org/a4j" xmlns:rich="http://richfaces.org/rich" > <h:head> <title>Test</title> </h:head> <h:body> <h:form id="frm"> <h:commandButton id="cbPopup" value="Show Popup" type="button" onclick="#{rich:component('ppTest')}.show();return false;" /> </h:form> <rich:popupPanel id="ppTest" modal="true" autosized="true" trimOverlayedElements="false"> <f:facet name="header"> <h:outputText value="Autosized Popup" /> </f:facet> <f:facet name="controls"> <h:panelGroup onclick="#{rich:component('ppTest')}.hide();"> X </h:panelGroup> </f:facet> <h:form id="f1"> <h:panelGrid columns="2" style="width: 200px" > <h:outputLabel value="Choose your panel " for="somPanels" /> <h:selectOneMenu id="somPanels" value="#{popupBean.selectedChoice}"> <f:selectItem itemValue="" itemLabel="" /> <f:selectItem itemValue="1" itemLabel="Panel 1" /> <f:selectItem itemValue="2" itemLabel="Panel 2" /> <f:selectItem itemValue="3" itemLabel="Panel 3" /> <a4j:ajax event="change" execute="@this" render="pgCtn" /> </h:selectOneMenu> </h:panelGrid> <rich:panel id="pgCtn"> <h:panelGroup id="pg1" layout="block" rendered="#{popupBean.selectedChoice == 1}" style="width:600px" > This is my Panel 1 <h:outputText id="ot1" value="Tooltip" > <rich:tooltip id="tt1" value="this My tooltip" attached="true" mode="client" /> </h:outputText> </h:panelGroup> <h:panelGroup id="pg2" layout="block" rendered="#{popupBean.selectedChoice == 2}" style="width:1000px" > This is my Panel 2 </h:panelGroup> <h:panelGroup id="pg3" layout="block" rendered="#{popupBean.selectedChoice == 3}" style="width:300px" > This is my Panel 3 </h:panelGroup> </rich:panel> </h:form> </rich:popupPanel> </h:body> </html>
package fr.alladin.common.web.bean.module.test; import javax.faces.bean.ManagedBean; @ManagedBean public class PopupBean { private Integer selectedChoice; public PopupBean() { } public Integer getSelectedChoice() { return selectedChoice; } public void setSelectedChoice(Integer selectedChoice) { this.selectedChoice = selectedChoice; } }