[richfaces-svn-commits] JBoss Rich Faces SVN: r13606 - in trunk/test-applications/facelets/src/main: java/modalPanel and 1 other directories.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Thu Apr 16 08:54:42 EDT 2009


Author: adubovsky
Date: 2009-04-16 08:54:42 -0400 (Thu, 16 Apr 2009)
New Revision: 13606

Modified:
   trunk/test-applications/facelets/src/main/java/editor/Editor.java
   trunk/test-applications/facelets/src/main/java/modalPanel/ModalPanel.java
   trunk/test-applications/facelets/src/main/webapp/ModalPanel/ModalPanel.xhtml
   trunk/test-applications/facelets/src/main/webapp/ModalPanel/ModalPanelProperty.xhtml
Log:
+ Richfaces.hideTopModalPanel() function check

Modified: trunk/test-applications/facelets/src/main/java/editor/Editor.java
===================================================================
--- trunk/test-applications/facelets/src/main/java/editor/Editor.java	2009-04-16 12:26:31 UTC (rev 13605)
+++ trunk/test-applications/facelets/src/main/java/editor/Editor.java	2009-04-16 12:54:42 UTC (rev 13606)
@@ -77,11 +77,14 @@
 
 				System.out.println("!!! getAsObject work !!!");
 
-				if (false)
-					throw new ConverterException(new FacesMessage(
-							FacesMessage.SEVERITY_ERROR, "Converter error",
-							"Error while convert to Object"));
+				if (newValue != null) {
 
+					if (newValue.toString().indexOf("kkk") != -1) {
+						throw new ConverterException(new FacesMessage(
+								FacesMessage.SEVERITY_ERROR, "Converter error",
+								"Error while convert to Object"));
+					}
+				}
 				return newValue;
 			}
 
@@ -91,12 +94,16 @@
 
 				System.out.println("!!! getAsString work !!!");
 
-				if (false)
-					throw new ConverterException(new FacesMessage(
-							FacesMessage.SEVERITY_ERROR, "Converter error",
-							"Error while convert to String"));
+				if (value != null) {
 
+					if (value.toString().equals("<p>aaa</p>"))
+						throw new ConverterException(new FacesMessage(
+								FacesMessage.SEVERITY_ERROR, "Converter error",
+								"Error while convert to String"));
+				}
+
 				String result = (value == null) ? "" : value.toString();
+				
 				return result;
 			}
 		};
@@ -111,10 +118,13 @@
 		System.out.println("!!! Validator work !!!");
 		if (value != null) {
 
-			if (false) {
-				throw new ValidatorException(new FacesMessage(
-						FacesMessage.SEVERITY_ERROR, "Validation error",
-						"Incorrect input"));
+			if (value != null) {
+
+				if (value.toString().indexOf("xxx") != -1) {
+					throw new ValidatorException(new FacesMessage(
+							FacesMessage.SEVERITY_ERROR, "Validation error",
+							"Incorrect input"));
+				}
 			}
 		}
 	}

Modified: trunk/test-applications/facelets/src/main/java/modalPanel/ModalPanel.java
===================================================================
--- trunk/test-applications/facelets/src/main/java/modalPanel/ModalPanel.java	2009-04-16 12:26:31 UTC (rev 13605)
+++ trunk/test-applications/facelets/src/main/java/modalPanel/ModalPanel.java	2009-04-16 12:54:42 UTC (rev 13606)
@@ -28,8 +28,17 @@
 	private String visualOptions;
 	private String bindLabel;
 	private HtmlModalPanel htmlModalPanel;
+	private boolean trimOverlayedElements;
+	private String domElementAttachment;
 	
-	
+	public boolean isTrimOverlayedElements() {
+		return trimOverlayedElements;
+	}
+
+	public void setTrimOverlayedElements(boolean trimOverlayedElements) {
+		this.trimOverlayedElements = trimOverlayedElements;
+	}
+
 	public String getVisualOptions() {
 		return visualOptions;
 	}
