JBoss Rich Faces SVN: r18013 - in root/ui/output/trunk/panels/ui/src/test: resources and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: amarkhel
Date: 2010-07-13 14:41:20 -0400 (Tue, 13 Jul 2010)
New Revision: 18013
Modified:
root/ui/output/trunk/panels/ui/src/test/java/org/richfaces/renderkit/html/PopupRendererTest.java
root/ui/output/trunk/panels/ui/src/test/resources/panelTest.xhtml
root/ui/output/trunk/panels/ui/src/test/resources/popupPanelText.xhtml
Log:
Modified: root/ui/output/trunk/panels/ui/src/test/java/org/richfaces/renderkit/html/PopupRendererTest.java
===================================================================
--- root/ui/output/trunk/panels/ui/src/test/java/org/richfaces/renderkit/html/PopupRendererTest.java 2010-07-13 18:37:09 UTC (rev 18012)
+++ root/ui/output/trunk/panels/ui/src/test/java/org/richfaces/renderkit/html/PopupRendererTest.java 2010-07-13 18:41:20 UTC (rev 18013)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.richfaces.renderkit.html;
+package org.richfaces.renderkit;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
@@ -27,6 +27,7 @@
import java.io.File;
import java.io.IOException;
+import java.util.List;
import javax.faces.application.ViewHandler;
import javax.faces.context.FacesContext;
@@ -66,7 +67,7 @@
private FacesRequest startFacesRequest() throws IOException {
FacesRequest facesRequest = environment.createFacesRequest("http://localhost/popupPanelTest.jsf");
- facesRequest.withViewId("/popupPanelTest.jsf");
+ facesRequest.withViewId("/panelTest.jsf");
facesRequest.start();
FacesContext facesContext = FacesContext.getCurrentInstance();
ViewHandler vh = facesContext.getApplication().getViewHandler();
@@ -80,17 +81,17 @@
*
* @throws IOException
*/
- @Test
+ /* @Test
public final void testGetComponentClass() throws IOException {
- /*FacesRequest facesRequest = startFacesRequest();
+ FacesRequest facesRequest = startFacesRequest();
FacesContext facesContext = FacesContext.getCurrentInstance();
UIPopupPanel component = (UIPopupPanel) facesContext.getViewRoot().findComponent("panel");
PopupPanelRenderer renderer = (PopupPanelRenderer) FacesContext.getCurrentInstance()
.getRenderKit().getRenderer(component.getFamily(), component.getRendererType());
assertEquals(UIPopupPanel.class, renderer.getComponentClass());
- facesRequest.release();*/
+ facesRequest.release();
return ;
- }
+ }*/
/**
* Test method for
@@ -99,61 +100,42 @@
*
* @throws IOException
*/
- /*@Test
+ @Test
public final void testDoEncode() throws IOException {
- HtmlPage page = environment.getPage("/panelTest.jsf");
- HtmlElement panelWithFacet = page.getElementById("panelWithFacet");
- assertEquals("rf-panel panel", panelWithFacet.getAttribute("class"));
- assertEquals("Write your own custom rich components with built-in AJAX support", panelWithFacet.getElementById("panelWithFacet_header").getTextContent().trim());
- assertEquals("The CDK includes", panelWithFacet.getElementById("panelWithFacet_body")
+ HtmlPage page = environment.getPage("/popupPanelTest.jsf");
+ HtmlElement panelWithFacet = page.getElementById("panel");
+ assertNotNull(panelWithFacet);
+ assertEquals("visibility: hidden;", panelWithFacet.getAttribute("style"));
+ HtmlElement panelShade = panelWithFacet.getElementById("panel_shade");
+ assertEquals("mp_shade", panelShade.getAttribute("class"));
+ assertNotNull(panelShade);
+ HtmlElement panelShadow = panelWithFacet.getElementById("panel_shadow");
+ assertEquals("mp_shadow", panelShadow.getAttribute("class"));
+ assertNotNull(panelShadow);
+ HtmlElement panelContainer = panelWithFacet.getElementById("panel_container");
+ assertNotNull(panelContainer);
+ assertEquals("mp_container panelStyle", panelContainer.getAttribute("class"));
+ HtmlElement panelScroller = panelWithFacet.getElementById("panel_content_scroller");
+ assertNotNull(panelScroller);
+ assertEquals("mp_content_scroller ", panelScroller.getAttribute("class"));
+ HtmlElement panelContent = panelWithFacet.getElementById("panel_content");
+ assertNotNull(panelContent);
+ assertEquals("mp_content", panelContent.getAttribute("class"));
+ assertEquals("The CDK includes", panelContent
.getTextContent().trim().substring(0, 16));
- HtmlElement simplePanel = page.getElementById("simplePanel");
- assertEquals("rf-panel ", simplePanel.getAttribute("class"));
- try{
- simplePanel.getElementById("simplePanel_header");
- }catch(Exception e){
- assertTrue(true);
- }
- assertEquals("RichFaces is a l", simplePanel
- .getElementById("simplePanel_body")
- .getTextContent().trim().substring(0, 16));
- HtmlElement simplePanelBody = page.getElementById("simplePanel_body");
- assertEquals("rf-panel-body rich-laguna-panel-no-header", simplePanelBody.getAttribute("class"));
- HtmlElement simplePanel2 = page.getElementById("simplePanelWithTextHeader");
- assertEquals("rf-panel ", simplePanel2.getAttribute("class"));
- assertNotNull(simplePanel2.getElementById("simplePanelWithTextHeader_header"));
- assertEquals("rich-laguna-panel-no-header", simplePanel2.getElementById("simplePanelWithTextHeader_header").getTextContent().trim());
- assertEquals("RichFaces is a l", simplePanel2
- .getElementById("simplePanelWithTextHeader_body")
- .getTextContent().trim().substring(0, 16));
-
- HtmlElement nestedPanelContainer = page.getElementById("nestedPanelContainer");
- assertEquals("rf-panel ", nestedPanelContainer.getAttribute("class"));
- assertNotNull(nestedPanelContainer.getElementById("nestedPanelContainer_header"));
- assertEquals("||||", nestedPanelContainer.getElementById("nestedPanelContainer_header").getTextContent().trim());
- HtmlElement nestedPanelContainerHeader = page.getElementById("nestedPanelContainer_header");
- assertEquals("rf-panel-header outpanelHeader", nestedPanelContainerHeader.getAttribute("class"));
- assertEquals("Benefits of Usin", nestedPanelContainer
- .getElementById("nestedPanelContainer_body")
- .getTextContent().trim().substring(0, 16));
- HtmlElement nestedPanel1 = nestedPanelContainer.getElementById("nestedPanel1");
- assertEquals("rf-panel ", nestedPanel1.getAttribute("class"));
- HtmlElement nestedPanel1Body = page.getElementById("nestedPanel1_body");
- assertEquals("rf-panel-body inpanelBody", nestedPanel1Body.getAttribute("class"));
- assertNotNull(nestedPanel1.getElementById("nestedPanel1_header"));
- assertEquals("For Application Developers", nestedPanel1.getElementById("nestedPanel1_header").getTextContent().trim());
- assertEquals("Production quali", nestedPanel1
- .getElementById("nestedPanel1_body")
- .getTextContent().trim().substring(0, 16));
- HtmlElement nestedPanel2 = nestedPanelContainer.getElementById("nestedPanel2");
- assertEquals("rf-panel ", nestedPanel2.getAttribute("class"));
- HtmlElement nestedPanel2Body = page.getElementById("nestedPanel2_body");
- assertEquals("rf-panel-body inpanelBody", nestedPanel2Body.getAttribute("class"));
- assertNotNull(nestedPanel2.getElementById("nestedPanel2_header"));
- assertEquals("For Component Developers", nestedPanel2.getElementById("nestedPanel2_header").getTextContent().trim());
- assertEquals("Ajax4jsf is Open", nestedPanel2
- .getElementById("nestedPanel2_body")
- .getTextContent().trim().substring(0, 16));
- }*/
+ HtmlElement panelHeader = panelWithFacet.getElementById("panel_header");
+ assertNotNull(panelHeader);
+ assertEquals("mp_header header", panelHeader.getAttribute("class"));
+ assertEquals("cursor: move;", panelHeader.getAttribute("style"));
+ assertEquals("Write your own custom rich components with built-in AJAX\n\t\t\tModal", panelHeader.getTextContent().trim());
+ HtmlElement panelHeaderControls = panelWithFacet.getElementById("panel_header_controls");
+ assertNotNull(panelHeaderControls);
+ assertEquals("mp_header_controls control", panelHeaderControls.getAttribute("class"));
+ HtmlElement panelResizer = panelWithFacet.getElementById("panelResizerN");
+ assertNotNull(panelResizer);
+ assertEquals("mp_handler mp_handler_top", panelResizer.getAttribute("class"));
+ assertEquals("cursor: N-resize;", panelResizer.getAttribute("style"));
+ List<HtmlElement> result = page.getElementsByName("script");
+ }
}
\ No newline at end of file
Modified: root/ui/output/trunk/panels/ui/src/test/resources/panelTest.xhtml
===================================================================
--- root/ui/output/trunk/panels/ui/src/test/resources/panelTest.xhtml 2010-07-13 18:37:09 UTC (rev 18012)
+++ root/ui/output/trunk/panels/ui/src/test/resources/panelTest.xhtml 2010-07-13 18:41:20 UTC (rev 18013)
@@ -7,54 +7,92 @@
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:panel="http://richfaces.org/panels"
xmlns:rich="http://richfaces.org/rich">
+<!--
+JBoss, Home of Professional Open Source
+Copyright ${year}, Red Hat, Inc. and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+
+This software is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+
+You should have received a copy of the GNU Lesser General Public
+License along with this software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site: http://www.fsf.org.
+-->
<h:head>
<title>Richfaces ExtendedDataTable Test</title>
</h:head>
<h:body>
- <panel:popupPanel domElementAttachment="body"
- visualOptions="{left:400px;}" moveable="true"
- overlapEmbedObjects="true" keepVisualState="true"
- onmaskclick="alert('1')" width="600" height="400" id="panel"
- left="500px" top="300px">
- <f:facet name="header">
- Write your own custom rich components with built-in AJAX
- </f:facet>
- <h:form>
- <h:panelGroup layout="block"
- style="width:500px,height:400px;">
- The CDK includes a code-generation facility and a
- templating facility using a JSP-like syntax. These
- capabilities help to avoid a routine process of a
- component creation. The component factory works like
- a well-oiled machine allowing the creation of
- first-class rich components with built-in Ajax
- functionality even more easily than the creation of
- simpler components by means of the traditional
- coding approach.
-
-
- <h:inputText value="aaa" />
- <a href="#"
- onclick="RichFaces.$('panel').setSize(500, 300)" tabindex="0">
- setSize
- </a>
- <a href="#"
- onclick="RichFaces.$('panel').resize(20, 50)" tabindex="0">
- resize
- </a>
- <a href="#"
- onclick="RichFaces.$('panel').move(20, 50)" tabindex="0">
- move
- </a>
-
- <a href="#"
- onclick="RichFaces.$('panel').moveTo(20, 50)" tabindex="0">
- moveTo
- </a>
- </h:panelGroup>
- </h:form>
- </panel:popupPanel>
+ <panel:panel styleClass="panel" id="panelWithFacet">
+ <f:facet name="header">
+ Write your own custom rich components with built-in AJAX support
+ </f:facet>
+ The CDK includes a code-generation facility and a
+ templating facility using a JSP-like syntax. These capabilities help
+ to avoid a routine process of a component creation. The component factory
+ works like a well-oiled machine allowing the creation of first-class
+ rich components with built-in Ajax functionality even more easily than
+ the creation of simpler components by means of the traditional coding
+ approach.
+ </panel:panel>
+ <panel:panel id="simplePanel" bodyClass="rich-laguna-panel-no-header">
+ RichFaces is a library for adding rich user interface features to JSF
+ applications. It extends the Ajax4jsf framework to include a large
+ (and growing) set of powerful rich AJAX-enabled components that come
+ with extensive skins support.
+ </panel:panel>
+ <panel:panel id="simplePanelWithTextHeader" header="rich-laguna-panel-no-header">
+ RichFaces is a library for adding rich user interface features to JSF
+ applications. It extends the Ajax4jsf framework to include a large
+ (and growing) set of powerful rich AJAX-enabled components that come
+ with extensive skins support.
+ </panel:panel>
+ <panel:panel id="nestedPanelContainer" style="padding:0" headerClass="outpanelHeader">
+ <f:facet name="header">
+ ||||
+ </f:facet>
+ <h2 align="center"><h:outputText value="Benefits of Using Ajax4jsf" /></h2>
+ <h:panelGrid columns="2" columnClasses="gridContent">
+ <panel:panel id="nestedPanel1" bodyClass="inpanelBody">
+ <f:facet name="header">
+ For Application Developers
+ </f:facet>
+ <ul>
+ <li>Production quality Open Source</li>
+ <li>Does Open Source and has an Open Architecture</li>
+ <li>Compatible with any JSF Implementation - MyFaces, JSF1.1, JSF1.2</li>
+ <li>Allows to Ajaxify JSF application without writing Javascript</li>
+ <li>Works with standard and third party components</li>
+ <li>Adds the Ajax capability to existing non-Ajax components</li>
+ </ul>
+ </panel:panel>
+ <panel:panel id="nestedPanel2" bodyClass="inpanelBody">
+ <f:facet name="header" >
+ For Component Developers
+ </f:facet>
+ <ul>
+ <li>Ajax4jsf is Open Source and has an Open Architecture</li>
+ <li>Gives an API to create components with built-in Ajax support</li>
+ <li>Has a Component Development Kit for rapid development</li>
+ <li>Allows to skin the look-n-feel using both CSS and set of skin-parameters</li>
+ <li>Automatically generates the unit test-cases for developing components</li>
+ <li>Allows to pack javascript code, images, css inside the final jar</li>
+ </ul>
+ </panel:panel>
+ </h:panelGrid>
+ </panel:panel>
</h:body>
</html>
Modified: root/ui/output/trunk/panels/ui/src/test/resources/popupPanelText.xhtml
===================================================================
--- root/ui/output/trunk/panels/ui/src/test/resources/popupPanelText.xhtml 2010-07-13 18:37:09 UTC (rev 18012)
+++ root/ui/output/trunk/panels/ui/src/test/resources/popupPanelText.xhtml 2010-07-13 18:41:20 UTC (rev 18013)
@@ -1,3 +1,5 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:fn="http://java.sun.com/jsp/jstl/functions"
xmlns:h="http://java.sun.com/jsf/html"
@@ -3,5 +5,4 @@
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
- xmlns:panel="http://richfaces.org/panels"
xmlns:rich="http://richfaces.org/rich">
@@ -11,14 +12,17 @@
</h:head>
<h:body>
- <panel:popupPanel domElementAttachment="body"
- visualOptions="{left:400px;}" moveable="true"
- overlapEmbedObjects="true" keepVisualState="true"
- onmaskclick="alert('1')" width="600" height="400" id="panel"
- left="500px" top="300px">
+ <rich:popupPanel styleClass="panelStyle" headerClass="header" controlsClass="control"
+
+
+ id="panel"
+ >
<f:facet name="header">
Write your own custom rich components with built-in AJAX
</f:facet>
+ <f:facet name="controls">
+ <h:outputText value="Modal" />
+ </f:facet>
<h:form>
<h:panelGroup layout="block"
style="width:500px,height:400px;">
@@ -53,6 +57,6 @@
</a>
</h:panelGroup>
</h:form>
- </panel:popupPanel>
+ </rich:popupPanel>
</h:body>
</html>
14 years, 6 months
JBoss Rich Faces SVN: r18012 - in root/ui/core/trunk/ui/src: main/java/org/richfaces/renderkit/html and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-07-13 14:37:09 -0400 (Tue, 13 Jul 2010)
New Revision: 18012
Modified:
root/ui/core/trunk/ui/src/main/java/org/richfaces/component/QueuePreRenderViewListener.java
root/ui/core/trunk/ui/src/main/java/org/richfaces/component/QueueRegistry.java
root/ui/core/trunk/ui/src/main/java/org/richfaces/renderkit/html/QueueResourceComponentRenderer.java
root/ui/core/trunk/ui/src/test/java/org/richfaces/component/QueueRendererTest.java
Log:
Fixed duplicate ID exception caused by queuing feature
Modified: root/ui/core/trunk/ui/src/main/java/org/richfaces/component/QueuePreRenderViewListener.java
===================================================================
--- root/ui/core/trunk/ui/src/main/java/org/richfaces/component/QueuePreRenderViewListener.java 2010-07-13 18:31:23 UTC (rev 18011)
+++ root/ui/core/trunk/ui/src/main/java/org/richfaces/component/QueuePreRenderViewListener.java 2010-07-13 18:37:09 UTC (rev 18012)
@@ -21,8 +21,6 @@
*/
package org.richfaces.component;
-import java.util.List;
-
import javax.faces.application.Application;
import javax.faces.component.UIComponent;
import javax.faces.component.UIOutput;
@@ -40,8 +38,6 @@
*/
public class QueuePreRenderViewListener implements SystemEventListener {
- private static final String HEAD = "head";
-
private static final String QUEUE_RESOURCE_COMPONENT_RENDERER_TYPE = "org.richfaces.QueueResourceComponentRenderer";
public boolean isListenerForSource(Object source) {
@@ -51,30 +47,19 @@
public void processEvent(SystemEvent event) throws AbortProcessingException {
FacesContext context = FacesContext.getCurrentInstance();
UIViewRoot viewRoot = context.getViewRoot();
- List<UIComponent> resources = viewRoot.getComponentResources(context, HEAD);
boolean queueEnabled = ContextInitParameters.isQueueEnabled(context);
-
- boolean resourceExists = false;
- for (UIComponent resourceComponent : resources) {
- if (QUEUE_RESOURCE_COMPONENT_RENDERER_TYPE.equals(resourceComponent.getRendererType()) &&
- UIOutput.COMPONENT_FAMILY.equals(resourceComponent.getFamily())) {
-
- if (!queueEnabled) {
- viewRoot.removeComponentResource(context, resourceComponent);
- }
-
- resourceExists = true;
- break;
- }
- }
-
- if (!resourceExists && queueEnabled) {
+ if (queueEnabled) {
Application application = context.getApplication();
UIComponent queueResourceComponent = application.createComponent(context,
UIOutput.COMPONENT_TYPE, QUEUE_RESOURCE_COMPONENT_RENDERER_TYPE);
+ //fix for JSF duplicate ID exception
+ queueResourceComponent.setId(QueueRegistry.QUEUE_SCRIPT_ID);
+
viewRoot.addComponentResource(context, queueResourceComponent);
+ } else {
+ //queue can be switched off at application level, not a page level, so no need to remove it if it is switched off
}
}
Modified: root/ui/core/trunk/ui/src/main/java/org/richfaces/component/QueueRegistry.java
===================================================================
--- root/ui/core/trunk/ui/src/main/java/org/richfaces/component/QueueRegistry.java 2010-07-13 18:31:23 UTC (rev 18011)
+++ root/ui/core/trunk/ui/src/main/java/org/richfaces/component/QueueRegistry.java 2010-07-13 18:37:09 UTC (rev 18012)
@@ -37,7 +37,7 @@
*/
public final class QueueRegistry {
- public static final String QUEUE_SCRIPT_CLIENT_ID = "org.richfaces.queue";
+ public static final String QUEUE_SCRIPT_ID = "_org_richfaces_queue";
private static final Logger LOGGER = RichfacesLogger.COMPONENTS.getLogger();
Modified: root/ui/core/trunk/ui/src/main/java/org/richfaces/renderkit/html/QueueResourceComponentRenderer.java
===================================================================
--- root/ui/core/trunk/ui/src/main/java/org/richfaces/renderkit/html/QueueResourceComponentRenderer.java 2010-07-13 18:31:23 UTC (rev 18011)
+++ root/ui/core/trunk/ui/src/main/java/org/richfaces/renderkit/html/QueueResourceComponentRenderer.java 2010-07-13 18:37:09 UTC (rev 18012)
@@ -80,8 +80,7 @@
ResponseWriter writer = context.getResponseWriter();
writer.startElement(HTML.SCRIPT_ELEM, component);
- writer.writeAttribute(HTML.ID_ATTRIBUTE,
- context.getExternalContext().encodeNamespace(QueueRegistry.QUEUE_SCRIPT_CLIENT_ID), null);
+ writer.writeAttribute(HTML.ID_ATTRIBUTE, component.getClientId(context), null);
writer.writeAttribute(HTML.TYPE_ATTR, HTML.JAVASCRIPT_TYPE, null);
writer.writeText(FUNCTION_NAME, null);
Modified: root/ui/core/trunk/ui/src/test/java/org/richfaces/component/QueueRendererTest.java
===================================================================
--- root/ui/core/trunk/ui/src/test/java/org/richfaces/component/QueueRendererTest.java 2010-07-13 18:31:23 UTC (rev 18011)
+++ root/ui/core/trunk/ui/src/test/java/org/richfaces/component/QueueRendererTest.java 2010-07-13 18:37:09 UTC (rev 18012)
@@ -159,7 +159,7 @@
}
private String extractQueueScript(HtmlPage page) {
- HtmlElement scriptElement = page.getElementById(QueueRegistry.QUEUE_SCRIPT_CLIENT_ID);
+ HtmlElement scriptElement = page.getElementById(QueueRegistry.QUEUE_SCRIPT_ID);
if (scriptElement != null) {
return getTextContent(scriptElement);
}
14 years, 6 months
JBoss Rich Faces SVN: r18008 - root/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/script.
by richfaces-svn-commits@lists.jboss.org
Author: amarkhel
Date: 2010-07-13 14:28:39 -0400 (Tue, 13 Jul 2010)
New Revision: 18008
Added:
root/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/script/popupPanelSizer.js
Log:
Added: root/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/script/popupPanelSizer.js
===================================================================
--- root/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/script/popupPanelSizer.js (rev 0)
+++ root/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/script/popupPanelSizer.js 2010-07-13 18:28:39 UTC (rev 18008)
@@ -0,0 +1,279 @@
+(function ($, richfaces) {
+
+ richfaces.ui = richfaces.ui || {};
+
+ richfaces.ui.PopupPanel.Sizer = function(id, modalPanel, cursor, sizer) {
+
+ $super.constructor.call(this,id);
+
+ };
+
+ var $super = richfaces.BaseComponent.extend(richfaces.BaseComponent, richfaces.ui.PopupPanel.Sizer);
+ var $super = richfaces.ui.PopupPanel.Sizer.$super;
+ $.extend(richfaces.ui.PopupPanel.Sizer.prototype, (function (options) {
+ return {
+
+ name: "richfaces.ui.PopupPanel.Sizer",
+
+ doSetupSize: function (modalPanel, elt) {
+ var width = 0;
+ var height = 0;
+
+ var reductionData = modalPanel.reductionData;
+
+ if (reductionData) {
+ if (reductionData.w) {
+ width = reductionData.w / 2;
+ }
+
+ if (reductionData.h) {
+ height = reductionData.h / 2;
+ }
+ }
+
+ if (width > 0) {
+ if (elt.clientWidth > width) {
+ if (!elt.reducedWidth) {
+ elt.reducedWidth = jQuery(elt).css('width');
+ }
+ jQuery(elt).css('width', width + 'px');
+ } else if (width < 4 && elt.reducedWidth == 4 + 'px') {
+ jQuery(elt).css('width', width + 'px');
+ }
+ } else {
+ if (elt.reducedWidth) {
+ jQuery(elt).css('width', elt.reducedWidth);
+ elt.reducedWidth = undefined;
+ }
+ }
+
+ if (height > 0) {
+ if (elt.clientHeight > height) {
+ if (!elt.reducedHeight) {
+ elt.reducedHeight = jQuery(elt).css('height');
+ }
+ elt.style.height = height + 'px';
+ } else if (height < 4 && elt.reducedHeight == 4 + 'px') {
+ jQuery(elt).css('height', height + 'px');
+ }
+ } else {
+ if (elt.reducedHeight) {
+ jQuery(elt).css('height', elt.reducedHeight);
+ elt.reducedHeight = undefined;
+ }
+ }
+ },
+
+ doSetupPosition: function (modalPanel, elt, left, top) {
+ if(!isNaN(left) && !isNaN(top)){
+ jQuery(elt).css('left', left + 'px');
+ jQuery(elt).css('top', top + 'px');
+ }
+ },
+
+ doPosition: function (modalPanel, elt) {
+
+ },
+
+ doDiff: function (dx, dy) {
+
+ }
+ }
+
+ })());
+ richfaces.ui.PopupPanel.Sizer.Diff = function(dX, dY, dWidth, dHeight) {
+
+ this.deltaX = dX;
+ this.deltaY = dY;
+
+ this.deltaWidth = dWidth;
+ this.deltaHeight = dHeight;
+
+ };
+
+ richfaces.ui.PopupPanel.Sizer.Diff.EMPTY = function(){
+ return new richfaces.ui.PopupPanel.Sizer.Diff(0, 0, 0, 0);
+ },
+
+ richfaces.ui.PopupPanel.Sizer.N = function(){
+
+ }
+
+ $.extend(richfaces.ui.PopupPanel.Sizer.N.prototype, richfaces.ui.PopupPanel.Sizer.prototype);
+ $.extend(richfaces.ui.PopupPanel.Sizer.N.prototype, {
+
+
+ name: "richfaces.ui.PopupPanel.Sizer.N",
+
+ doPosition : function (popupPanel, elt) {
+ jQuery(elt).css('width',popupPanel.width() + 'px');
+ this.doSetupPosition(popupPanel, elt, 0, 0);
+ },
+
+ doDiff : function(dx, dy) {
+ return new richfaces.ui.PopupPanel.Sizer.Diff(0, dy, 0, -dy);
+ },
+
+ });
+
+ richfaces.ui.PopupPanel.Sizer.NW = function(){
+
+ }
+ $.extend(richfaces.ui.PopupPanel.Sizer.NW.prototype, richfaces.ui.PopupPanel.Sizer.prototype);
+ $.extend(richfaces.ui.PopupPanel.Sizer.NW.prototype, {
+
+ name: "richfaces.ui.PopupPanel.Sizer.NW",
+
+ doPosition : function (popupPanel, elt) {
+ this.doSetupSize(popupPanel, elt);
+ this.doSetupPosition(popupPanel, elt, 0, 0);
+ },
+
+ doDiff : function(dx, dy) {
+ return new richfaces.ui.PopupPanel.Sizer.Diff(dx, dy, -dx, -dy);
+ }
+
+ });
+
+ richfaces.ui.PopupPanel.Sizer.NE = function(){
+
+ }
+ $.extend(richfaces.ui.PopupPanel.Sizer.NE.prototype, richfaces.ui.PopupPanel.Sizer.prototype);
+ $.extend(richfaces.ui.PopupPanel.Sizer.NE.prototype, {
+
+ name: "richfaces.ui.PopupPanel.Sizer.NE",
+
+ doPosition : function (popupPanel, elt) {
+ this.doSetupSize(popupPanel, elt);
+ this.doSetupPosition(popupPanel, elt, popupPanel.width() - elt.clientWidth, 0);
+ },
+
+ doDiff : function(dx, dy) {
+ return new richfaces.ui.PopupPanel.Sizer.Diff(0, dy, dx, -dy);
+ }
+
+ });
+
+ richfaces.ui.PopupPanel.Sizer.E = function(){
+
+ }
+ $.extend(richfaces.ui.PopupPanel.Sizer.E.prototype, richfaces.ui.PopupPanel.Sizer.prototype);
+ $.extend(richfaces.ui.PopupPanel.Sizer.E.prototype, {
+
+ name: "richfaces.ui.PopupPanel.Sizer.E",
+
+ doPosition : function (popupPanel, elt) {
+ jQuery(elt).css('height', popupPanel.height() + 'px');
+ this.doSetupPosition(popupPanel, elt, popupPanel.width() - elt.clientWidth, 0);
+ },
+
+ doDiff : function(dx, dy) {
+ return new richfaces.ui.PopupPanel.Sizer.Diff(0, 0, dx, 0);
+ }
+
+ });
+
+ richfaces.ui.PopupPanel.Sizer.SE = function(){
+
+ }
+ $.extend(richfaces.ui.PopupPanel.Sizer.SE.prototype, richfaces.ui.PopupPanel.Sizer.prototype);
+ $.extend(richfaces.ui.PopupPanel.Sizer.prototype.SE, {
+
+ name: "richfaces.ui.PopupPanel.Sizer.SE",
+
+ doPosition : function (popupPanel, elt) {
+ this.doSetupSize(popupPanel, elt);
+ this.doSetupPosition(popupPanel, elt, popupPanel.width() - elt.clientWidth,
+ popupPanel.height() - elt.clientHeight);
+ },
+
+ doDiff : function(dx, dy) {
+ return new richfaces.ui.PopupPanel.Sizer.Diff(0, 0, dx, dy);
+ }
+
+ });
+
+ richfaces.ui.PopupPanel.Sizer.S = function(){
+
+ }
+ $.extend(richfaces.ui.PopupPanel.Sizer.S.prototype, richfaces.ui.PopupPanel.Sizer.prototype);
+ $.extend(richfaces.ui.PopupPanel.Sizer.S.prototype,{
+
+ name: "richfaces.ui.PopupPanel.Sizer.S",
+
+ doPosition : function (popupPanel, elt) {
+ jQuery(elt).css('width', popupPanel.width() + 'px');
+ this.doSetupPosition(popupPanel, elt, 0, popupPanel.height() - elt.clientHeight);
+ },
+
+ doDiff : function(dx, dy) {
+ return new richfaces.ui.PopupPanel.Sizer.Diff(0, 0, 0, dy);
+ }
+
+ });
+
+
+ richfaces.ui.PopupPanel.Sizer.SW = function(){
+
+ }
+ $.extend(richfaces.ui.PopupPanel.Sizer.SW.prototype, richfaces.ui.PopupPanel.Sizer.prototype);
+ $.extend(richfaces.ui.PopupPanel.Sizer.SW.prototype,{
+
+
+ name: "richfaces.ui.PopupPanel.Sizer.SW",
+
+ doPosition : function (popupPanel, elt) {
+ this.doSetupSize(popupPanel, elt);
+ this.doSetupPosition(popupPanel, elt, 0, popupPanel.height() - elt.clientHeight);
+ },
+
+ doDiff : function(dx, dy) {
+ return new richfaces.ui.PopupPanel.Sizer.Diff(dx, 0, -dx, dy);
+ }
+
+ });
+
+ richfaces.ui.PopupPanel.Sizer.W = function(){
+
+ }
+ $.extend(richfaces.ui.PopupPanel.Sizer.W.prototype, richfaces.ui.PopupPanel.Sizer.prototype);
+ $.extend(richfaces.ui.PopupPanel.Sizer.W.prototype,{
+
+
+ name: "richfaces.ui.PopupPanel.Sizer.W",
+
+ doPosition : function (popupPanel, elt) {
+ jQuery(elt).css('height', popupPanel.height() + 'px');
+ this.doSetupPosition(popupPanel, elt, 0, 0);
+ },
+
+ doDiff : function(dx, dy) {
+ return new richfaces.ui.PopupPanel.Sizer.Diff(dx, 0, -dx, 0);
+ }
+
+
+ });
+
+
+ richfaces.ui.PopupPanel.Sizer.Header = function(){
+
+ }
+ $.extend(richfaces.ui.PopupPanel.Sizer.Header.prototype, richfaces.ui.PopupPanel.Sizer.prototype);
+ $.extend(richfaces.ui.PopupPanel.Sizer.Header.prototype, {
+
+
+ name: "richfaces.ui.PopupPanel.Sizer.Header",
+
+ doPosition : function (popupPanel, elt) {
+
+ },
+
+ doDiff : function(dx, dy) {
+ return new richfaces.ui.PopupPanel.Sizer.Diff(dx, dy, 0, 0);
+ }
+
+
+ });
+
+
+})(jQuery, window.RichFaces);
\ No newline at end of file
14 years, 6 months
JBoss Rich Faces SVN: r18007 - root/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/script.
by richfaces-svn-commits@lists.jboss.org
Author: amarkhel
Date: 2010-07-13 14:28:20 -0400 (Tue, 13 Jul 2010)
New Revision: 18007
Added:
root/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/script/popupPanelBorders.js
Log:
Added: root/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/script/popupPanelBorders.js
===================================================================
--- root/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/script/popupPanelBorders.js (rev 0)
+++ root/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/script/popupPanelBorders.js 2010-07-13 18:28:20 UTC (rev 18007)
@@ -0,0 +1,174 @@
+(function ($, richfaces) {
+
+ richfaces.ui = richfaces.ui || {};
+
+ richfaces.ui.PopupPanel.Border = function(id, modalPanel, cursor, sizer) {
+
+ $super.constructor.call(this,id);
+
+ var element = jQuery(id);
+ jQuery(element).css('cursor',cursor);
+ var border = this;
+ jQuery(this.id).bind( 'mousedown', {border:border},this.startDrag);
+
+ this.modalPanel = modalPanel;
+ this.sizer = sizer;
+ };
+
+ var $super = richfaces.BaseComponent.extend(richfaces.BaseComponent, richfaces.ui.PopupPanel.Border);
+ var $super = richfaces.ui.PopupPanel.Border.$super;
+
+ $.extend(richfaces.ui.PopupPanel.Border.prototype, (function (options) {
+
+ return {
+
+ name: "RichFaces.ui.PopupPanel.Border",
+
+ destroy: function()
+ {
+ if (this.doingDrag)
+ {
+ jQuery(document).unbind( 'mousemove', this.doDrag);
+ jQuery(document).unbind( 'mouseup', this.endDrag);
+ }
+
+ jQuery(this.id).unbind( 'mousedown', this.startDrag);
+ this.modalPanel=null;
+ },
+
+ show: function() {
+ jQuery(this.id).show();
+ },
+
+ hide: function() {
+ jQuery(this.id).hide();
+ },
+
+ startDrag: function(event) {
+ var border = event.data.border;
+ border.doingDrag = true;
+
+ border.dragX = event.clientX;
+ border.dragY = event.clientY;
+ jQuery(document).bind( 'mousemove',{border:border}, border.doDrag);
+ jQuery(document).bind( 'mouseup',{border:border}, border.endDrag);
+
+ //var eCursorDiv = jQuery(border.modalPanel.cDiv);
+ //jQuery(eCursorDiv).css('cursor', jQuery(border.id).css('cursor'));
+ //jQuery(eCursorDiv).css('zIndex', 10);
+
+ border.modalPanel.startDrag(border);
+
+ border.onselectStartHandler = document.onselectstart;
+ document.onselectstart = function() { return false; }
+ },
+
+ getWindowSize : function() {
+ var myWidth = 0, myHeight = 0;
+ if( typeof( window.innerWidth ) == 'number' ) {
+ myWidth = window.innerWidth;
+ myHeight = window.innerHeight;
+ } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
+ myWidth = document.documentElement.clientWidth;
+ myHeight = document.documentElement.clientHeight;
+ } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
+ myWidth = document.body.clientWidth;
+ myHeight = document.body.clientHeight;
+ }
+ return {"width":myWidth,"height":myHeight};
+ },
+
+ doDrag: function(event) {
+ var border = event.data.border;
+ if (!border.doingDrag) {
+ return ;
+ }
+
+ var evtX = event.clientX;
+ var evtY = event.clientY;
+
+ var winSize = border.getWindowSize();
+
+ if (evtX < 0) {
+ evtX = 0;
+ } else if (evtX >= winSize.width) {
+ evtX = winSize.width - 1;
+ }
+
+ if (evtY < 0) {
+ evtY = 0;
+ } else if (evtY >= winSize.height) {
+ evtY = winSize.height - 1;
+ }
+
+ var dx = evtX - border.dragX;
+ var dy = evtY - border.dragY;
+
+ if (dx != 0 || dy != 0) {
+
+ var id = border.id;
+
+ var diff = border.sizer.prototype.doDiff(dx, dy);//TODO
+ var doResize;
+
+ var element = jQuery(border.modalPanel.cdiv);
+
+ if (diff.deltaWidth || diff.deltaHeight) {
+ doResize = border.modalPanel.invokeEvent("resize",event,null,element);
+ } else if (diff.deltaX || diff.deltaY) {
+ doResize = border.modalPanel.invokeEvent("move",event,null,element);
+ }
+
+ var vetoes;
+
+ if (doResize) {
+ vetoes = border.modalPanel.doResizeOrMove(diff);
+ }
+
+ if(vetoes){
+ if (!vetoes.x) {
+ border.dragX = evtX;
+ } else {
+ if (!diff.deltaX) {
+ border.dragX -= vetoes.vx || 0;
+ } else {
+ border.dragX += vetoes.vx || 0;
+ }
+ }
+
+ if (!vetoes.y) {
+ border.dragY = evtY;
+ } else {
+ if (!diff.deltaY) {
+ border.dragY -= vetoes.vy || 0;
+ } else {
+ border.dragY += vetoes.vy || 0;
+ }
+ }
+ }
+ }
+ },
+
+ endDrag: function(event) {
+ var border = event.data.border;
+ border.doingDrag = undefined;
+
+ jQuery(document).unbind( 'mousemove', border.doDrag);
+ jQuery(document).unbind( 'mouseup', border.endDrag);
+
+ border.modalPanel.endDrag(border);
+
+ border.modalPanel.doResizeOrMove(richfaces.ui.PopupPanel.Sizer.Diff.EMPTY);
+
+ document.onselectstart = border.onselectStartHandler;
+ border.onselectStartHandler = null;
+ },
+
+ doPosition: function() {
+ this.sizer.prototype.doPosition(this.modalPanel, jQuery(this.id)); //TODO remove prototype
+ }
+ }
+
+ })());
+
+})(jQuery, window.RichFaces);
\ No newline at end of file
14 years, 6 months
JBoss Rich Faces SVN: r18006 - root/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/script.
by richfaces-svn-commits@lists.jboss.org
Author: amarkhel
Date: 2010-07-13 14:28:03 -0400 (Tue, 13 Jul 2010)
New Revision: 18006
Added:
root/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/script/popupPanel.js
Log:
Added: root/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/script/popupPanel.js
===================================================================
--- root/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/script/popupPanel.js (rev 0)
+++ root/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/script/popupPanel.js 2010-07-13 18:28:03 UTC (rev 18006)
@@ -0,0 +1,699 @@
+(function ($, richfaces) {
+
+ richfaces.ui = richfaces.ui || {};
+ var selectionEventHandler = function(event){
+ event.stopPropagation();
+ event.preventDefault();
+ };
+
+ var disableSelection = function (element)
+ {
+ if (typeof element.onselectstart!="undefined") //IE
+ {
+ jQuery(element).bind( 'selectstart', selectionEventHandler);
+ }
+ else //All other (ie: Opera)
+ {
+ jQuery(element).bind( 'mousedown', selectionEventHandler);
+ }
+ }
+
+ var enableSelection = function (element)
+ {
+ if (typeof element.onselectstart!="undefined") //IE
+ {
+ jQuery(element).unbind( 'selectstart', selectionEventHandler);
+ }
+ else if (typeof element.style.MozUserSelect!="undefined") //Firefox
+ {
+ jQuery(element).css('MozUserSelect','');
+ }
+ else //All other (ie: Opera)
+ {
+ jQuery(element).unbind( 'mousedown', selectionEventHandler);
+ }
+ }
+
+ richfaces.ui.PopupPanel = function(id, options) {
+
+ $super.constructor.call(this,id);
+ this.markerId = id;
+ $p.attachToDom.call(this, id);
+ id = "#" + id;
+ this.options = options;
+
+ this.id = $(id);
+ this.minWidth = this.getMinimumSize(this.options.minWidth);
+ this.minHeight = this.getMinimumSize(this.options.minHeight);
+ this.maxWidth = this.options.maxWidth;
+ this.maxHeight = this.options.maxHeight;
+ this.options = options;
+
+ this.baseZIndex = this.options.zindex ? this.options.zindex : 100;
+
+ this.div = id;
+ this.cdiv = id + "_container";
+ this.contentDiv = id + "_content";
+ this.shadowDiv = id + "_shadow";
+ this.scrollerDiv = id + "_content_scroller"
+
+ this.borders = new Array();
+
+ if (this.options.resizeable) {
+ this.borders.push(new richfaces.ui.PopupPanel.Border(id + "ResizerN", this, "N-resize", richfaces.ui.PopupPanel.Sizer.N));
+ this.borders.push(new richfaces.ui.PopupPanel.Border(id + "ResizerE", this, "E-resize", richfaces.ui.PopupPanel.Sizer.E));
+ this.borders.push(new richfaces.ui.PopupPanel.Border(id + "ResizerS", this, "S-resize", richfaces.ui.PopupPanel.Sizer.S));
+ this.borders.push(new richfaces.ui.PopupPanel.Border(id + "ResizerW", this, "W-resize", richfaces.ui.PopupPanel.Sizer.W));
+
+ this.borders.push(new richfaces.ui.PopupPanel.Border(id + "ResizerNW", this, "NW-resize", richfaces.ui.PopupPanel.Sizer.NW));
+ this.borders.push(new richfaces.ui.PopupPanel.Border(id + "ResizerNE", this, "NE-resize", richfaces.ui.PopupPanel.Sizer.NE));
+ this.borders.push(new richfaces.ui.PopupPanel.Border(id + "ResizerSE", this, "SE-resize", richfaces.ui.PopupPanel.Sizer.SE));
+ this.borders.push(new richfaces.ui.PopupPanel.Border(id + "ResizerSW", this, "SW-resize", richfaces.ui.PopupPanel.Sizer.SW));
+ }
+
+ if (this.options.moveable && $(id + "_header")) {
+ this.header = new richfaces.ui.PopupPanel.Border(id + "_header", this, "move", richfaces.ui.PopupPanel.Sizer.Header);
+ } else{
+ $(id + "_header").css('cursor', 'default');
+ }
+
+ };
+
+ var $super = richfaces.BaseComponent.extend(richfaces.BaseComponent, richfaces.ui.PopupPanel);
+ var $p = richfaces.BaseComponent.extend(richfaces.BaseComponent,richfaces.ui.PopupPanel, {});
+ var $super = richfaces.ui.PopupPanel.$super;
+ $.extend(richfaces.ui.PopupPanel.prototype, (function (options) {
+
+ return {
+
+ name: "RichFaces.ui.PopupPanel",
+ saveInputValues: function(element) {
+ /* Fix for RF-3856 - Checkboxes in modal panel does not hold their states after modal was closed and opened again */
+ if ($.browser.msie /* reproducible for checkbox/radio in IE6, radio in IE 7/8 beta 2 */) {
+ $('input[type=checkbox], input[type=radio]', element).each(function(index) {
+ $(this).defaultChecked = $(this).checked;
+ });
+ }
+ },
+
+ width: function() {
+ return this.getContentElement()[0].clientWidth;//TODO
+ },
+
+ height: function() {
+ return this.getContentElement()[0].clientHeight;//TODO
+ },
+
+ getLeft : function (){
+ return $(this.cdiv).css('left');
+ },
+
+ getTop : function (){
+ return $(this.cdiv).css('top');
+ },
+
+ getInitialSize : function(){
+ if(this.options.autosized){
+ return 15;
+ } else{
+ return $(this.div + "_header_content").height();
+ }
+ },
+
+ getContentElement: function() {
+ if (!this._contentElement) {
+ this._contentElement = $(this.cdiv);
+ }
+
+ return this._contentElement;
+ },
+ getSizeElement : function() {
+ return document.body;
+ },
+
+ getMinimumSize : function(size) {
+ return Math.max(size, 2*this.getInitialSize() + 2);
+ },
+ destroy: function() {
+
+ this._contentElement = null;
+
+ this.parent = null;
+ if (this.header) {
+ this.header.destroy();
+ this.header=null;
+ }
+
+ for (var k = 0; k < this.borders.length; k++ ) {
+ this.borders[k].destroy();
+ }
+ this.borders = null;
+
+ if (this.domReattached) {
+ var element = this.id;
+ var parent = $(element).parent();
+ if (parent) {
+ parent.remove(element);
+ }
+ }
+ this.markerId = null;
+ this.options = null;
+
+ this.id = null;
+
+ this.div = null;
+ this.cdiv = null;
+ this.contentDiv = null;
+ this.shadowDiv = null;
+ this.scrollerDiv = null;
+ this.userOptions = null;
+ this.eIframe= null;
+
+ },
+
+ initIframe : function() {
+ if (this.contentWindow) {
+ $(this.contentWindow.document.body).css("margin", "0px 0px 0px 0px");
+ } else {
+ //TODO opera etc.
+
+ }
+
+ if("transparent" == $(document.body).css("background-color")) {
+ $(this).css('filter', "alpha(opacity=0)");
+ $(this).css('opacity', "0");
+ }
+ },
+
+ setLeft: function(pos) {
+ if(!isNaN(pos)){
+ $(this.cdiv).css('left', pos + "px");
+ var depth = this.options.shadowDepth ? this.options.shadowDepth : 2;
+ $(this.shadowDiv).css('left', pos + depth + "px");
+ }
+ },
+
+ setTop: function(pos) {
+ if(!isNaN(pos)){
+ $(this.cdiv).css('top', pos + "px");
+ var depth = this.options.shadowDepth ? this.options.shadowDepth : 2;
+ $(this.shadowDiv).css('top', pos + depth +"px");
+ }
+ },
+
+ show: function(event, opts) {
+ if(!this.shown && this.invokeEvent("beforeshow",event,null,element)) {
+
+ var element = this.id;
+
+ if (!this.domReattached) {
+ this.parent = $(element).parent();
+
+ var domElementAttachment;
+ if (opts) {
+ domElementAttachment = opts.domElementAttachment;
+ }
+
+ if (!domElementAttachment) {
+ domElementAttachment = this.options.domElementAttachment;
+ }
+
+ var newParent;
+ if ('parent' == domElementAttachment) {
+ newParent = this.parent;
+ } else if ('form' == domElementAttachment) {
+ newParent = this.findForm(element) || document.body;
+ } else {
+ //default - body
+ newParent = document.body;
+ }
+
+ if (newParent != this.parent) {
+ this.saveInputValues(element);
+ element.insertBefore(newParent.firstChild);
+ this.domReattached = true;
+ } else {
+ $(this.parent).show();
+ }
+ }
+
+ var forms = $("form", element);
+
+ if (this.options.keepVisualState && forms) {
+ for (var i = 0; i < forms.length; i++) {
+ var popup = this;
+ $(forms[i]).bind( "submit", {popup:popup}, this.setStateInput);
+ }
+ }
+
+
+
+ var options = {};
+ this.userOptions = {};
+ if (!element.mpSet) {
+ $.extend(options, this.options);
+ }
+
+ if (opts) {
+ $.extend(options, opts);
+ $.extend(this.userOptions, opts);
+ }
+
+ this.currentMinHeight = this.getMinimumSize((options.minHeight || options.minHeight == 0) ? options.minHeight : this.minHeight);
+ this.currentMinWidth = this.getMinimumSize((options.minWidth || options.minWidth == 0) ? options.minWidth : this.minWidth);
+
+ var eContentElt = this.getContentElement();
+
+ if (!this.options.autosized) {
+ if (options.width && options.width == -1)
+ options.width = 600;
+ if (options.height && options.height == -1)
+ options.height = 400;
+ } else{
+ //options.width = $(this.div+"_headerSpan").width() +20;
+ }
+
+ if (options.width && options.width != -1) {
+ if (this.currentMinWidth > options.width) {
+ options.width = this.currentMinWidth;
+ }
+ if (options.width > this.maxWidth) {
+ options.width = this.maxWidth;
+ }
+ $(eContentElt).css('width', options.width + (/px/.test(options.width) ? '' : 'px'));
+ $(this.shadowDiv).css('width', options.width + 4 + (/px/.test(options.width) ? '' : 'px'));
+ $(this.scrollerDiv).css('width', options.width + (/px/.test(options.width) ? '' : 'px'));
+
+
+ }
+
+ if (options.height && options.height != -1) {
+ if (this.currentMinHeight > options.height) {
+ options.height = this.currentMinHeight;
+ }
+ if (options.height > this.maxHeight) {
+ options.height = this.maxHeight;
+ }
+ $(eContentElt).css('height', options.height + (/px/.test(options.height) ? '' : 'px'));
+ $(this.shadowDiv).css('height', options.height + 4 + (/px/.test(options.height) ? '' : 'px'));
+ var headerHeight = $(this.div +"_header")[0].clientHeight;
+ $(this.scrollerDiv).css('height', options.height - headerHeight + (/px/.test(options.height) ? '' : 'px'));
+
+
+ }
+ var eIframe;
+ if (this.options.overlapEmbedObjects && !this.iframe) {
+ this.iframe = this.markerId + "IFrame";
+ $("<iframe src=\"javascript:''\" frameborder=\"0\" scrolling=\"no\" id=\"" + this.iframe + "\" " +
+ "class=\"mp-iframe\" style=\"width:" +this.options.width + "px; height:" + this.options.height + "px;\">" +
+ "</iframe>").insertBefore($(':first-child', $(this.cdiv))[0]);
+
+ eIframe = jQuery("#"+this.iframe);
+
+ $(eIframe).bind('load', this.initIframe);
+ this.eIframe = eIframe;
+ }
+ element.mpSet = true;
+
+ var eDiv = $(this.div);
+
+ if (options.left) {
+ var _left;
+ if (options.left != "auto") {
+ _left = parseInt(options.left, 10);
+ } else {
+ var cw = this.getSizeElement().clientWidth;
+ var _width = this.width();
+ if (cw >= _width) {
+ _left = (cw - _width) / 2;
+ } else {
+ _left = 0;
+ }
+ }
+
+ this.setLeft(Math.round(_left));
+ }
+
+ if (options.top) {
+ var _top;
+ if (options.top != "auto") {
+ _top = parseInt(options.top, 10);
+ } else {
+ var cw = this.getSizeElement().clientHeight;
+ var _height = this.height();
+ if (cw >= _height) {
+ _top = (cw - _height) / 2;
+ } else {
+ _top = 0;
+ }
+ }
+
+ this.setTop(Math.round(_top));
+ }
+
+ var opacity = options.shadowOpacity ? options.shadowOpacity : 0.1;
+ $(this.shadowDiv).css('opacity', opacity);
+ $(this.shadowDiv).css('filter ', 'alpha(opacity='+opacity*100 +');');
+ $(element).css('visibility', '');
+ $(element).css('display', 'block');
+ var event = {};
+ event.parameters = opts || {};
+ this.shown = true;
+ this.invokeEvent("show",event,null,element);
+ }
+ },
+
+ startDrag: function(border) {
+ for (var k = 0; k < this.borders.length; k++ ) {
+ this.borders[k].hide();
+ }
+ disableSelection(document.body);
+ },
+
+ endDrag: function(border) {
+ for (var k = 0; k < this.borders.length; k++ ) {
+ this.borders[k].show();
+ this.borders[k].doPosition();
+ }
+ enableSelection(document.body);
+ },
+
+ hide: function(event, opts) {
+ var element = this.id;
+ if (this.shown && this.invokeEvent("beforehide",event,null,element)) {
+
+ this.currentMinHeight = undefined;
+ this.currentMinWidth = undefined;
+
+ $(this.id).hide();
+
+ if (this.parent) {
+ if (this.domReattached) {
+ this.saveInputValues(element);
+
+ this.parent.append(element);
+
+ this.domReattached = false;
+ } else {
+ $(this.parent).hide();
+ }
+ }
+
+ var event = {};
+ event.parameters = opts || {};
+ if (this.options && this.options.onhide) {
+ this.options.onhide(event);
+ }
+
+ var forms = $("form", element);
+ if (this.options.keepVisualState && forms) {
+ for (var i = 0; i < forms.length; i++) {
+ $(forms[i]).unbind( "submit", this.setStateInput);
+ }
+ }
+
+ this.shown = false;
+
+ }
+ },
+
+ getStyle: function(elt, name) {
+ return parseInt($(elt).css(name).replace("px", ""), 10);
+ },
+
+ doResizeOrMove: function(diff) {
+ var vetoes = {};
+ var shadowHash = {};
+ var cssHash = {};
+ var cssHashWH = {};
+ var shadowHashWH = {};
+ var contentHashWH = {};
+ var scrollerHashWH = {};
+
+ var vetoeChange = false;
+ var newSize;
+ var shadowDepth = this.options.shadowDepth? this.options.shadowDepth: 4;
+ var scrollerHeight = 22;
+ var scrollerWidth = 0;
+ var eContentElt = this.getContentElement();
+
+ newSize = this.getStyle(eContentElt, "width");
+
+ var oldSize = newSize;
+ newSize += diff.deltaWidth || 0;
+
+
+
+ if (newSize >= this.currentMinWidth || this.options.autosized) {
+ if (diff.deltaWidth) {
+ cssHashWH.width = newSize + 'px';
+ shadowHashWH.width = newSize + shadowDepth + 'px';
+ contentHashWH.width = newSize - scrollerWidth + 'px';
+ scrollerHashWH.width = newSize - scrollerWidth + 'px';
+ }
+ } else {
+ if (diff.deltaWidth) {
+ cssHashWH.width = this.currentMinWidth + 'px';
+ shadowHashWH.width = this.currentMinWidth + shadowDepth + 'px';
+ contentHashWH.width = this.currentMinWidth - scrollerWidth + 'px';
+ scrollerHashWH.width = this.currentMinWidth - scrollerWidth + 'px';
+ vetoes.vx = oldSize - this.currentMinWidth;
+ }
+
+ vetoes.x = true;
+ }
+
+ if (newSize >= this.options.maxWidth) {
+ if (diff.deltaWidth) {
+ cssHashWH.width = this.currentMaxWidth + 'px';
+ shadowHashWH.width = this.currentMaxWidth + shadowDepth + 'px';
+ contentHashWH.width = this.currentMaxWidth - scrollerWidth + 'px';
+ scrollerHashWH.width = this.currentMaxWidth - scrollerWidth + 'px';
+ vetoes.vx = oldSize - this.currentMaxWidth;
+ }
+
+ vetoes.x = true;
+ }
+
+ if (vetoes.vx && diff.deltaX) {
+ diff.deltaX = -vetoes.vx;
+ }
+
+ var eCdiv = $(this.cdiv);
+
+ if (diff.deltaX && (vetoes.vx || !vetoes.x)) {
+ if (vetoes.vx) {
+ diff.deltaX = vetoes.vx;
+ }
+ var newPos;
+
+ newPos = this.getStyle(eCdiv, "left");
+ newPos += diff.deltaX;
+ cssHash.left = newPos + 'px';
+
+ shadowHash.left = newPos + shadowDepth + "px";
+ }
+
+ newSize = this.getStyle(eContentElt, "height")
+
+ var oldSize = newSize;
+ newSize += diff.deltaHeight || 0;
+
+ if (newSize >= this.currentMinHeight || this.options.autosized) {
+ if (diff.deltaHeight) {
+ cssHashWH.height = newSize + 'px';
+ shadowHashWH.height = newSize + shadowDepth + 'px';
+ scrollerHashWH.height = newSize - scrollerHeight + 'px';
+ }
+ } else {
+ if (diff.deltaHeight) {
+ cssHashWH.height = this.currentMinHeight + 'px';
+ shadowHashWH.height = this.currentMinHeight + shadowDepth + 'px';
+ scrollerHashWH.height = this.currentMinHeight - scrollerHeight + 'px';
+ vetoes.vy = oldSize - this.currentMinHeight;
+ }
+
+ vetoes.y = true;
+ }
+
+ if (newSize >= this.options.maxHeight) {
+ if (diff.deltaHeight) {
+ cssHashWH.height = this.currentMaxHeight + 'px';
+ shadowHashWH.height = this.currentMaxHeight + shadowDepth + 'px';
+ scrollerHashWH.height = this.currentMaxHeight - scrollerHeight + 'px';
+ vetoes.vy = oldSize - this.currentMaxHeight;
+ }
+
+ vetoes.y = true;
+ }
+
+ if (vetoes.vy && diff.deltaY) {
+ diff.deltaY = -vetoes.vy;
+ }
+
+ if (diff.deltaY && (vetoes.vy || !vetoes.y)) {
+ if (vetoes.vy) {
+ diff.deltaY = vetoes.vy;
+ }
+
+ }
+ if (diff.deltaY && (vetoes.vy || !vetoes.y)) {
+ if (vetoes.vy) {
+ diff.deltaY = vetoes.vy;
+ }
+ var newPos;
+
+ newPos = this.getStyle(eCdiv, "top");
+ newPos += diff.deltaY;
+ cssHash.top = newPos + 'px';
+ shadowHash.top = newPos + shadowDepth + "px";
+ }
+ $(eContentElt).css(cssHashWH);
+ $(this.scrollerDiv).css(scrollerHashWH);
+ if(this.eIframe)$(this.eIframe).css(scrollerHashWH);
+ $(this.shadowDiv).css(shadowHashWH);
+
+ $(eCdiv).css(cssHash);
+ $(this.shadowDiv).css(shadowHash);
+ //if(this.eIframe)$(this.eIframe).css(cssHash);
+ $.extend(this.userOptions, cssHash);
+ $.extend(this.userOptions, cssHashWH);
+ var w = this.width();
+ var h = this.height();
+
+ this.reductionData = null;
+
+ if (w <= 2*this.getInitialSize()) {
+ this.reductionData = {};
+ this.reductionData.w = w;
+ }
+
+ if (h <= 2*this.getInitialSize()) {
+ if (!this.reductionData) {
+ this.reductionData = {};
+ }
+
+ this.reductionData.h = h;
+ }
+
+ if (this.header) {
+ this.header.doPosition();
+ }
+
+ return vetoes;
+ },
+
+ setSize : function (width, height){
+ var w = width - this.width() ;
+ var h = height -this.height();
+ var diff = new richfaces.ui.PopupPanel.Sizer.Diff(0,0, w, h);
+ this.doResizeOrMove(diff);
+ },
+
+ moveTo : function (top, left){
+ var shadowDepth = this.options.shadowDepth? this.options.shadowDepth: 4;
+ $(this.cdiv).css('top', top);
+ $(this.cdiv).css('left', left);
+ $(this.shadowDiv).css('top', top + shadowDepth);
+ $(this.shadowDiv).css('left', left + shadowDepth);
+ },
+
+ move : function (dx, dy){
+ var diff = new richfaces.ui.PopupPanel.Sizer.Diff(dx,dy, 0, 0);
+ this.doResizeOrMove(diff);
+ },
+
+ resize : function (dx, dy){
+ var diff = new richfaces.ui.PopupPanel.Sizer.Diff(0,0, dx, dy);
+ this.doResizeOrMove(diff);
+ },
+
+ findForm: function(elt) {
+ var target = elt;
+ while (target) {
+ if (!target.tagName /* document node doesn't have tagName */
+ || target.tagName.toLowerCase() != "form") {
+
+ target = $(target).parent();
+ } else {
+ break;
+ }
+ }
+
+ return target;
+ },
+
+ setStateInput: function(event) {
+ // Concret input but not entire form is a target element for onsubmit in FF
+ var popup = event.data.popup;
+ target = $(popup.findForm(event.currentTarget));
+
+ var input = document.createElement("input");
+ input.type = "hidden";
+ input.id = popup.markerId + "OpenedState";
+ input.name = popup.markerId + "OpenedState";
+ input.value = popup.shown ? "true" : "false";
+ target.append(input);
+
+ $.each(popup.userOptions, function(key, value) {
+ input = document.createElement("input");
+ input.type = "hidden";
+ input.id = popup.markerId + "StateOption_" + key;
+ input.name = popup.markerId + "StateOption_" + key;
+ input.value = value;
+ target.append(input);
+ });
+
+ return true;
+ },
+
+ invokeEvent: function(eventName, event, value, element) {
+
+ var eventFunction = this.options['on'+eventName];
+ var result;
+
+ if (eventFunction) {
+ var eventObj;
+ if (event) {
+ eventObj = event;
+ }
+ else if(document.createEventObject) {
+ eventObj = document.createEventObject();
+ }
+ else if( document.createEvent ) {
+ eventObj = document.createEvent('Events');
+ eventObj.initEvent( eventName, true, false );
+ }
+
+ eventObj.rich = {component:this};
+ eventObj.rich.value = value;
+
+ try {
+ result = eventFunction.call(element, eventObj);
+ }
+ catch (e) { LOG.warn("Exception: "+e.Message + "\n[on"+eventName + "]"); }
+ }
+
+ if (result!=false) {
+ result = true;
+ }
+ return result;
+ }
+
+
+ }
+
+ })());
+ $.extend(richfaces.ui.PopupPanel, {
+
+ showPopupPanel : function (id, opts, event) {
+
+ $(document).ready(richfaces.$(id).show());
+ },
+
+ hidePopupPanel : function (id, opts, event) {
+ $(document).ready(richfaces.$(id).hide());
+ }
+ });
+
+})(jQuery, window.RichFaces);
14 years, 6 months
JBoss Rich Faces SVN: r18004 - in root/ui/output/trunk/panels/ui/src: main/java/org/richfaces/renderkit/html and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: amarkhel
Date: 2010-07-13 14:25:47 -0400 (Tue, 13 Jul 2010)
New Revision: 18004
Modified:
root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/component/UIPopupPanel.java
root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/renderkit/html/PopupPanelBaseRenderer.java
root/ui/output/trunk/panels/ui/src/main/templates/popupPanel.template.xml
root/ui/output/trunk/panels/ui/src/test/resources/panelTest.xhtml
root/ui/output/trunk/panels/ui/src/test/resources/popupPanelText.xhtml
Log:
Modified: root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/component/UIPopupPanel.java
===================================================================
--- root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/component/UIPopupPanel.java 2010-07-13 18:19:36 UTC (rev 18003)
+++ root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/component/UIPopupPanel.java 2010-07-13 18:25:47 UTC (rev 18004)
@@ -41,7 +41,7 @@
public static final String COMPONENT_FAMILY = "org.richfaces.PopupPanel";
protected enum PropertyKeys {
- width, height, zIndex, minHeight, minWidth, maxHeight, maxWidth, top, left, moveable, autosized, modal, domElementAttachment, controlsClass, show, headerClass, keepVisualState, overlapEmbedObjects, resizeable, shadowDepth, shadowOpacity, style, styleClass, visualOptions
+ width, height, zIndex, trimOverlayedElements, minHeight, minWidth, maxHeight, maxWidth, top, left, moveable, autosized, modal, domElementAttachment, controlsClass, show, headerClass, keepVisualState, overlapEmbedObjects, resizeable, shadowDepth, shadowOpacity, style, styleClass, visualOptions
}
public Map<String, Object> getHandledVisualOptions() {
@@ -188,21 +188,24 @@
}
public void setResizeable(boolean resizeable) {
- getStateHelper().put(PropertyKeys.resizeable, resizeable);
- }
+ getStateHelper().put(PropertyKeys.resizeable, resizeable);
+ }
- /*
- * public boolean isTrimOverlayedElements() { return (Boolean)
- * getStateHelper().eval(PropertyKeys.trimOverlayedElements, false); }
- *
- * public void setTrimOverlayedElements(boolean trimOverlayedElements) {
- * getStateHelper().put(PropertyKeys.trimOverlayedElements, trimOverlayedElements); }
- */
+ public boolean isTrimOverlayedElements() {
+ return (Boolean) getStateHelper().eval(
+ PropertyKeys.trimOverlayedElements, false);
+ }
- public String getDomElementAttachment() {
- return (String) getStateHelper().eval(PropertyKeys.domElementAttachment);
- }
+ public void setTrimOverlayedElements(boolean trimOverlayedElements) {
+ getStateHelper().put(PropertyKeys.trimOverlayedElements,
+ trimOverlayedElements);
+ }
+ public String getDomElementAttachment() {
+ return (String) getStateHelper()
+ .eval(PropertyKeys.domElementAttachment);
+ }
+
public void setDomElementAttachment(String domElementAttachment) {
getStateHelper().put(PropertyKeys.domElementAttachment, domElementAttachment);
}
Modified: root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/renderkit/html/PopupPanelBaseRenderer.java
===================================================================
--- root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/renderkit/html/PopupPanelBaseRenderer.java 2010-07-13 18:19:36 UTC (rev 18003)
+++ root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/renderkit/html/PopupPanelBaseRenderer.java 2010-07-13 18:25:47 UTC (rev 18004)
@@ -147,6 +147,13 @@
return result.toString();
}
+ public String getStyleIfTrimmed(UIComponent panel){
+ if(panel.getAttributes().get("trimOverlayedElements").equals(Boolean.TRUE)) {
+ return "position: relative, z-index : 0";
+ }
+ return "";
+ }
+
private void writeOption(StringBuilder builder, String attribbute, Object value, UIComponent component,
boolean isString) {
if (component.getAttributes().get(attribbute) != null) {
Modified: root/ui/output/trunk/panels/ui/src/main/templates/popupPanel.template.xml
===================================================================
--- root/ui/output/trunk/panels/ui/src/main/templates/popupPanel.template.xml 2010-07-13 18:19:36 UTC (rev 18003)
+++ root/ui/output/trunk/panels/ui/src/main/templates/popupPanel.template.xml 2010-07-13 18:25:47 UTC (rev 18004)
@@ -16,7 +16,6 @@
<cc:implementation>
<cdk:call expression="checkOptions(facesContext, component)" />
<div id="#{clientId}" style="visibility: hidden;">
- <button class="mp-button" id="#{clientId}FirstHref"></button>
<c:if test="#{component.attributes['modal']}">
<div id="#{clientId}_shade" onclick="#{component.attributes['onmaskclick']}"
ondblclick="#{component.attributes['onmaskdblclick']}"
@@ -29,27 +28,22 @@
</c:if>
<div id="#{clientId}_shadow" class="mp_shadow"/>
- <div id="#{clientId}_container" cdk:passThroughWithExclusions="id,style,class,styleClass" class="mp_container #{component.attributes['styleClass']}">
- <div id="#{clientId}_header" class="mp_header #{component.attributes['headerClass']}" >
+ <div id="#{clientId}_container" cdk:passThruWithExclusions="id,style,class,styleClass" class="mp_container #{component.attributes['styleClass']}">
+
<c:if test="#{component.getFacet('header')!=null and component.getFacet('header').rendered}">
+ <div id="#{clientId}_header" class="mp_header #{component.attributes['headerClass']}" >
<div id="#{clientId}_header_content" class="mp_header_content">
- <c:if test="#{component.attributes['autosized']}">
- <span id="#{clientId}_headerSpan">
<cdk:call expression="renderHeaderFacet(facesContext, component)"/>
- </span>
- </c:if>
- <c:if test="#{!component.attributes['autosized']}">
- <cdk:call expression="renderHeaderFacet(facesContext, component)"/>
- </c:if>
</div>
+ </div>
</c:if>
<c:if test="#{component.getFacet('controls')!=null and component.getFacet('controls').rendered}">
<div id="#{clientId}_header_controls" class="mp_header_controls #{component.attributes['controlsClass']}">
<cdk:call expression="renderControlsFacet(facesContext, component)"/>
</div>
</c:if>
- </div>
- <div id="#{clientId}_content_scroller" class="mp_content_scroller #{component.attributes['scrollerClass']}">
+
+ <div id="#{clientId}_content_scroller" style="#{getStyleIfTrimmed(component)}" class="mp_content_scroller}">
<div id="#{clientId}_content" class="mp_content" style="#{component.attributes['style']}">
<cdk:call expression="renderChildren(facesContext, component)"/>
</div>
@@ -68,9 +62,6 @@
</div>
-
-
-<button class="mp-button" id="#{clientId}LastHref"></button>
</div>
<cdk:object type="java.lang.String" name="script" value="#{buildScript(facesContext, component)}" />
<cdk:object type="java.lang.String" name="showScript" value="#{buildShowScript(facesContext, component)}" />
Modified: root/ui/output/trunk/panels/ui/src/test/resources/panelTest.xhtml
===================================================================
--- root/ui/output/trunk/panels/ui/src/test/resources/panelTest.xhtml 2010-07-13 18:19:36 UTC (rev 18003)
+++ root/ui/output/trunk/panels/ui/src/test/resources/panelTest.xhtml 2010-07-13 18:25:47 UTC (rev 18004)
@@ -7,92 +7,54 @@
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:panel="http://richfaces.org/panels"
xmlns:rich="http://richfaces.org/rich">
-<!--
-JBoss, Home of Professional Open Source
-Copyright ${year}, Red Hat, Inc. and individual contributors
-by the @authors tag. See the copyright.txt in the distribution for a
-full listing of individual contributors.
-
-This is free software; you can redistribute it and/or modify it
-under the terms of the GNU Lesser General Public License as
-published by the Free Software Foundation; either version 2.1 of
-the License, or (at your option) any later version.
-
-
-This software is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-Lesser General Public License for more details.
-
-
-You should have received a copy of the GNU Lesser General Public
-License along with this software; if not, write to the Free
-Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-02110-1301 USA, or see the FSF site: http://www.fsf.org.
--->
<h:head>
<title>Richfaces ExtendedDataTable Test</title>
</h:head>
<h:body>
- <panel:panel styleClass="panel" id="panelWithFacet">
- <f:facet name="header">
- Write your own custom rich components with built-in AJAX support
- </f:facet>
- The CDK includes a code-generation facility and a
- templating facility using a JSP-like syntax. These capabilities help
- to avoid a routine process of a component creation. The component factory
- works like a well-oiled machine allowing the creation of first-class
- rich components with built-in Ajax functionality even more easily than
- the creation of simpler components by means of the traditional coding
- approach.
- </panel:panel>
- <panel:panel id="simplePanel" bodyClass="rich-laguna-panel-no-header">
- RichFaces is a library for adding rich user interface features to JSF
- applications. It extends the Ajax4jsf framework to include a large
- (and growing) set of powerful rich AJAX-enabled components that come
- with extensive skins support.
- </panel:panel>
- <panel:panel id="simplePanelWithTextHeader" header="rich-laguna-panel-no-header">
- RichFaces is a library for adding rich user interface features to JSF
- applications. It extends the Ajax4jsf framework to include a large
- (and growing) set of powerful rich AJAX-enabled components that come
- with extensive skins support.
- </panel:panel>
- <panel:panel id="nestedPanelContainer" style="padding:0" headerClass="outpanelHeader">
- <f:facet name="header">
- ||||
- </f:facet>
- <h2 align="center"><h:outputText value="Benefits of Using Ajax4jsf" /></h2>
- <h:panelGrid columns="2" columnClasses="gridContent">
- <panel:panel id="nestedPanel1" bodyClass="inpanelBody">
- <f:facet name="header">
- For Application Developers
- </f:facet>
- <ul>
- <li>Production quality Open Source</li>
- <li>Does Open Source and has an Open Architecture</li>
- <li>Compatible with any JSF Implementation - MyFaces, JSF1.1, JSF1.2</li>
- <li>Allows to Ajaxify JSF application without writing Javascript</li>
- <li>Works with standard and third party components</li>
- <li>Adds the Ajax capability to existing non-Ajax components</li>
- </ul>
- </panel:panel>
- <panel:panel id="nestedPanel2" bodyClass="inpanelBody">
- <f:facet name="header" >
- For Component Developers
- </f:facet>
- <ul>
- <li>Ajax4jsf is Open Source and has an Open Architecture</li>
- <li>Gives an API to create components with built-in Ajax support</li>
- <li>Has a Component Development Kit for rapid development</li>
- <li>Allows to skin the look-n-feel using both CSS and set of skin-parameters</li>
- <li>Automatically generates the unit test-cases for developing components</li>
- <li>Allows to pack javascript code, images, css inside the final jar</li>
- </ul>
- </panel:panel>
- </h:panelGrid>
- </panel:panel>
+ <panel:popupPanel domElementAttachment="body"
+ visualOptions="{left:400px;}" moveable="true"
+ overlapEmbedObjects="true" keepVisualState="true"
+ onmaskclick="alert('1')" width="600" height="400" id="panel"
+ left="500px" top="300px">
+ <f:facet name="header">
+ Write your own custom rich components with built-in AJAX
+ </f:facet>
+ <h:form>
+ <h:panelGroup layout="block"
+ style="width:500px,height:400px;">
+ The CDK includes a code-generation facility and a
+ templating facility using a JSP-like syntax. These
+ capabilities help to avoid a routine process of a
+ component creation. The component factory works like
+ a well-oiled machine allowing the creation of
+ first-class rich components with built-in Ajax
+ functionality even more easily than the creation of
+ simpler components by means of the traditional
+ coding approach.
+
+
+ <h:inputText value="aaa" />
+ <a href="#"
+ onclick="RichFaces.$('panel').setSize(500, 300)" tabindex="0">
+ setSize
+ </a>
+ <a href="#"
+ onclick="RichFaces.$('panel').resize(20, 50)" tabindex="0">
+ resize
+ </a>
+ <a href="#"
+ onclick="RichFaces.$('panel').move(20, 50)" tabindex="0">
+ move
+ </a>
+
+ <a href="#"
+ onclick="RichFaces.$('panel').moveTo(20, 50)" tabindex="0">
+ moveTo
+ </a>
+ </h:panelGroup>
+ </h:form>
+ </panel:popupPanel>
</h:body>
</html>
Modified: root/ui/output/trunk/panels/ui/src/test/resources/popupPanelText.xhtml
===================================================================
--- root/ui/output/trunk/panels/ui/src/test/resources/popupPanelText.xhtml 2010-07-13 18:19:36 UTC (rev 18003)
+++ root/ui/output/trunk/panels/ui/src/test/resources/popupPanelText.xhtml 2010-07-13 18:25:47 UTC (rev 18004)
@@ -1,82 +1,58 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:fn="http://java.sun.com/jsp/jstl/functions"
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:panel="http://richfaces.org/panels"
xmlns:rich="http://richfaces.org/rich">
-<!--
-JBoss, Home of Professional Open Source
-Copyright ${year}, Red Hat, Inc. and individual contributors
-by the @authors tag. See the copyright.txt in the distribution for a
-full listing of individual contributors.
-
-This is free software; you can redistribute it and/or modify it
-under the terms of the GNU Lesser General Public License as
-published by the Free Software Foundation; either version 2.1 of
-the License, or (at your option) any later version.
-
-
-This software is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-Lesser General Public License for more details.
-
-
-You should have received a copy of the GNU Lesser General Public
-License along with this software; if not, write to the Free
-Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-02110-1301 USA, or see the FSF site: http://www.fsf.org.
--->
<h:head>
<title>Richfaces ExtendedDataTable Test</title>
</h:head>
<h:body>
+ <panel:popupPanel domElementAttachment="body"
+ visualOptions="{left:400px;}" moveable="true"
+ overlapEmbedObjects="true" keepVisualState="true"
+ onmaskclick="alert('1')" width="600" height="400" id="panel"
+ left="500px" top="300px">
+ <f:facet name="header">
+ Write your own custom rich components with built-in AJAX
+ </f:facet>
+ <h:form>
+ <h:panelGroup layout="block"
+ style="width:500px,height:400px;">
+ The CDK includes a code-generation facility and a
+ templating facility using a JSP-like syntax. These
+ capabilities help to avoid a routine process of a
+ component creation. The component factory works like
+ a well-oiled machine allowing the creation of
+ first-class rich components with built-in Ajax
+ functionality even more easily than the creation of
+ simpler components by means of the traditional
+ coding approach.
- <panel:popupPanel domElementAttachment="body" visualOptions="{left:400px;}" moveable="true" overlapEmbedObjects="true" keepVisualState="true" onmaskclick="alert('1')" width="600" height="400" id="panel" left="500px" top="300px">
- <f:facet name="header">
- Write your own custom rich components with built-in AJAX
- </f:facet>
- <h:form>
- <h:panelGroup layout="block" style="width:500px,height:400px;">
- The CDK includes a code-generation facility and a
- templating facility using a JSP-like syntax. These capabilities help
- to avoid a routine process of a component creation. The component factory
- works like a well-oiled machine allowing the creation of first-class
- rich components with built-in Ajax functionality even more easily than
- the creation of simpler components by means of the traditional coding
- approach.
- <a4j:commandLink value="Hide">
-
- <rich:componentControl target="panel" operation="hide" event="click">
- </rich:componentControl>
- </a4j:commandLink>
+ <h:inputText value="aaa" />
+ <a href="#"
+ onclick="RichFaces.$('panel').setSize(500, 300)" tabindex="0">
+ setSize
+ </a>
+ <a href="#"
+ onclick="RichFaces.$('panel').resize(20, 50)" tabindex="0">
+ resize
+ </a>
+ <a href="#"
+ onclick="RichFaces.$('panel').move(20, 50)" tabindex="0">
+ move
+ </a>
-<h:inputText value="aaa"/>
-<a href="#" onclick="RichFaces.$('panel').setSize(500, 300)" tabindex="0">setSize
- </a>
- <a href="#" onclick="RichFaces.$('panel').resize(20, 50)" tabindex="0">resize
- </a>
- <a href="#" onclick="RichFaces.$('panel').move(20, 50)" tabindex="0">move
- </a>
-
- <a href="#" onclick="RichFaces.$('panel').moveTo(20, 50)" tabindex="0">moveTo
- </a>
- </h:panelGroup>
- </h:form>
- </panel:popupPanel>
-
- <a4j:commandLink value="Show">
-
- <rich:componentControl target="panel" operation="show" event="click">
- </rich:componentControl>
- </a4j:commandLink>
-
+ <a href="#"
+ onclick="RichFaces.$('panel').moveTo(20, 50)" tabindex="0">
+ moveTo
+ </a>
+ </h:panelGroup>
+ </h:form>
+ </panel:popupPanel>
</h:body>
-</html>
\ No newline at end of file
+</html>
14 years, 6 months