JBoss Rich Faces SVN: r5786 - trunk/samples/modalpanel-sample/src/main/webapp/pages.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-02-04 11:03:27 -0500 (Mon, 04 Feb 2008)
New Revision: 5786
Modified:
trunk/samples/modalpanel-sample/src/main/webapp/pages/index.jsp
Log:
http://jira.jboss.com/jira/browse/RF-2128
Modified: trunk/samples/modalpanel-sample/src/main/webapp/pages/index.jsp
===================================================================
--- trunk/samples/modalpanel-sample/src/main/webapp/pages/index.jsp 2008-02-04 16:03:22 UTC (rev 5785)
+++ trunk/samples/modalpanel-sample/src/main/webapp/pages/index.jsp 2008-02-04 16:03:27 UTC (rev 5786)
@@ -1,4 +1,5 @@
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+
<!-- DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" -->
@@ -147,7 +148,23 @@
<a href="javascript:Richfaces.showModalPanel(':_panel', {left: '120', top: 'auto'});">Show: left = 120; top = auto</a>
<a href="javascript:Richfaces.showModalPanel(':_panel', {top: 'auto', width: 800});">Show: width = 800; top = auto</a>
<a href="javascript:Richfaces.showModalPanel(':_panel', {width: 1});">Show: width = 1</a>
+ <a href="javascript:Richfaces.showModalPanel('eventInfoID');">Show autosized panel</a>
</f:verbatim>
+
+
+ <mp:modalPanel id="eventInfoID" autosized="true" minHeight="550" minWidth="400" moveable="true" style="overflow: true;">
+ <f:facet name="header">
+ <h:outputText value="Events..." />
+ </f:facet>
+
+ <f:facet name="controls">
+ <h:commandLink value="C" onclick="Richfaces.hideModalPanel('eventInfoID'); return false;" />
+ </f:facet>
+
+
+ <h:outputText value="Eventsaaaaaaaaaaaaaaaa ..." />
+
+ </mp:modalPanel>
</h:panelGrid>
<%--
16 years, 11 months
JBoss Rich Faces SVN: r5785 - in trunk/ui/modal-panel/src/main: resources/org/richfaces/renderkit/html/scripts and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-02-04 11:03:22 -0500 (Mon, 04 Feb 2008)
New Revision: 5785
Modified:
trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/css/modalPanel.xcss
trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js
trunk/ui/modal-panel/src/main/templates/org/richfaces/htmlModalPanel.jspx
Log:
http://jira.jboss.com/jira/browse/RF-2128
Modified: trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/css/modalPanel.xcss
===================================================================
--- trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/css/modalPanel.xcss 2008-02-04 16:01:33 UTC (rev 5784)
+++ trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/css/modalPanel.xcss 2008-02-04 16:03:22 UTC (rev 5785)
@@ -48,15 +48,11 @@
}
.dr-mpnl-pnl-a {
+ outline-style: none;
position: absolute;
left: -32000px;
}
- .rich-mp-content {
- height: 100%;
- width: 100%;
- }
-
</f:verbatim>
<u:selector name=".dr-mpnl-spacer, .dr-mpnl-resizer">
@@ -72,8 +68,6 @@
border-style: solid;
padding : 1px;
background-color: inherit;
- height: 100%;
- width: 100%;
}
.dr-mpnl-pnl-h{
Modified: trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js
===================================================================
--- trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js 2008-02-04 16:01:33 UTC (rev 5784)
+++ trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js 2008-02-04 16:03:22 UTC (rev 5785)
@@ -73,7 +73,7 @@
ModalPanel.Context = Class.create();
ModalPanel.Context.prototype = {
initialize: function(modalPanel) {
- this.cdiv = modalPanel.contentTable;
+ this.cdiv = modalPanel.contentDiv;
this.isPositionFixed = Richfaces.getComputedStyle(this.cdiv, "position") == "fixed";
},
@@ -125,7 +125,6 @@
this.cursorDiv = id + "CursorDiv";
this.cdiv = id + "CDiv";
this.contentDiv = id + "ContentDiv";
- this.contentTable = id + "ContentTable";
this.shadowDiv = id + "ShadowDiv";
this.context = new ModalPanel.Context(this);
@@ -354,54 +353,48 @@
}
},
- processAllFocusElements: function(root) {
+ processAllFocusElements: function(root, callback) {
if (root.focus &&
// Many not visible elements have focus method, we is had to avoid processing them.
/^a|input|select|button|textarea$/i.test(root.tagName) &&
!root.disabled && !/^hidden$/.test(root.type) &&
!/^none$/.test(root.style.display)) {
- this.execute(root);
+
+ callback.call(this, root);
} else {
- if (root.id && root.id==this.cdiv)
- this.inModalPanel = true;
- var child = root.firstChild;
- while (child) {
- this.processAllFocusElements(child);
- child = child.nextSibling;
+ if (root != this.id) {
+ var child = root.firstChild;
+ while (child) {
+ this.processAllFocusElements(child, callback);
+ child = child.nextSibling;
+ }
}
- if (root.id && root.id==this.cdiv)
- this.inModalPanel = false;
}
},
processTabindexes: function(input) {
- if (!this.inModalPanel) {
- if (!this.firstOutside)
- this.firstOutside = input;
- this.lastOutside = input;
- if (input.tabIndex) {
- input.prevTabIndex = input.tabIndex;
- }
- input.tabIndex = undefined;
- if (input.accesskey) {
- input.prevAccesskey = input.accesskey;
- }
- input.accesskey = undefined;
+ if (!this.firstOutside)
+ this.firstOutside = input;
+ this.lastOutside = input;
+ if (input.tabIndex) {
+ input.prevTabIndex = input.tabIndex;
}
+ input.tabIndex = undefined;
+ if (input.accesskey) {
+ input.prevAccesskey = input.accesskey;
+ }
+ input.accesskey = undefined;
},
restoreTabindexes: function(input) {
- if (!this.inModalPanel) {
- if (input.prevTabIndex)
- input.tabIndex = input.prevTabIndex;
- if (input.prevAccesskey)
- input.accesskey = input.prevAccesskey;
- }
+ if (input.prevTabIndex)
+ input.tabIndex = input.prevTabIndex;
+ if (input.prevAccesskey)
+ input.accesskey = input.prevAccesskey;
},
preventFocus: function() {
- this.execute = this.processTabindexes;
- this.processAllFocusElements(document);
+ this.processAllFocusElements(document, this.processTabindexes);
if (this.firstOutside) {
Event.observe(this.firstOutside, "focus", this.eventFirstOnfocus);
@@ -412,8 +405,7 @@
},
restoreFocus: function() {
- this.execute = this.restoreTabindexes;
- this.processAllFocusElements(document);
+ this.processAllFocusElements(document, this.restoreTabindexes);
if (this.firstOutside) {
Event.stopObserving(this.firstOutside, "focus", this.eventFirstOnfocus);
@@ -488,13 +480,13 @@
options.height = 200;
}
- var eContentTable = $(this.contentTable);
+ var eContentDiv = $(this.contentDiv);
if (options.width && options.width != -1) {
if (this.minWidth > options.width) {
options.width = this.minWidth;
}
- eContentTable.style.width = options.width + (/px/.test(options.width) ? '' : 'px');
+ eContentDiv.style.width = options.width + (/px/.test(options.width) ? '' : 'px');
}
if (options.height && options.height != -1) {
@@ -502,7 +494,7 @@
options.height = this.minHeight;
}
- eContentTable.style.height = options.height + (/px/.test(options.height) ? '' : 'px');
+ eContentDiv.style.height = options.height + (/px/.test(options.height) ? '' : 'px');
}
eCdiv.mpSet = true;
@@ -717,6 +709,10 @@
}
},
+ _getStyle: function(elt, name) {
+ return parseInt(elt.style[name].replace("px", ""), 10);
+ },
+
doResizeOrMove: function(diff) {
var vetoes = {};
var cssHash = {};
@@ -725,9 +721,9 @@
var vetoeChange = false;
var newSize;
- var eContentTable = $(this.contentTable);
+ var eContentDiv = $(this.contentDiv);
- newSize = Richfaces.getComputedStyleSize(eContentTable, "width");
+ newSize = this._getStyle(eContentDiv, "width");//Richfaces.getComputedStyleSize(eContentDiv, "width");
var oldSize = newSize;
newSize += diff.deltaWidth || 0;
@@ -758,12 +754,12 @@
}
var newPos;
- newPos = Richfaces.getComputedStyleSize(eCdiv, "left");
+ newPos = this._getStyle(eCdiv, "left");//Richfaces.getComputedStyleSize(eCdiv, "left");
newPos += diff.deltaX;
cssHash.left = newPos + 'px';
}
- newSize = Richfaces.getComputedStyleSize(eContentTable, "height");
+ newSize = this._getStyle(eContentDiv, "height")//;Richfaces.getComputedStyleSize(eContentDiv, "height");
var oldSize = newSize;
newSize += diff.deltaHeight || 0;
@@ -799,7 +795,7 @@
eCdiv.mpTop = newPos;
cssHash.top = newPos + 'px';
} else {
- newPos = Richfaces.getComputedStyleSize(eCdiv, "top");
+ newPos = this._getStyle(eCdiv, "top");//Richfaces.getComputedStyleSize(eCdiv, "top");
newPos += diff.deltaY;
cssHash.top = newPos + 'px';
}
@@ -807,7 +803,7 @@
Element.setStyle(eCdiv, cssHash);
- Element.setStyle(eContentTable, cssHashWH);
+ Element.setStyle(eContentDiv, cssHashWH);
this.correctShadowSizeEx();
Object.extend(this.userOptions, cssHash);
@@ -871,8 +867,8 @@
correctShadowSizeEx: function() {
var eShadowDiv = $(this.shadowDiv);
- var eContentTable = $(this.contentTable);
- if (!eShadowDiv || !eContentTable) {
+ var eContentDiv = $(this.contentDiv);
+ if (!eShadowDiv || !eContentDiv) {
return;
}
var eIframe = $(this.iframe);
@@ -884,8 +880,8 @@
dx = eShadowDiv.offsetWidth-eShadowDiv.clientWidth;
dy = eShadowDiv.offsetHeight-eShadowDiv.clientHeight;
}
- var w = eContentTable.offsetWidth;
- var h = eContentTable.offsetHeight;
+ var w = eContentDiv.offsetWidth;
+ var h = eContentDiv.offsetHeight;
eShadowDiv.style.width = (w-dx)+"px";
eShadowDiv.style.height = (h-dy)+"px";
Modified: trunk/ui/modal-panel/src/main/templates/org/richfaces/htmlModalPanel.jspx
===================================================================
--- trunk/ui/modal-panel/src/main/templates/org/richfaces/htmlModalPanel.jspx 2008-02-04 16:01:33 UTC (rev 5784)
+++ trunk/ui/modal-panel/src/main/templates/org/richfaces/htmlModalPanel.jspx 2008-02-04 16:03:22 UTC (rev 5785)
@@ -48,9 +48,10 @@
onmousedown="#{component.attributes['onmaskmousedown']}"
onmousemove="#{component.attributes['onmaskmousemove']}"
onmouseover="#{component.attributes['onmaskmouseover']}"
- onmouseout="#{component.attributes['onmaskmouseout']}" />
- <div class="dr-mpnl-mask-div rich-mpnl-mask-div" id="#{clientId}CursorDiv"
- style="filter: alpha(opacity=1); z-index: -200"></div>
+ onmouseout="#{component.attributes['onmaskmouseout']}">
+
+ <a href="#" class="dr-mpnl-pnl-a" id="#{clientId}FirstHref">_</a>
+ </div>
<div id="#{clientId}CDiv" class="dr-mpnl-panel rich-mpnl_panel" style="width: 1px; height: 1px; z-index: 2;">
@@ -80,15 +81,9 @@
<div id="#{clientId}ShadowDiv" class="dr-mpnl-shadow rich-mpnl-shadow"
style="#{component.shadowStyle}" >
</div>
- <table id="#{clientId}ContentTable" cellpadding="0" cellspacing="0" border="0"
- style="position: absolute; z-index: 2; width: #{component.minWidth}px; height: #{component.minHeight}px; #{component.attributes['style']};">
- <tbody>
- <tr>
- <td class="dr-mpnl-pnl">
- <div id="#{clientId}ContentDiv" style="overflow: hidden;" class="rich-mp-content">
+ <div id="#{clientId}ContentDiv" style="position: absolute; z-index: 2; overflow: hidden; width: #{component.minWidth}px; height: #{component.minHeight}px; #{component.attributes['style']}" class="dr-mpnl-pnl rich-mp-content">
- <a href="#" class="dr-mpnl-pnl-a" id="#{clientId}FirstHref" >_</a>
<table style="height: 100%; width: 100%;" border="0" cellpadding="0" cellspacing="0">
<jsp:scriptlet>
<![CDATA[if(component.getFacet("header")!=null && component.getFacet("header").isRendered()) {]]>
@@ -120,14 +115,18 @@
<f:call name="renderChildren" />
</vcp:body>
<f:clientid var="clientId"/>
- <a href="#" class="dr-mpnl-pnl-a" id="#{clientId}LastHref" >_</a>
</td>
</tr>
</table>
</div>
- </td></tr></tbody></table>
</div>
+ <div class="dr-mpnl-mask-div rich-mpnl-mask-div" id="#{clientId}CursorDiv"
+ style="filter: alpha(opacity=1); z-index: -200">
+
+ <a href="#" class="dr-mpnl-pnl-a" id="#{clientId}LastHref">_</a>
+ </div>
+
<script type="text/javascript">
new ModalPanel('#{clientId}',
{
16 years, 11 months
JBoss Rich Faces SVN: r5784 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: artdaw
Date: 2008-02-04 11:01:33 -0500 (Mon, 04 Feb 2008)
New Revision: 5784
Modified:
trunk/docs/userguide/en/src/main/docbook/included/dragIndicator.xml
Log:
http://jira.jboss.com/jira/browse/RF-2144 - info about <rich:dragIndicator>inside a form added
Modified: trunk/docs/userguide/en/src/main/docbook/included/dragIndicator.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/dragIndicator.xml 2008-02-04 15:54:41 UTC (rev 5783)
+++ trunk/docs/userguide/en/src/main/docbook/included/dragIndicator.xml 2008-02-04 16:01:33 UTC (rev 5784)
@@ -171,6 +171,14 @@
positioned over all the rest of page elements</para>
</section>
+ <note>
+ <para>
+ If you use <emphasis role="bold"><property><rich:dragIndicator></property></emphasis> inside a form
+ do not forget to use id like <property>"formId:indicatorID"</property>
+ defined in <emphasis role="bold"><property><rich:dragSupport></property></emphasis> indicator attribute.
+ </para>
+ </note>
+
</section>
<!--section>
16 years, 11 months
JBoss Rich Faces SVN: r5783 - in trunk/sandbox/ui/pickList/src/main: templates and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2008-02-04 10:54:41 -0500 (Mon, 04 Feb 2008)
New Revision: 5783
Modified:
trunk/sandbox/ui/pickList/src/main/resources/org/richfaces/renderkit/html/css/picklist.xcss
trunk/sandbox/ui/pickList/src/main/templates/htmlPickList.jspx
Log:
styles're corrected
Modified: trunk/sandbox/ui/pickList/src/main/resources/org/richfaces/renderkit/html/css/picklist.xcss
===================================================================
--- trunk/sandbox/ui/pickList/src/main/resources/org/richfaces/renderkit/html/css/picklist.xcss 2008-02-04 15:07:30 UTC (rev 5782)
+++ trunk/sandbox/ui/pickList/src/main/resources/org/richfaces/renderkit/html/css/picklist.xcss 2008-02-04 15:54:41 UTC (rev 5783)
@@ -13,16 +13,6 @@
overflow: auto;
}
-.rich-pickList-header-tab-cell, .rich-pickList-header-tab-cell-last {
- padding : 2px;
- border-style: solid;
- font-weight: normal;
- white-space: nowrap;
- background-repeat: repeat-x;
- border-top: 0px;
- border-left: 0px;
-}
-
.rich-pickList-internal-tab {
width:100%;
}
@@ -151,26 +141,6 @@
<u:style name="-moz-user-select" value="-moz-none" />
</u:selector>
- <u:selector name=".rich-pickList-header-tab-cell, .rich-pickList-header-tab-cell-last">
- <u:style name="background-image">
- <f:resource f:key="org.richfaces.renderkit.html.gradientimages.OrderingListHeaderGradient" />
- </u:style>
- <u:style name="background-color" skin="tabBackgroundColor" />
- <u:style name="color" skin="generalTextColor" />
- <u:style name="font-family" skin="headerFamilyFont" />
- <u:style name="font-size" skin="headerSizeFont" />
-
- <u:style name="border-right-width" skin="tableBorderWidth" />
- <u:style name="border-bottom-width" skin="tableBorderWidth" />
-
- <u:style name="border-right-color" skin="tableBorderColor" />
- <u:style name="border-bottom-color" skin="tableBorderColor" />
- </u:selector>
-
- <u:selector name=".rich-pickList-header-tab-cell-last">
- <u:style name="border-right-width" value="0px" />
- </u:selector>
-
<u:selector name=".rich-list-pickList-button">
<u:style name="background-image">
<f:resource f:key="org.richfaces.renderkit.html.gradientimages.OrderingListButtonGradient" />
@@ -236,7 +206,7 @@
<u:style name="font-size" skin="generalSizeFont" />
<u:style name="font-family" skin="generalFamilyFont" />
</u:selector>
- <u:selector name=".rich-shuttle-source-cell-active, .rich-shuttle-target-cell-active" >
+ <u:selector name=".rich-pickList-source-cell-active, .rich-pickList-target-cell-active" >
<u:style name="border-top-color" skin="generalTextColor" />
<u:style name="border-bottom-color" skin="generalTextColor" />
</u:selector>
@@ -260,12 +230,6 @@
<u:style name="color" skin="tabDisabledTextColor"/>
</u:selector>
- <u:selector name=".rich-pickList-source-caption, .rich-pickList-target-caption">
- <u:style name="font-family" skin="headerFamilyFont" />
- <u:style name="font-size" skin="headerSizeFont" />
- <u:style name="font-weight" skin="headerWeightFont" />
- </u:selector>
-
<u:selector name=".rich-pickList-source-row-selected, .rich-pickList-target-row-selected">
<u:style name="background-color" skin="additionalBackgroundColor" />
</u:selector>
Modified: trunk/sandbox/ui/pickList/src/main/templates/htmlPickList.jspx
===================================================================
--- trunk/sandbox/ui/pickList/src/main/templates/htmlPickList.jspx 2008-02-04 15:07:30 UTC (rev 5782)
+++ trunk/sandbox/ui/pickList/src/main/templates/htmlPickList.jspx 2008-02-04 15:54:41 UTC (rev 5783)
@@ -62,7 +62,7 @@
<tbody>
<tr>
<td style="border:0px;padding : 0px;">
- <div id="#{clientId}headerBox" class="rich-shuttle-list">
+ <div id="#{clientId}headerBox" class="rich-pickList-list">
<jsp:scriptlet>
<![CDATA[
String contentContainerStyle = "";
16 years, 11 months
JBoss Rich Faces SVN: r5782 - branches/3.1.x/ui/dataTable/src/main/java/org/richfaces/renderkit/html.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-02-04 10:07:30 -0500 (Mon, 04 Feb 2008)
New Revision: 5782
Modified:
branches/3.1.x/ui/dataTable/src/main/java/org/richfaces/renderkit/html/SubTableRenderer.java
Log:
RF-1440
Modified: branches/3.1.x/ui/dataTable/src/main/java/org/richfaces/renderkit/html/SubTableRenderer.java
===================================================================
--- branches/3.1.x/ui/dataTable/src/main/java/org/richfaces/renderkit/html/SubTableRenderer.java 2008-02-04 15:01:00 UTC (rev 5781)
+++ branches/3.1.x/ui/dataTable/src/main/java/org/richfaces/renderkit/html/SubTableRenderer.java 2008-02-04 15:07:30 UTC (rev 5782)
@@ -28,6 +28,7 @@
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
+import org.ajax4jsf.renderkit.RendererUtils.HTML;
import org.richfaces.component.UIDataTable;
import org.richfaces.component.UISubTable;
import org.richfaces.renderkit.AbstractTableRenderer;
@@ -63,14 +64,20 @@
String headerClass = (String) component.getAttributes().get(
facetName+"Class");
if (headers.hasNext()) {
- encodeRowStart(context,"dr-subtable-"+facetName+" rich-subtable-"+facetName ,headerClass, dataTable, writer);
+ encodeHeaderRowStart(context,"dr-subtable-"+facetName+" rich-subtable-"+facetName ,headerClass, dataTable, writer);
encodeHeaderFacets(context, writer, headers, "dr-subtable-"+facetName+"cell rich-subtable-"+facetName+"cell", headerClass,
facetName, "td");
writer.endElement("tr");
}
}
-
+
+ private void encodeHeaderRowStart(FacesContext context, String skinClass, String rowClass,
+ UIDataTable table, ResponseWriter writer) throws IOException{
+ writer.startElement(HTML.TR_ELEMENT, table);
+ encodeStyleClass(writer, null, skinClass, null, rowClass);
+ }
+
/*
* (non-Javadoc)
*
16 years, 11 months
JBoss Rich Faces SVN: r5781 - in trunk/sandbox/samples/progressBarDemo: src/main/webapp and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2008-02-04 10:01:00 -0500 (Mon, 04 Feb 2008)
New Revision: 5781
Modified:
trunk/sandbox/samples/progressBarDemo/pom.xml
trunk/sandbox/samples/progressBarDemo/src/main/webapp/index.jsp
trunk/sandbox/samples/progressBarDemo/src/main/webapp/pages/index.jsp
Log:
Modified: trunk/sandbox/samples/progressBarDemo/pom.xml
===================================================================
--- trunk/sandbox/samples/progressBarDemo/pom.xml 2008-02-04 14:51:07 UTC (rev 5780)
+++ trunk/sandbox/samples/progressBarDemo/pom.xml 2008-02-04 15:01:00 UTC (rev 5781)
@@ -35,5 +35,7 @@
<artifactId>skins</artifactId>
<version>${project.version}</version>
</dependency>
+
+
</dependencies>
</project>
\ No newline at end of file
Modified: trunk/sandbox/samples/progressBarDemo/src/main/webapp/index.jsp
===================================================================
--- trunk/sandbox/samples/progressBarDemo/src/main/webapp/index.jsp 2008-02-04 14:51:07 UTC (rev 5780)
+++ trunk/sandbox/samples/progressBarDemo/src/main/webapp/index.jsp 2008-02-04 15:01:00 UTC (rev 5781)
@@ -1,12 +1,2 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<jsp:forward page="faces/pages/index.jsp"/>
-<html>
-
-<head></head>
-
- <body>
- <a href="faces/pages/index.jsp">JSP</a><br/>
- <a href="faces/pages/index.xhtml">XHTML</a>
- </body>
-
-</html>
\ No newline at end of file
Modified: trunk/sandbox/samples/progressBarDemo/src/main/webapp/pages/index.jsp
===================================================================
--- trunk/sandbox/samples/progressBarDemo/src/main/webapp/pages/index.jsp 2008-02-04 14:51:07 UTC (rev 5780)
+++ trunk/sandbox/samples/progressBarDemo/src/main/webapp/pages/index.jsp 2008-02-04 15:01:00 UTC (rev 5781)
@@ -31,11 +31,11 @@
<h:form>
<progressBar:progressBar value="#{bean.value}" enabled="#{bean.enabled}" id="progrs"
interval="700"
- reRender="per1"
styleClass="main"
reRenderAfterComplete="per2"
mode="#{bean.modeString}"
progressVar="percent"
+ parameters="text:'crack'"
style="width: 300px; height: 14px"
>
<f:facet name="initial">
@@ -44,7 +44,7 @@
<f:facet name="complete">
<h:outputText value="Process completed"></h:outputText>
</f:facet>
- <h:outputText value="{value}%" style="font-size: 10px; color: brown"></h:outputText>
+ <h:outputText style="color: green" value="{value}%"></h:outputText>
</progressBar:progressBar>
<br clear="all"/>
<table><tr>
16 years, 11 months
JBoss Rich Faces SVN: r5780 - in trunk/sandbox/ui/progressBAR/src: main/java/org/richfaces/renderkit and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2008-02-04 09:51:07 -0500 (Mon, 04 Feb 2008)
New Revision: 5780
Modified:
trunk/sandbox/ui/progressBAR/src/main/java/org/richfaces/component/UIProgressBar.java
trunk/sandbox/ui/progressBAR/src/main/java/org/richfaces/renderkit/AbstractProgressBarRenderer.java
trunk/sandbox/ui/progressBAR/src/main/resources/org/richfaces/renderkit/html/js/progressBar.js
trunk/sandbox/ui/progressBAR/src/main/templates/org/richfaces/progressBar.jspx
trunk/sandbox/ui/progressBAR/src/test/java/org/richfaces/sandbox/ProgressBarComponentTest.java
Log:
refactoring
Modified: trunk/sandbox/ui/progressBAR/src/main/java/org/richfaces/component/UIProgressBar.java
===================================================================
--- trunk/sandbox/ui/progressBAR/src/main/java/org/richfaces/component/UIProgressBar.java 2008-02-04 14:22:07 UTC (rev 5779)
+++ trunk/sandbox/ui/progressBAR/src/main/java/org/richfaces/component/UIProgressBar.java 2008-02-04 14:51:07 UTC (rev 5780)
@@ -21,6 +21,7 @@
import org.ajax4jsf.context.AjaxContext;
import org.ajax4jsf.context.AjaxContextImpl;
import org.ajax4jsf.event.AjaxEvent;
+import org.ajax4jsf.javascript.JSFunctionDefinition;
import org.ajax4jsf.javascript.JSLiteral;
import org.ajax4jsf.renderkit.AjaxRendererUtils;
import org.richfaces.renderkit.AbstractProgressBarRenderer;
@@ -42,6 +43,9 @@
/** Request parameter name containing component state to render */
private static final String FORCE_STATE_PARAM = "forceState";
+ /* (non-Javadoc)
+ * @see org.ajax4jsf.component.AjaxActionComponent#broadcast(javax.faces.event.FacesEvent)
+ */
public void broadcast(FacesEvent event) throws AbortProcessingException {
// TODO Auto-generated method stub
if (event instanceof AjaxEvent) {
@@ -66,10 +70,11 @@
ajaxContext.removeRenderedArea(this.getClientId(facesContext));
ajaxContext.setResponseData(getResponseData(percent,
facesContext));
- Object rerenderAfterComplete = this.getAttributes().get(
+
+ Object reRender = this.getAttributes().get(
"reRender");
Set ajaxRegions = AjaxRendererUtils
- .asSet(rerenderAfterComplete);
+ .asSet(reRender);
if (ajaxRegions != null) {
for (Iterator iter = ajaxRegions.iterator(); iter.hasNext();) {
@@ -122,18 +127,35 @@
}
- private Map<String, Object> getContext(
- AbstractProgressBarRenderer renderer, Number percent) {
- Map<String, Object> context = renderer.getParametersMap(this);
- if (context == null) {
- context = new HashMap<String, Object>();
+ /**
+ * Returns context for macrosubstitution
+ * @param renderer
+ * @param percent
+ * @return
+ */
+ private JSLiteral getContext(AbstractProgressBarRenderer renderer,
+ Number percent) {
+ StringBuffer buffer = new StringBuffer("{");
+ buffer.append("value:").append(percent.toString()).append(",");
+ buffer.append("minValue:").append(this.getAttributes().get("minValue"))
+ .append(",");
+ buffer.append("maxValue:").append(this.getAttributes().get("maxValue"));
+
+ String parameters = renderer.getParameters(this);
+ if (parameters != null) {
+ buffer.append(",");
+ buffer.append(parameters);
}
- context.put("value", percent.toString());
- context.put("maxValue", this.getAttributes().get("maxValue"));
- context.put("minValue", this.getAttributes().get("minValue"));
- return context;
+ buffer.append("}");
+ return new JSLiteral(buffer.toString());
}
+ /**
+ * Returns label markup
+ * @param context
+ * @param renderer
+ * @return
+ */
private JSLiteral getMarkup(FacesContext context,
AbstractProgressBarRenderer renderer) {
JSLiteral literal = null;
Modified: trunk/sandbox/ui/progressBAR/src/main/java/org/richfaces/renderkit/AbstractProgressBarRenderer.java
===================================================================
--- trunk/sandbox/ui/progressBAR/src/main/java/org/richfaces/renderkit/AbstractProgressBarRenderer.java 2008-02-04 14:22:07 UTC (rev 5779)
+++ trunk/sandbox/ui/progressBAR/src/main/java/org/richfaces/renderkit/AbstractProgressBarRenderer.java 2008-02-04 14:51:07 UTC (rev 5780)
@@ -8,12 +8,9 @@
import java.io.IOException;
import java.math.BigDecimal;
-import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
import javax.faces.FactoryFinder;
import javax.faces.component.UIComponent;
@@ -26,6 +23,7 @@
import org.ajax4jsf.event.AjaxEvent;
import org.ajax4jsf.javascript.JSFunction;
import org.ajax4jsf.javascript.JSFunctionDefinition;
+import org.ajax4jsf.javascript.JSLiteral;
import org.ajax4jsf.javascript.JSReference;
import org.ajax4jsf.javascript.ScriptUtils;
import org.ajax4jsf.renderkit.AjaxRendererUtils;
@@ -43,13 +41,6 @@
*/
public class AbstractProgressBarRenderer extends TemplateEncoderRendererBase {
- /** Pattern to find macrosubstitution parameters defined in attrs */
- private static final Pattern PARAMETERS = Pattern
- .compile("^\\s*([\\w\\d]+)\\s*[=:]\\s*['\"]*([\\w\\d]+)['\"]*\\s*$");
-
- /** Expression for params string split */
- private static final String SPLIT_EXPRS = "[;,]";
-
/** Request parameter name containing component state to render */
private static final String FORCE_STATE_PARAM = "forceState";
@@ -100,9 +91,9 @@
return null;
}
-
/**
* Renderes label markup
+ *
* @param context
* @param component
* @return
@@ -227,19 +218,22 @@
Integer minValue = (Integer) component.getAttributes().get("minValue");
Integer maxValue = (Integer) component.getAttributes().get("maxValue");
- script.append("new ProgressBar().init('").append(clientId)
- .append("','").append(containerId).append("','").append(formId)
- .append("','").append(mode).append("',").append(minValue)
- .append(",").append(maxValue).append(",");
- script.append(ScriptUtils.toScript(getParametersMap(component)));
+ script.append("new ProgressBar().init('")
+ .append(clientId).append("','") // id
+ .append(containerId).append("','") // containerId
+ .append(formId).append("','") // formId
+ .append(mode).append("',") // mode
+ .append(minValue).append(",") // min value
+ .append(maxValue).append(","); // max value
+ script.append(getContext(component)); // context
script.append(",");
- script.append(ScriptUtils.toScript(buildAjaxOptions(clientId,
+ script.append(ScriptUtils.toScript(buildAjaxOptions(clientId, // options
progressBar, context)));
- String progressVar = (String) component.getAttributes().get(
+ String progressVar = (String) component.getAttributes().get(
"progressVar");
if (progressVar != null) {
script.append(",'");
- script.append(progressVar);
+ script.append(progressVar); // progress var
script.append("'");
} else {
script.append(",null");
@@ -268,9 +262,8 @@
options.put("pollinterval", interval);
Map parameters = (Map) options.get("parameters");
parameters.put("percent", "percent");
- options
- .put("oncomplete",
- getOnComplete(clientId, progressBar, context));
+ options.put("onbeforedomupdate", getOnComplete(clientId, progressBar,
+ context));
return options;
}
@@ -395,13 +388,15 @@
String remainClass = (String) component.getAttributes().get(
"remainClass");
+ // <div class='remainClass' id='clientId:remain' style='style'></div>
writer.startElement("div", component);
getUtils().writeAttribute(writer, "class",
remainClass + " rich-progress-bar-base");
getUtils().writeAttribute(writer, "id", clientId + ":remain");
getUtils().writeAttribute(writer, "style", style);
-
writer.endElement("div");
+
+ // <div class='rich-progress-bar-uploaded' id='clientId:upload' style='style'>
writer.startElement("div", component);
getUtils()
.writeAttribute(writer, "class", "rich-progress-bar-uploaded");
@@ -409,45 +404,54 @@
getUtils().writeAttribute(writer, "style",
(style != null ? style + ";" : "") + " width: " + width + "%;");
+ // <div class='completeClass' id='clientId:complete' style='style'></div>
writer.startElement("div", component);
getUtils().writeAttribute(writer, "class",
completeClass + " rich-progress-bar-base");
getUtils().writeAttribute(writer, "id", clientId + ":complete");
getUtils().writeAttribute(writer, "style", style);
-
writer.endElement("div");
- writer.endElement("div");
+ // </div>
+ writer.endElement("div");
if (isAjaxMode(component)) {
encodePollScript(context, component);
}
}
-
+
+
/**
- * Gets map with parameters defined in 'parameters' attr
- *
+ * Returns parameters attr
* @param component
+ * @param renderer
+ * @param percent
* @return
*/
- public Map<String, Object> getParametersMap(UIComponent component) {
+ public String getParameters(UIComponent component) {
String parameters = (String) component.getAttributes()
.get("parameters");
+ return parameters;
+ }
+
+
+ /**
+ * Returns context for macrosubstitution
+ * @param component
+ * @return
+ */
+ private JSLiteral getContext(UIComponent component) {
+ StringBuffer buffer = new StringBuffer();
+ String parameters = getParameters(component);
+ JSLiteral literal = null;
if (parameters != null) {
- Map<String, Object> map = new HashMap<String, Object>();
- String[] strs = parameters.split(SPLIT_EXPRS);
- if (strs != null) {
- for (String str : strs) {
- Matcher matcher = PARAMETERS.matcher(str);
- if (matcher.matches()) {
- map.put(matcher.group(1), matcher.group(2));
- }
- }
- }
- return map;
+ buffer.append("{").append(parameters).append("}");
+ literal = new JSLiteral(buffer.toString());
+ }else {
+ literal = new JSLiteral("null");
}
- return null;
+ return literal;
}
/**
@@ -525,7 +529,7 @@
}
}
} catch (Exception e) {
- // TODO: handle exception
+ // no action
}
}
return result;
Modified: trunk/sandbox/ui/progressBAR/src/main/resources/org/richfaces/renderkit/html/js/progressBar.js
===================================================================
--- trunk/sandbox/ui/progressBAR/src/main/resources/org/richfaces/renderkit/html/js/progressBar.js 2008-02-04 14:22:07 UTC (rev 5779)
+++ trunk/sandbox/ui/progressBAR/src/main/resources/org/richfaces/renderkit/html/js/progressBar.js 2008-02-04 14:51:07 UTC (rev 5780)
@@ -139,7 +139,7 @@
this.forceState("initial",null);
return;
}
- } else if ( parseFloat(p) >= parseFloat(this.getMaxValue())) {
+ } else if ( parseFloat(p) > parseFloat(this.getMaxValue())) {
if (!this.isAjaxMode()) {
this.forceState("complete",null);
return;
Modified: trunk/sandbox/ui/progressBAR/src/main/templates/org/richfaces/progressBar.jspx
===================================================================
--- trunk/sandbox/ui/progressBAR/src/main/templates/org/richfaces/progressBar.jspx 2008-02-04 14:22:07 UTC (rev 5779)
+++ trunk/sandbox/ui/progressBAR/src/main/templates/org/richfaces/progressBar.jspx 2008-02-04 14:51:07 UTC (rev 5780)
@@ -42,7 +42,7 @@
renderForcedState(forcedState,context,component);
}else if (value.doubleValue() < minValue.doubleValue()) {
encodeInitialState(context, component);
-} else if (value.doubleValue() >= maxValue.doubleValue()) {
+} else if (value.doubleValue() > maxValue.doubleValue()) {
encodeCompletedState(context, component);
} else {
encodeProgressState(context, component);
Modified: trunk/sandbox/ui/progressBAR/src/test/java/org/richfaces/sandbox/ProgressBarComponentTest.java
===================================================================
--- trunk/sandbox/ui/progressBAR/src/test/java/org/richfaces/sandbox/ProgressBarComponentTest.java 2008-02-04 14:22:07 UTC (rev 5779)
+++ trunk/sandbox/ui/progressBAR/src/test/java/org/richfaces/sandbox/ProgressBarComponentTest.java 2008-02-04 14:51:07 UTC (rev 5780)
@@ -56,13 +56,13 @@
progressBar.setId("prgs");
progressBar.setValue(50);
progressBar.setInterval(1000);
- progressBar.getAttributes().put("progressVar", "persent");
- MockValueExpression expression = new MockValueExpression("50%");
- ValueExpression exp = application.getExpressionFactory()
- .createValueExpression(facesContext.getELContext(), "#{persent}", Object.class);
+// MockValueExpression expression = new MockValueExpression("50%");
+// ValueExpression exp = application.getExpressionFactory()
+// .createValueExpression(facesContext.getELContext(), "#{persent}", Object.class);
output = (UIOutput)application.createComponent("javax.faces.Output");
- output.setValueExpression("value", expression);
+ output.setValue("{value}%");
+// output.setValueExpression("value", expression);
progressBar.getChildren().add(output);
@@ -88,18 +88,18 @@
public void testProgressBar() throws Exception {
HtmlPage page = renderView();
assertNotNull(page);
+
+ String clientId = progressBar.getClientId(facesContext);
- HtmlElement progress = page.getHtmlElementById(progressBar
- .getClientId(facesContext));
+ HtmlElement progress = page.getHtmlElementById(clientId);
assertNotNull(progress);
assertEquals("div", progress.getNodeName());
String classAttr = progress.getAttributeValue("class");
assertTrue(classAttr.contains("rich-progress-bar"));
- HtmlElement node = (HtmlElement)progress.getFirstChild();
+ HtmlElement node = (HtmlElement)progress.getHtmlElementById(clientId + ":remain");
assertTrue(node.getAttributeValue("class").contains("rich-progress-bar-base"));
- assertTrue("50%".equals(node.asText()));
node = (HtmlElement) progress.getLastChild();
assertTrue("span".equalsIgnoreCase(node.getTagName()));
@@ -108,8 +108,8 @@
assertTrue("script".equalsIgnoreCase(node.getTagName()));
DomText text = (DomText) node.getFirstChild();
- assertTrue(text.getData().contains("A4J.AJAX.Poll"));
- assertTrue(text.getData().contains("1000"));
+ assertTrue(text.getData().contains("new ProgressBar"));
+ assertTrue(text.getData().contains("renderLabel"));
}
16 years, 11 months
JBoss Rich Faces SVN: r5779 - branches/3.1.x/extensions/portletbridge/portletbridge-api.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-02-04 09:22:07 -0500 (Mon, 04 Feb 2008)
New Revision: 5779
Modified:
branches/3.1.x/extensions/portletbridge/portletbridge-api/pom.xml
Log:
Abstract test excluded
Modified: branches/3.1.x/extensions/portletbridge/portletbridge-api/pom.xml
===================================================================
--- branches/3.1.x/extensions/portletbridge/portletbridge-api/pom.xml 2008-02-04 11:58:14 UTC (rev 5778)
+++ branches/3.1.x/extensions/portletbridge/portletbridge-api/pom.xml 2008-02-04 14:22:07 UTC (rev 5779)
@@ -22,7 +22,16 @@
</goals>
</execution>
</executions>
- </plugin>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <excludes>
+ <exclude>**/AbstractAjax4jsfPortletTestCase.java</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
</plugins>
</build>
</project>
\ No newline at end of file
16 years, 11 months
JBoss Rich Faces SVN: r5778 - in trunk/sandbox/samples/pickList-sample/src/main: webapp/WEB-INF and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2008-02-04 06:58:14 -0500 (Mon, 04 Feb 2008)
New Revision: 5778
Modified:
trunk/sandbox/samples/pickList-sample/src/main/java/org/richfaces/Bean.java
trunk/sandbox/samples/pickList-sample/src/main/webapp/WEB-INF/web.xml
trunk/sandbox/samples/pickList-sample/src/main/webapp/pages/index.jsp
Log:
skins changing
Modified: trunk/sandbox/samples/pickList-sample/src/main/java/org/richfaces/Bean.java
===================================================================
--- trunk/sandbox/samples/pickList-sample/src/main/java/org/richfaces/Bean.java 2008-02-04 11:32:45 UTC (rev 5777)
+++ trunk/sandbox/samples/pickList-sample/src/main/java/org/richfaces/Bean.java 2008-02-04 11:58:14 UTC (rev 5778)
@@ -34,9 +34,9 @@
public Bean()
{
- testList.add(new SelectItem("polecat", "polecat"));
- testList.add(new SelectItem("suricate", "suricate"));
- testList.add(new SelectItem("marshotter", "marshotter"));
+ testList.add(new SelectItem("polecat", "Value-polecat"));
+ testList.add(new SelectItem("suricate", "Value-suricate"));
+ testList.add(new SelectItem("marshotter", "Value-marshotter"));
}
public void selectionChanged(ValueChangeEvent evt)
Modified: trunk/sandbox/samples/pickList-sample/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/sandbox/samples/pickList-sample/src/main/webapp/WEB-INF/web.xml 2008-02-04 11:32:45 UTC (rev 5777)
+++ trunk/sandbox/samples/pickList-sample/src/main/webapp/WEB-INF/web.xml 2008-02-04 11:58:14 UTC (rev 5778)
@@ -10,11 +10,13 @@
<param-name>org.ajax4jsf.COMPRESS_SCRIPT</param-name>
<param-value>false</param-value>
</context-param>
-<context-param>
- <param-name>org.richfaces.SKIN</param-name>
- <param-value>classic</param-value>
- </context-param>
+
<context-param>
+ <param-name>org.ajax4jsf.SKIN</param-name>
+ <param-value>#{skinBean.skin}</param-value>
+</context-param>
+
+ <context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>server</param-value>
</context-param>
Modified: trunk/sandbox/samples/pickList-sample/src/main/webapp/pages/index.jsp
===================================================================
--- trunk/sandbox/samples/pickList-sample/src/main/webapp/pages/index.jsp 2008-02-04 11:32:45 UTC (rev 5777)
+++ trunk/sandbox/samples/pickList-sample/src/main/webapp/pages/index.jsp 2008-02-04 11:58:14 UTC (rev 5778)
@@ -8,6 +8,13 @@
<body>
<f:view>
<h:form>
+ <h:selectOneRadio binding="#{skinBean.component}" />
+ <h:commandLink action="#{skinBean.change}" value="set skin" />
+ <h:outputText value="Current skin: #{skinBean.skin}"/><br />
+ </h:form>
+
+
+ <h:form>
<pickList:pickList size="5" valueChangeListener="#{pickBean.selectionChanged}">
<f:selectItem itemValue="cat" itemLabel="cat"/>
<f:selectItem itemValue="dog" itemLabel="dog"/>
16 years, 11 months
JBoss Rich Faces SVN: r5777 - trunk/sandbox/ui/pickList/src/main/resources/org/richfaces/renderkit/html/css.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2008-02-04 06:32:45 -0500 (Mon, 04 Feb 2008)
New Revision: 5777
Modified:
trunk/sandbox/ui/pickList/src/main/resources/org/richfaces/renderkit/html/css/picklist.xcss
Log:
cosmetic changes
Modified: trunk/sandbox/ui/pickList/src/main/resources/org/richfaces/renderkit/html/css/picklist.xcss
===================================================================
--- trunk/sandbox/ui/pickList/src/main/resources/org/richfaces/renderkit/html/css/picklist.xcss 2008-02-04 11:31:04 UTC (rev 5776)
+++ trunk/sandbox/ui/pickList/src/main/resources/org/richfaces/renderkit/html/css/picklist.xcss 2008-02-04 11:32:45 UTC (rev 5777)
@@ -13,10 +13,6 @@
overflow: auto;
}
-.rich-pickList-list-header {
- overflow: hidden;
-}
-
.rich-pickList-header-tab-cell, .rich-pickList-header-tab-cell-last {
padding : 2px;
border-style: solid;
@@ -110,19 +106,6 @@
text-decoration: none;
}
-.rich-list-pickList-caption {
- text-align: left;
- padding : 1px;
-}
-
-.rich-pickList-source-caption {
- padding: 3px 3px 3px 8px;
-}
-
-.rich-pickList-target-caption {
- padding: 3px 3px 3px 0px;
-}
-
.rich-pickList-source-items {
margin: 0px 0px 8px 8px;
}
16 years, 11 months