@@ -75,6 +84,8 @@
 		this.showWhenRendered = false;
 		this.bindLabel = "not ready";
 		this.htmlModalPanel = null;
+		this.trimOverlayedElements = false;
+		this.domElementAttachment = "body";
 	}
 	
 	public void checkBinding(ActionEvent actionEvent){
@@ -268,4 +279,12 @@
 		ComponentInfo info = ComponentInfo.getInstance();
 		info.addField(htmlModalPanel);
 	}
-}
+
+	public String getDomElementAttachment() {
+		return domElementAttachment;
+	}
+
+	public void setDomElementAttachment(String domElementAttachment) {
+		this.domElementAttachment = domElementAttachment;
+	}
+}
\ No newline at end of file

Modified: trunk/test-applications/facelets/src/main/webapp/ModalPanel/ModalPanel.xhtml
===================================================================
--- trunk/test-applications/facelets/src/main/webapp/ModalPanel/ModalPanel.xhtml	2009-04-16 12:26:31 UTC (rev 13605)
+++ trunk/test-applications/facelets/src/main/webapp/ModalPanel/ModalPanel.xhtml	2009-04-16 12:54:42 UTC (rev 13606)
@@ -4,11 +4,28 @@
 	xmlns:h="http://java.sun.com/jsf/html"
 	xmlns:rich="http://richfaces.org/rich" id="modalPanelSubviewID">
 
+	<script type="text/javascript">
+function multiply(height,width){
+	var tbody = document.getElementById('tbodyID');
+	var y = parseInt(height);
+	var x = parseInt(width);	
+	tbody.innerHTML = 'modalPanel\'s size: ' + x + 'x' +y + ' px*px';
+	return false;	
+}
+</script>
+	<style>
+.dr-mpnl-shadow {
+	top: 5px;
+	left: 5px;
+	opacity: 0.9;
+	filter: alpha(opacity =         200);
+}
+</style>
+
 	<rich:modalPanel id="modalPanelID"
 		binding="#{modalPanel.htmlModalPanel}"
 		visualOptions="#{modalPanel.visualOptions}" left="#{modalPanel.left}"
-		top="#{modalPanel.top}" minHeight="#{modalPanel.minHeight}"
-		minWidth="#{modalPanel.minWidth}" height="#{modalPanel.height}"
+		top="#{modalPanel.top}" height="#{modalPanel.height}"
 		width="#{modalPanel.width}" moveable="#{modalPanel.moveable}"
 		resizeable="#{modalPanel.resizeable}"
 		keepVisualState="#{modalPanel.keepVisualState}"
@@ -17,6 +34,7 @@
 		shadowDepth="#{modalPanel.shadowDepth}"
 		shadowOpacity="#{modalPanel.shadowOpacity}"
 		showWhenRendered="#{modalPanel.showWhenRendered}"
+		trimOverlayedElements="#{modalPanel.trimOverlayedElements}"
 		controlsClass="#{style.controlsClass}"
 		headerClass="#{style.headerClass}" styleClass="#{style.styleClass}"
 		onhide="#{event.onhide}" onmaskclick="#{event.onmaskclick}"
@@ -26,76 +44,101 @@
 		onmaskmousemove="#{event.onmaskmousemove}"
 		onmaskmouseout="#{event.onmaskmouseout}"
 		onmaskmouseover="#{event.onmaskmouseover}"
-		onmaskmouseup="#{event.onmaskmouseup}" 
-		onmove="#{event.onmove}"
-		onresize="#{event.onresize}" onshow="#{event.onshow}" 
+		onmaskmouseup="#{event.onmaskmouseup}" onmove="#{event.onmove}"
+		onresize="#{event.onresize}" onshow="#{event.onshow}"
 		onbeforehide="#{event.onbeforehide}"
-		onbeforeshow="#{event.onbeforeshow}" >
+		onbeforeshow="#{event.onbeforeshow}"
+		tridentIVEngineSelectBehavior="hide"
+		domElementAttachment="#{modalPanel.domElementAttachment}"
+		label="panel1">
 		<f:facet name="header">
-			<h:outputText value="Heder goes here..." />
+			<h:outputText value="HEADER for PANEL1" />
 		</f:facet>
 		<f:facet name="controls">
-			<h:graphicImage value="/pics/error.gif"	onclick="Richfaces.hideModalPanel('modalPanelID'); return false;" />
+			<h:graphicImage value="/pics/error.gif"
+				onclick="Richfaces.hideModalPanel('modalPanelID'); return false;" />
 		</f:facet>
-		
-		<h:outputText value="This is Modal Panel example" />
-		<h:selectOneMenu value="#{richBean.srcContainer}" >
+		<h:outputText value="selectOneMenu inside the MODALPanel: " />
+		<h:selectOneMenu value="#{richBean.srcContainer}">
 			<f:selectItems value="#{richBean.listContainer}" />
 		</h:selectOneMenu>
-		
+		<rich:separator></rich:separator>
 		<h:inputText value="#{modalPanel.inputTextTest}" />
+		<br />
 		<h:selectOneListbox value="#{modalPanel.selectOneListboxTest}">
-			<f:selectItem itemLabel="item 1" itemValue="item 1" />
-			<f:selectItem itemLabel="item 2" itemValue="item 2" />
-			<f:selectItem itemLabel="item 3" itemValue="item 3" />
+			<f:selectItem itemLabel="1" itemValue="1" />
+			<f:selectItem itemLabel="2" itemValue="2" />
+			<f:selectItem itemLabel="3" itemValue="3" />
 		</h:selectOneListbox>
-
-		<f:verbatim><br /><br /></f:verbatim>
-		<rich:spacer width="20" height="20"></rich:spacer>
-
-		<h:outputLink value="http://localhost:8080/facelets"><f:verbatim>http://localhost:8080/facelets/</f:verbatim></h:outputLink>
-		<f:verbatim><br /><br /></f:verbatim>
-		<a4j:commandLink onclick="Richfaces.showModalPanel('modalPanel2ID');return false;" value="show ModalPanel 2"></a4j:commandLink>
-		<f:verbatim><br /><br /></f:verbatim>
-		<h:outputLink onclick="Richfaces.hideModalPanel('modalPanelID');return false;" ><f:verbatim>Close</f:verbatim></h:outputLink>
-	</rich:modalPanel>
-	
-	<rich:modalPanel id="modalPanel2ID" autosized="true" resizeable="false">
+		<rich:separator></rich:separator>
+		<rich:spacer height="20"></rich:spacer>
+		<h:outputLink value="http://localhost:8081/jsp/">
+			<f:verbatim>http://localhost:8081/jsp/</f:verbatim>
+		</h:outputLink>
+		<rich:separator></rich:separator>
 		<br />
-		<h:inputText value="input"></h:inputText>
 		<br />
-		<h:outputLink onclick="Richfaces.hideModalPanel('modalPanel2ID');return false;" ><f:verbatim>Close</f:verbatim></h:outputLink>
-		
-		
+		<a4j:commandLink
+			onclick="Richfaces.showModalPanel('modalPanel2ID');return false;"
+			value="show ModalPanel 2"></a4j:commandLink>
+		<br />
+		<br />
+		<h:outputLink
+			onclick="Richfaces.hideModalPanel('modalPanelID');return false;">
+			<f:verbatim>Close</f:verbatim>
+		</h:outputLink>
+		<br />
+		<h:outputLink onclick="Richfaces.hideTopModalPanel();return false;">
+			<f:verbatim>Close Top Panel</f:verbatim>
+		</h:outputLink>
 	</rich:modalPanel>
-	
-	<rich:modalPanel id="modalPanel3ID" 
-	minHeight="100" 
-	minWidth="200" 
-	moveable="true" 
-	resizeable="true"
-	keepVisualState="true">
+
+	<rich:modalPanel id="modalPanel2ID" autosized="true" resizeable="false">
 		<f:facet name="header">
-			<h:outputText value="Events..." />
+			<h:outputText value="HEADER for PANEL2" />
 		</f:facet>
 		<f:facet name="controls">
-			<h:commandLink value="Close" onclick="Richfaces.hideModalPanel('modalPanel3ID');" />
+			<h:graphicImage value="/pics/error.gif"
+				onclick="Richfaces.hideModalPanel('modalPanel2ID'); return false;" />
 		</f:facet>
+		<h:inputText value="input"></h:inputText>
+		<br />
+		<h:outputLink
+			onclick="Richfaces.hideModalPanel('modalPanel2ID');return false;">
+			<f:verbatim>Close</f:verbatim>
+		</h:outputLink>
+		<br />
+		<h:outputLink onclick="Richfaces.hideTopModalPanel();return false;">
+			<f:verbatim>Close Top Panel</f:verbatim>
+		</h:outputLink>
+		<rich:pickList id="pickListID">
+			<f:selectItem itemValue="selectItem 0" itemLabel="selectItem 0" />
+			<f:selectItem itemValue="selectItem 1" itemLabel="selectItem 1" />
+			<f:selectItem itemValue="selectItem 2" itemLabel="selectItem 2" />
+		</rich:pickList>
+		<br />
+		<a4j:commandButton reRender="pickListID" value="refresh target"></a4j:commandButton>
+	</rich:modalPanel>
 
-		<h:outputText value="Eventsaaaaaaaaaaaaaaaa ..." />
-		<rich:calendar popup="true" />
-	</rich:modalPanel>
-	<a onclick="Richfaces.showModalPanel('modalPanelID');" href="#">show ModalPanel 1</a>
+	<a onclick="Richfaces.showModalPanel('modalPanelID');" href="#">show
+	ModalPanel 1</a>
 	<br />
-	<a4j:commandLink onclick="Richfaces.showModalPanel('modalPanel2ID');return false;" value="show ModalPanel 2"></a4j:commandLink>
-	<f:verbatim><br /></f:verbatim>
-	<h:outputText value="click on image for open Modal Panel 3" />
-	<h:graphicImage value="/pics/info.gif">
-		<rich:componentControl event="onclick" for="modalPanel3ID" operation="show"></rich:componentControl>
-	</h:graphicImage>
-	<f:verbatim>
-		<br /><br />
-		<div id="idDiv1" align="center" style="position: relative; font-size: 50px; z-index: 2; color: navy" >z-index1</div>
-		<div id="idDiv2" align="center" style="position: relative; font-size: 50px; z-index: 2; color: navy">z-index2</div>
-	</f:verbatim>
-</f:subview>
+	<a4j:commandLink
+		onclick="Richfaces.showModalPanel('modalPanel2ID');return false;"
+		value="show ModalPanel 2"></a4j:commandLink>
+	<br />
+	<rich:spacer height="20"></rich:spacer>
+	<br />
+	<div id="idDiv1" align="center"
+		style="position: relative; font-size: 50px; z-index: 2; color: navy">z-index1</div>
+	<div id="idDiv2" align="center"
+		style="position: relative; font-size: 50px; z-index: 2; color: navy">z-index2</div>
+
+	<!-- <div style="FONT-WEIGHT: bold;">rich:findComponent</div>
+		<h:panelGrid columns="2" id="findComponentID">
+			<a4j:commandLink value="getSize"
+				onclick="multiply(#{rich:findComponent('modalPanelID').height},#{rich:findComponent('modalPanelID').width});" />
+			<div id="tbodyID"></div>
+		</h:panelGrid>
+		<rich:separator></rich:separator> -->
+</f:subview>
\ No newline at end of file

Modified: trunk/test-applications/facelets/src/main/webapp/ModalPanel/ModalPanelProperty.xhtml
===================================================================
--- trunk/test-applications/facelets/src/main/webapp/ModalPanel/ModalPanelProperty.xhtml	2009-04-16 12:26:31 UTC (rev 13605)
+++ trunk/test-applications/facelets/src/main/webapp/ModalPanel/ModalPanelProperty.xhtml	2009-04-16 12:54:42 UTC (rev 13606)
@@ -1,33 +1,70 @@
+<f:subview xmlns:ui="http://java.sun.com/jsf/facelets"
+	xmlns:f="http://java.sun.com/jsf/core"
+	xmlns:a4j="http://richfaces.org/a4j"
+	xmlns:h="http://java.sun.com/jsf/html"
+	xmlns:rich="http://richfaces.org/rich" id="ModalPanelPropertySubviewID">
 
-<f:subview xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core" xmlns:a4j="http://richfaces.org/a4j" xmlns:h="http://java.sun.com/jsf/html" xmlns:rich="http://richfaces.org/rich" id="ModalPanelPropertySubviewID">
-<h:commandButton value="add test" action="#{modalPanel.addHtmlModalPanel}"></h:commandButton>
+	<rich:modalPanel id="modalPanelID" minHeight="100" minWidth="200"
+		moveable="true" autosized="true" resizeable="false">
+		<f:facet name="header">
+			<h:outputText value="Events" />
+		</f:facet>
+		<f:facet name="controls">
+			<h:graphicImage value="/pics/error.gif"
+				onclick="Richfaces.hideModalPanel('modalPanelID'); return false;" />
+		</f:facet>
+		<h:outputText value="Events" />
+		<rich:calendar popup="true" />
+		<rich:separator></rich:separator>
+		<h:outputLink
+			onclick="Richfaces.hideModalPanel('modalPanelID');return false;">
+			<f:verbatim>Close (Does not work)</f:verbatim>
+		</h:outputLink>
+		<br />
+		<h:outputLink onclick="Richfaces.hideTopModalPanel();return false;">
+			<f:verbatim>Close Top Panel</f:verbatim>
+		</h:outputLink>
+	</rich:modalPanel>
+	<fieldset><legend>Rich-hideTopModalPanel() TEST</legend> <h:outputText
+		value="click on image for open Modal Panel 3" /> <h:graphicImage
+		value="/pics/info.gif">
+		<rich:componentControl event="onclick" for="modalPanelID"
+			operation="show"></rich:componentControl>
+	</h:graphicImage></fieldset>
+	<br />
+	<h:commandButton value="add test"
+		action="#{modalPanel.addHtmlModalPanel}"></h:commandButton>
 	<h:panelGrid columns="2">
+		<h:outputText value="domElementAttachment"></h:outputText>
+		<h:selectOneRadio value="#{modalPanel.domElementAttachment}"
+			onchange="submit();">
+			<f:selectItem itemValue="body" itemLabel="body" />
+			<f:selectItem itemValue="parent" itemLabel="parent" />
+			<f:selectItem itemValue="form" itemLabel="form" />
+		</h:selectOneRadio>
+
 		<h:outputText value="visualOptions"></h:outputText>
 		<h:inputText value="#{modalPanel.visualOptions}" onchange="submit();"></h:inputText>
 
 		<h:outputText value="shadowDepth" />
-		<h:inputText value="#{modalPanel.shadowDepth}">
-			<a4j:support event="onchange" reRender="modalPanelID"></a4j:support>
+		<h:inputText value="#{modalPanel.shadowDepth}" onchange="submit();">
 		</h:inputText>
 
 		<h:outputText value="shadowOpacity" />
-		<h:inputText value="#{modalPanel.shadowOpacity}">
-			<a4j:support event="onchange" reRender="modalPanelID"></a4j:support>
+		<h:inputText value="#{modalPanel.shadowOpacity}" onchange="submit();">
 		</h:inputText>
 
 		<h:outputText value="keepVisualState" />
-		<h:selectBooleanCheckbox value="#{modalPanel.keepVisualState}">
-			<a4j:support event="onchange" reRender="modalPanelID"></a4j:support>
+		<h:selectBooleanCheckbox value="#{modalPanel.keepVisualState}"
+			onchange="submit();">
 		</h:selectBooleanCheckbox>
 
 		<h:outputText value="left" />
-		<h:inputText value="#{modalPanel.left}">
-			<a4j:support event="onchange" reRender="modalPanelID"></a4j:support>
+		<h:inputText value="#{modalPanel.left}" onchange="submit();">
 		</h:inputText>
 
 		<h:outputText value="top" />
-		<h:inputText value="#{modalPanel.top}">
-			<a4j:support event="onchange" reRender="modalPanelID"></a4j:support>
+		<h:inputText value="#{modalPanel.top}" onchange="submit();">
 		</h:inputText>
 
 		<h:outputText value="rendered" />
@@ -37,50 +74,42 @@
 		</h:selectBooleanCheckbox>
 
 		<h:outputText value="showWhenRendered" />
-		<h:selectBooleanCheckbox value="#{modalPanel.showWhenRendered}">
-			<a4j:support event="onchange" reRender="modalPanelID"></a4j:support>
+		<h:selectBooleanCheckbox value="#{modalPanel.showWhenRendered}"
+			onchange="submit();">
 		</h:selectBooleanCheckbox>
 
 		<h:outputText value="zindex" />
-		<h:selectOneRadio value="#{modalPanel.zindex}">
+		<h:selectOneRadio value="#{modalPanel.zindex}" onchange="submit();">
 			<f:selectItem itemLabel="1" itemValue="1" />
 			<f:selectItem itemLabel="3" itemValue="3" />
-			<a4j:support event="onchange" reRender="modalPanelID"></a4j:support>
 		</h:selectOneRadio>
 
 		<h:outputText value="Width:" />
-		<h:inputText value="#{modalPanel.width}">
-			<a4j:support event="onchange" reRender="modalPanelID"></a4j:support>
+		<h:inputText value="#{modalPanel.width}" onchange="submit();">
 		</h:inputText>
 
 		<h:outputText value="Height:" />
-		<h:inputText value="#{modalPanel.height}">
-			<a4j:support event="onchange" reRender="modalPanelID"></a4j:support>
+		<h:inputText value="#{modalPanel.height}" onchange="submit();">
 		</h:inputText>
 
 		<h:outputText value="minWidth:" />
-		<h:inputText value="#{modalPanel.minWidth}">
-			<a4j:support event="onchange" reRender="modalPanelID"></a4j:support>
+		<h:inputText value="#{modalPanel.minWidth}" onchange="submit();">
 		</h:inputText>
 
 		<h:outputText value="minHeight:" />
-		<h:inputText value="#{modalPanel.minHeight}">
-			<a4j:support event="onchange" reRender="modalPanelID"></a4j:support>
+		<h:inputText value="#{modalPanel.minHeight}" onchange="submit();">
 		</h:inputText>
 
 		<h:outputText value="autosized:" />
 		<h:selectBooleanCheckbox value="#{modalPanel.autosized}"
-			onchange="submit();">
-		</h:selectBooleanCheckbox>
+			onchange="submit();"></h:selectBooleanCheckbox>
 
 		<h:outputText value="resizeable:" />
 		<h:selectBooleanCheckbox value="#{modalPanel.resizeable}"
-			onchange="submit();">
-		</h:selectBooleanCheckbox>
+			onchange="submit();"></h:selectBooleanCheckbox>
 
-		<h:outputText value="Moveable:" />
-		<h:selectBooleanCheckbox value="#{modalPanel.moveable}">
-			<a4j:support event="onclick" reRender="modalPanelID"></a4j:support>
-		</h:selectBooleanCheckbox>
-	</h:panelGrid>	
+		<h:outputText value="Moveable: " />
+		<h:selectBooleanCheckbox value="#{modalPanel.moveable}"
+			onchange="submit();"></h:selectBooleanCheckbox>
+	</h:panelGrid>
 </f:subview>
\ No newline at end of file




More information about the richfaces-svn-commits mailing list