JBoss Rich Faces SVN: r645 - in trunk/richfaces-samples/richfaces-demo/src/main/webapp/richfaces: modalPanel and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: SergeySmirnov
Date: 2007-05-03 22:21:51 -0400 (Thu, 03 May 2007)
New Revision: 645
Modified:
trunk/richfaces-samples/richfaces-demo/src/main/webapp/richfaces/dropDownMenu/usage.xhtml
trunk/richfaces-samples/richfaces-demo/src/main/webapp/richfaces/modalPanel/usage.xhtml
Log:
additions to demo
Modified: trunk/richfaces-samples/richfaces-demo/src/main/webapp/richfaces/dropDownMenu/usage.xhtml
===================================================================
--- trunk/richfaces-samples/richfaces-demo/src/main/webapp/richfaces/dropDownMenu/usage.xhtml 2007-05-04 01:39:17 UTC (rev 644)
+++ trunk/richfaces-samples/richfaces-demo/src/main/webapp/richfaces/dropDownMenu/usage.xhtml 2007-05-04 02:21:51 UTC (rev 645)
@@ -12,36 +12,33 @@
.optionList {
height:30px;
}
- .vertical-menu .rich-menu-item-hover,.vertical-menu .rich-menu-group-hover {
+ .Avertical-menu .rich-menu-item-hover,.Avertical-menu .rich-menu-group-hover {
background-image:none;
- background-color: transparent !important;
+ background-color: #{a4jSkin.additionalBackgroundColor};
}
-
+
</style>
- <p>Description
+ <p>RichFaces Drop Down menu is a component that allows orginize the hierarchical menu
+ similar to one that almost every desktop application have.
</p>
<a4j:log hotkey="M" />
<div class="sample-container">
<h:form>
-Output: <h:outputText id="out" value="#{paintData.text}" />
+
<rich:toolBar>
- <rich:dropDownMenu value="File">
+ <rich:dropDownMenu showDelay="0" hideDelay="1000" value="File">
<rich:menuItem width="40px" mode="ajax" value="Open" action="open"/>
<rich:menuSeparator id="menuSeparator11"/>
<rich:menuItem mode="none" onclick="document.location.href='http://www.exadel.com'">
<h:outputLink value="http://www.exadel.com">output Link</h:outputLink>
</rich:menuItem>
- <rich:menuItem>
- <h:inputText style="z-index:100000" value="#{paintData.text}">
- <a4j:support event="onkeyup" reRender="out" />
- </h:inputText>
- </rich:menuItem>
</rich:dropDownMenu>
- <rich:dropDownMenu showDelay="100" hideDelay="100">
+
+ <rich:dropDownMenu showDelay="0" hideDelay="1000">
<f:facet name="label">
- <h:panelGrid columns="2" style="vertical-align:middle">
+ <h:panelGrid cellpadding="0" cellspacing="0" columns="2" style="vertical-align:middle">
<h:graphicImage value="/richfaces/toolBar/images/palette_edit.gif"/>
<h:outputText value="Options" />
</h:panelGrid>
@@ -71,11 +68,31 @@
</rich:menuGroup>
</rich:dropDownMenu>
</rich:toolBar>
- <rich:spacer height="20" />
+ </h:form>
+ </div>
+ <p>The drop down menu has label that always appears on the page and invisible panel
+ that appears by particular client side event (onmouseover, onclick etc). The event is
+ defined with 'event' attribute.</p>
+ <p>Drop Down Menu can contains set of Menu Items, Menu Groups and Menu Separators.
+ Group plays the role of label for secondary levels on the menu. Separator is represented with
+ horizontal lines between the items or groups. Item is a active element that might produce
+ Ajax or non-Ajax requests. The submittion mode is defined with 'submitMode' attribute that has
+ three possible options - "server", "ajax" or "none". Mode "none" does not produce any request, but
+ allows developers to provide own functionality inside the menu item.
+ </p>
+
+ <div class="sample-container">
+ <h:form>
+
<h:panelGrid class="vertical-menu" style="background-color:#{a4jSkin.additionalBackgroundColor}" columns="1" cellspacing="0" cellpadding="0">
<rich:dropDownMenu style="border:1px solid #{a4jSkin.panelBorderColor}" value="Option1" direction="bottom-right" jointPoint="tr">
<rich:menuItem value="Suboption1-1" />
- <rich:menuItem value="Suboption1-2" />
+ <rich:menuItem value="Suboption1-2">
+ <f:facet name="icon">
+ <h:graphicImage id="print2" value="/richfaces/toolBar/images/print.gif" />
+ </f:facet>
+
+ </rich:menuItem>
<rich:menuItem value="Suboption1-3" />
</rich:dropDownMenu>
<rich:dropDownMenu style="border:1px solid #{a4jSkin.panelBorderColor}" value="Option2" direction="bottom-right" jointPoint="tr">
@@ -95,8 +112,8 @@
</rich:dropDownMenu>
</h:panelGrid>
-
- </h:form>
+ </h:form>
+
</div>
</ui:define>
Modified: trunk/richfaces-samples/richfaces-demo/src/main/webapp/richfaces/modalPanel/usage.xhtml
===================================================================
--- trunk/richfaces-samples/richfaces-demo/src/main/webapp/richfaces/modalPanel/usage.xhtml 2007-05-04 01:39:17 UTC (rev 644)
+++ trunk/richfaces-samples/richfaces-demo/src/main/webapp/richfaces/modalPanel/usage.xhtml 2007-05-04 02:21:51 UTC (rev 645)
@@ -23,7 +23,6 @@
Richfaces.showModalPanel('mp',{width:450, top:200})</a></p>
<div class="sample-container">
- <button onclick="var pos=getRightTop(this);alert(pos.left);Richfaces.showModalPanel('mp',{top:pos.top, left:pos.left})">Show on the Right</button>
<rich:modalPanel id="mp" minHeight="200" minWidth="450"
height="200" width="500" zindex="2000">
17 years, 8 months
JBoss Rich Faces SVN: r644 - trunk/richfaces/assembly/src/main/assembly.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2007-05-03 21:39:17 -0400 (Thu, 03 May 2007)
New Revision: 644
Modified:
trunk/richfaces/assembly/src/main/assembly/richfaces.xml
Log:
fix content of a distribution zip.
Modified: trunk/richfaces/assembly/src/main/assembly/richfaces.xml
===================================================================
--- trunk/richfaces/assembly/src/main/assembly/richfaces.xml 2007-05-04 01:13:48 UTC (rev 643)
+++ trunk/richfaces/assembly/src/main/assembly/richfaces.xml 2007-05-04 01:39:17 UTC (rev 644)
@@ -11,9 +11,9 @@
<include>NOTICE*</include>
</includes>
</fileSet>
- <!-- fileSet>
- <directory>target</directory>
- <outputDirectory></outputDirectory>
+ <fileSet>
+ <directory>target/dist</directory>
+ <outputDirectory>lib</outputDirectory>
<includes>
<include>*.jar</include>
</includes>
@@ -22,7 +22,7 @@
<exclude>*-javadoc.jar</exclude>
<exclude>*-tlddoc.jar</exclude>
</excludes>
- </fileSet-->
+ </fileSet>
<fileSet>
<directory>target/apidocs</directory>
<outputDirectory>apidocs</outputDirectory>
@@ -42,9 +42,9 @@
<unpack>false</unpack>
<scope>runtime</scope>
<includes>
- <include>org.ajax4jsf:framework</include>
+ <include>org.ajax4jsf:ajax4jsf</include>
+ <include>org.ajax4jsf:test</include>
<include>org.richfaces:richfaces</include>
- <include>opensymphony:oscache</include>
<include></include>
</includes>
<excludes>
17 years, 8 months
JBoss Rich Faces SVN: r642 - trunk/richfaces/dropdown-menu/src/main/resources/org/richfaces/renderkit/html/css.
by richfaces-svn-commits@lists.jboss.org
Author: SergeySmirnov
Date: 2007-05-03 19:07:42 -0400 (Thu, 03 May 2007)
New Revision: 642
Modified:
trunk/richfaces/dropdown-menu/src/main/resources/org/richfaces/renderkit/html/css/dropdownmenu.xcss
Log:
problems with height and width of the label. RF-136, RF-147
Modified: trunk/richfaces/dropdown-menu/src/main/resources/org/richfaces/renderkit/html/css/dropdownmenu.xcss
===================================================================
--- trunk/richfaces/dropdown-menu/src/main/resources/org/richfaces/renderkit/html/css/dropdownmenu.xcss 2007-05-03 20:55:13 UTC (rev 641)
+++ trunk/richfaces/dropdown-menu/src/main/resources/org/richfaces/renderkit/html/css/dropdownmenu.xcss 2007-05-03 23:07:42 UTC (rev 642)
@@ -23,10 +23,12 @@
white-space : nowrap;
position: relative;
width : auto;
- height : 18px;
+ height : 100%;
}
.dr-menu-label-unselect {
border : 1px solid transparent;
+ _border-color:tomato;/*For IE6-*/
+ _filter:chroma(color=tomato);/*For IE6-*/
}
.dr-menu-label-select {
border : 1px solid #bfbfc0;
17 years, 8 months
JBoss Rich Faces SVN: r641 - trunk/richfaces/menu-components/src/test/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: SergeySmirnov
Date: 2007-05-03 16:55:13 -0400 (Thu, 03 May 2007)
New Revision: 641
Modified:
trunk/richfaces/menu-components/src/test/java/org/richfaces/component/MenuItemComponentTest.java
Log:
corrections for method name (submitMode instead of mode)
Modified: trunk/richfaces/menu-components/src/test/java/org/richfaces/component/MenuItemComponentTest.java
===================================================================
--- trunk/richfaces/menu-components/src/test/java/org/richfaces/component/MenuItemComponentTest.java 2007-05-03 16:23:49 UTC (rev 640)
+++ trunk/richfaces/menu-components/src/test/java/org/richfaces/component/MenuItemComponentTest.java 2007-05-03 20:55:13 UTC (rev 641)
@@ -102,7 +102,7 @@
* MenuItem rendering test.
*/
public void testMenuItemRender() throws Exception {
- menuItem.setMode(MenuComponent.MODE_NONE);
+ menuItem.setSubmitMode(MenuComponent.MODE_NONE);
HtmlPage page = renderView();
assertNotNull(page);
// System.out.println(page.asXml());
@@ -191,7 +191,7 @@
public void testEnabledMenuItemServerMode() throws Exception {
assertEquals(false, menuItem.isDisabled());
menuItem.getAttributes().put("iconClass", "iconClass");
- menuItem.setMode(MenuComponent.MODE_SERVER);
+ menuItem.setSubmitMode(MenuComponent.MODE_SERVER);
menuItem.getAttributes().put("target", "target");
menuItem.getAttributes().put("selectStyle", "menuItemSelectStyle");
HtmlPage page = renderView();
@@ -233,7 +233,7 @@
* Test for enabled MenuItem component in "ajax" mode.
*/
public void testEnabledMenuItemAJAXMode() throws Exception {
- menuItem.setMode(MenuComponent.MODE_AJAX);
+ menuItem.setSubmitMode(MenuComponent.MODE_AJAX);
menuItem.getAttributes().put("style", "menuItemStyle");
HtmlPage page = renderView();
assertNotNull(page);
@@ -251,7 +251,7 @@
* Test for enabled MenuItem component in "none" mode.
*/
public void testEnabledMenuItemNoneMode() throws Exception {
- menuItem.setMode(MenuComponent.MODE_NONE);
+ menuItem.setSubmitMode(MenuComponent.MODE_NONE);
HtmlPage page = renderView();
assertNotNull(page);
// System.out.println(page.asXml());
@@ -312,7 +312,7 @@
public void testMenuItemDoDecodeAJAXMode() throws Exception {
menuItem.setImmediate(true);
- menuItem.setMode(MenuComponent.MODE_AJAX);
+ menuItem.setSubmitMode(MenuComponent.MODE_AJAX);
externalContext.getRequestParameterMap().put(
menuItem.getClientId(facesContext), "Action");
@@ -331,7 +331,7 @@
public void testMenuItemDoDecodeServerMode() throws Exception {
menuItem.setImmediate(false);
- menuItem.setMode(MenuComponent.MODE_SERVER);
+ menuItem.setSubmitMode(MenuComponent.MODE_SERVER);
externalContext.getRequestParameterMap().put(
menuItem.getClientId(facesContext) + ":hidden", "Action");
17 years, 8 months
JBoss Rich Faces SVN: r640 - trunk/richfaces/dropdown-menu/src/main/resources/org/richfaces/renderkit/html/css.
by richfaces-svn-commits@lists.jboss.org
Author: a.izobov
Date: 2007-05-03 12:23:49 -0400 (Thu, 03 May 2007)
New Revision: 640
Modified:
trunk/richfaces/dropdown-menu/src/main/resources/org/richfaces/renderkit/html/css/dropdownmenu.xcss
Log:
RF-135 fixed
Modified: trunk/richfaces/dropdown-menu/src/main/resources/org/richfaces/renderkit/html/css/dropdownmenu.xcss
===================================================================
--- trunk/richfaces/dropdown-menu/src/main/resources/org/richfaces/renderkit/html/css/dropdownmenu.xcss 2007-05-03 16:04:52 UTC (rev 639)
+++ trunk/richfaces/dropdown-menu/src/main/resources/org/richfaces/renderkit/html/css/dropdownmenu.xcss 2007-05-03 16:23:49 UTC (rev 640)
@@ -22,7 +22,7 @@
padding : 2px 5px 2px 5px;
white-space : nowrap;
position: relative;
- width : 75px;
+ width : auto;
height : 18px;
}
.dr-menu-label-unselect {
17 years, 8 months
JBoss Rich Faces SVN: r639 - trunk/richfaces/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: A.Skokov
Date: 2007-05-03 12:04:52 -0400 (Thu, 03 May 2007)
New Revision: 639
Modified:
trunk/richfaces/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js
Log:
http://jira.jboss.com/jira/browse/RF-146 fixed
Modified: trunk/richfaces/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js
===================================================================
--- trunk/richfaces/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js 2007-05-03 15:57:15 UTC (rev 638)
+++ trunk/richfaces/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js 2007-05-03 16:04:52 UTC (rev 639)
@@ -18,13 +18,13 @@
if (idx != -1) {
var versIdx = agent.indexOf(";", idx);
var versString;
-
+
if (versIdx != -1) {
versString = agent.substring(idx + searchString.length, versIdx);
} else {
versString = agent.substring(idx + searchString.length);
}
-
+
if (parseFloat(versString) < 7) {
ModalPanel.disableSelects = true;
}
@@ -43,7 +43,7 @@
if (!Richfaces.isNodeInDOMTree(elt)) {
panel.destroy();
-
+
ModalPanel.panels.splice(i, 1);
//check all panels again. maybe we've removed parent of any panel just now
i = 0;
@@ -60,19 +60,19 @@
this.cdiv = modalPanel.contentDiv;
this.isPositionFixed = Richfaces.getComputedStyle(this.cdiv, "position") == "fixed";
},
-
+
left: function(offset) {
return offset;
- },
+ },
top: function(offset) {
return offset;
},
-
+
width: function() {
return this.cdiv.offsetWidth;
},
-
+
height: function() {
return this.cdiv.offsetHeight;
}
@@ -83,7 +83,7 @@
if (document.compatMode=='CSS1Compat') {
element = document.documentElement;
} else {
- element = document.body;
+ element = document.body;
}
return element;
@@ -93,23 +93,23 @@
ModalPanel.prototype = {
initialize: function(id, options) {
this.markerId = $(id);
-
+
this.id = $(id + "Container");
-
+
this.options = options;
-
+
this.baseZIndex = this.options.zindex ? this.options.zindex : 100;
-
- this.minWidth = Math.max(this.options.minWidth, 2*sizeA + 2);
- this.minHeight = Math.max(this.options.minHeight, 2*sizeA + 2);
-
+
+ this.minWidth = Math.max(this.options.minWidth, 2*sizeA + 2);
+ this.minHeight = Math.max(this.options.minHeight, 2*sizeA + 2);
+
this.div = $(id + "Div");
this.cursorDiv = $(id + "CursorDiv");
this.cdiv = $(id + "CDiv");
this.contentDiv = $(id + "ContentDiv");
this.context = new ModalPanel.Context(this);
-
+
this.borders = new Array();
if (this.options.resizeable) {
@@ -126,16 +126,16 @@
this.borders.push(new ModalPanel.Border(id + "ResizerW", this, "W-resize", ModalPanel.Sizer.W));
this.borders.push(new ModalPanel.Border(id + "ResizerNWL", this, "NW-resize", ModalPanel.Sizer.NWL));
}
-
+
if (this.options.moveable && $(id + "Header")) {
this.header = new ModalPanel.Border(id + "Header", this, "move", ModalPanel.Header);
}
-
+
this.id.modalPanel = this;
- if (this.div.style.setExpression)
+ if (this.div.style.setExpression)
if (ModalPanel.disableSelects /* IE 6 */ || Richfaces.getComputedStyle(this.div, "position") != "fixed" /* IE again, not in strict mode*/)
-
+
{
this.div.style.position = "absolute";
this.cursorDiv.style.position = "absolute";
@@ -155,8 +155,9 @@
},
destroy: function() {
- this.traverseSelects(true);
-
+
+ this.traverseSelects(true);
+
if (this.floatedToBody) {
var parent = this.id.parentNode;
if (parent) {
@@ -166,13 +167,13 @@
},
initIframe : function() {
- if (this.contentWindow) {
+ if (this.contentWindow) {
Element.setStyle(this.contentWindow.document.body, { "margin" : "0px 0px 0px 0px" });
} else {
//TODO opera etc.
-
+
}
-
+
if("transparent" == Element.getStyle(document.body, "background-color")) {
this.allowTransparency = true;
}
@@ -185,33 +186,33 @@
//iframeBodyStyle.opacity = "0.5";
//iframeBodyStyle.zIndex = "99";
},
-
+
traverseSelects: function(enable) {
if (!ModalPanel.disableSelects) {
return ;
}
-
+
var children = document.body.childNodes;
for (var k = 0; k < children.length; k++) {
var child = children[k];
if (child != this.id && child.getElementsByTagName) {
-
+
var selects = child.getElementsByTagName("SELECT");
-
+
for (var i = 0; i < selects.length; i++) {
var elt = selects[i];
-
+
if (enable) {
if (elt._mdwCount) {
elt._mdwCount -= 1;
-
+
if (elt._mdwCount == 0) {
if (elt._mdwDisabled) {
elt._mdwDisabled = undefined;
} else {
- elt.disabled = false;
+ elt.disabled = false;
}
-
+
elt._mdwCount = undefined;
}
}
@@ -224,7 +225,7 @@
} else {
elt.disabled = true;
}
-
+
elt._mdwCount = 1;
}
}
@@ -240,7 +241,7 @@
this.cdiv.style.left = pos + "px";
}
},
-
+
setTop: function(pos) {
if (this.cdiv.mpUseExpr) {
this.cdiv.mpTop = pos;
@@ -250,34 +251,38 @@
},
show: function(opts) {
- if (!this.floatedToBody) {
+ this.onSelectStartHandler = document.onselectstart;
+
+ document.onselectstart = function () { return false; };
+
+ if (!this.floatedToBody) {
document.body.appendChild(this.id.parentNode.removeChild(this.id));
this.floatedToBody = true;
}
-
+
if (ModalPanel.disableSelects && !this.iframe) {
new Insertion.Top(this.cdiv,
- "<iframe src=\"javascript:''\" frameborder=\"0\" scrolling=\"no\" id=\"" + this.markerId.id + "IFrame\"" +
+ "<iframe src=\"javascript:''\" frameborder=\"0\" scrolling=\"no\" id=\"" + this.markerId.id + "IFrame\"" +
"style=\"position: absolute; width: 1px; height: 1px; background-color: white; overflow-y: hidden; z-index: 1;\">" +
"</iframe>");
-
+
this.iframe = $(this.markerId.id + "IFrame");
-
+
//alert("IFrame:" + this.iframe + "created!");
-
+
this.iframe.onload = this.initIframe.bind(this.iframe);
}
-
+
var options = {};
-
+
if (!this.cdiv.mpSet) {
Object.extend(options, this.options);
}
if (opts) {
Object.extend(options, opts);
- }
-
+ }
+
if (options.width) {
if (this.minWidth > options.width) {
options.width = this.minWidth;
@@ -291,7 +296,7 @@
if (options.height) {
if (this.minHeight > options.height) {
- options.height = this.minHeight;
+ options.height = this.minHeight;
}
if (this.iframe) {
@@ -315,7 +320,7 @@
this.setLeft(_left);
}
-
+
if (options.top) {
var _top;
if (options.top != "auto") {
@@ -324,23 +329,23 @@
var cw = getSizeElement().clientHeight;
_top = (cw - Richfaces.getComputedStyleSize(this.contentDiv, "height")) / 2;
}
-
+
this.setTop(_top);
}
this.cdiv.mpSet = true;
-
+
//Element.setStyle(this.dialogWindow.document.body, { "margin" : "0px 0px 0px 0px" });
//if("transparent" == Element.getStyle(document.body, "background-color")) {
// this.iframe.allowTransparency = true;
//}
-
+
this.traverseSelects();
//this.shape.init(this.cdiv, this.options);
- if (this.div.style.position == "absolute")
+ if (this.div.style.position == "absolute")
{
var we = "getSizeElement().clientWidth + \"px\"";
var he = "getSizeElement().clientHeight + \"px\"";
@@ -352,7 +357,7 @@
var le = "-Position.cumulativeOffset(this.parentNode)[0] + getSizeElement().scrollLeft + \"px\"";
var te = "-Position.cumulativeOffset(this.parentNode)[1] + getSizeElement().scrollTop + \"px\"";
-
+
this.div.style.setExpression("left", le);
this.div.style.setExpression("top", te);
@@ -366,7 +371,7 @@
this.cdiv.style.setExpression("left", leftExpr);
this.cdiv.style.setExpression("top", topExpr);
-
+
/* That's how we output debug info - DOM inspector rulez */
/*
document.body.setExpression("_clientLeft", "getSizeElement().clientLeft");
@@ -386,14 +391,14 @@
for (var k = 0; k < this.borders.length; k++ ) {
this.borders[k].doPosition();
}
-
+
if (this.header) {
this.header.doPosition();
}
-
+
this.id.style.visibility = "";
},
-
+
startDrag: function(border) {
for (var k = 0; k < this.borders.length; k++ ) {
//this.borders[k].hide();
@@ -406,9 +411,11 @@
this.borders[k].doPosition();
}
},
-
+
hide: function() {
- this.traverseSelects(true);
+ document.onselectstart = this.onSelectStartHandler;
+
+ this.traverseSelects(true);
if (this.div.style.removeExpression) {
this.div.style.removeExpression("width");
@@ -429,14 +436,14 @@
Element.hide(this.id);
},
-
+
doResizeOrMove: function(diff) {
var vetoes = {};
var cssHash = {};
var cssHashWH = {};
var winSize = Richfaces.getWindowSize();
-
+
var vetoeChange = false;
var newSize;
// Avoid currentStyle bug in opera
@@ -444,10 +451,10 @@
newSize = Richfaces.getComputedStyleSize(this.contentDiv, "width");
else
newSize = parseInt(this.contentDiv.style.width.replace("px", ""), 10);
-
+
var oldSize = newSize;
newSize += diff.deltaWidth || 0;
-
+
if (newSize >= this.minWidth) {
if (diff.deltaWidth) {
cssHashWH.width = newSize + 'px';
@@ -456,17 +463,17 @@
} else {
if (diff.deltaWidth) {
cssHashWH.width = this.minWidth + 'px';
-
+
vetoes.vx = oldSize - this.minWidth;
}
-
+
vetoes.x = true;
}
if (vetoes.vx && diff.deltaX) {
diff.deltaX = -vetoes.vx;
}
-
+
if (diff.deltaX && (vetoes.vx || !vetoes.x)) {
if (vetoes.vx) {
diff.deltaX = vetoes.vx;
@@ -475,19 +482,19 @@
if (this.cdiv.mpUseExpr) {
newPos = this.cdiv.mpLeft || 0;
newPos += diff.deltaX;
-
+
this.cdiv.mpLeft = newPos;
} else {
newPos = Richfaces.getComputedStyleSize(this.cdiv, "left");
newPos += diff.deltaX;
cssHash.left = newPos + 'px';
}
- }
+ }
var newSize = Richfaces.getComputedStyleSize(this.contentDiv, "height");
var oldSize = newSize;
newSize += diff.deltaHeight || 0;
-
+
if (newSize >= this.minHeight) {
if (diff.deltaHeight) {
cssHashWH.height = newSize + 'px';
@@ -498,14 +505,14 @@
vetoes.vy = oldSize - this.minHeight;
}
-
+
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;
@@ -515,20 +522,20 @@
if (this.cdiv.mpUseExpr) {
newPos = this.cdiv.mpTop || 0;
newPos += diff.deltaY;
-
+
this.cdiv.mpTop = newPos;
} else {
newPos = Richfaces.getComputedStyleSize(this.cdiv, "top");
newPos += diff.deltaY;
cssHash.top = newPos + 'px';
}
- }
+ }
- Element.setStyle(this.cdiv, cssHash);
-
- Element.setStyle(this.contentDiv, cssHashWH);
+ Element.setStyle(this.cdiv, cssHash);
+
+ Element.setStyle(this.contentDiv, cssHashWH);
if (this.iframe) {
- Element.setStyle(this.iframe, cssHashWH);
+ Element.setStyle(this.iframe, cssHashWH);
}
var w = this.context.width();
@@ -545,7 +552,7 @@
if (!this.context.reduced) {
this.context.reduced = {};
}
-
+
this.context.reduced.h = h;
}
@@ -560,12 +567,12 @@
Richfaces.findModalPanel = function (id) {
if (id) {
var prefId = (id.charAt(0) == ':' ? id : ':' + id);
-
+
for (var i = 0; i < ModalPanel.panels.length; i++ ) {
var pnl = ModalPanel.panels[i];
if (pnl && pnl.markerId) {
var pnlId = pnl.markerId.id;
-
+
if (pnlId) {
//try to match ids
if (pnlId.length >= prefId.length) {
17 years, 8 months
JBoss Rich Faces SVN: r638 - trunk/richfaces/datascroller/src/test/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: d.bulahov
Date: 2007-05-03 11:57:15 -0400 (Thu, 03 May 2007)
New Revision: 638
Modified:
trunk/richfaces/datascroller/src/test/java/org/richfaces/component/DatascrollerComponentTest.java
Log:
test fixed
Modified: trunk/richfaces/datascroller/src/test/java/org/richfaces/component/DatascrollerComponentTest.java
===================================================================
--- trunk/richfaces/datascroller/src/test/java/org/richfaces/component/DatascrollerComponentTest.java 2007-05-03 15:01:12 UTC (rev 637)
+++ trunk/richfaces/datascroller/src/test/java/org/richfaces/component/DatascrollerComponentTest.java 2007-05-03 15:57:15 UTC (rev 638)
@@ -64,11 +64,17 @@
private UIComponent form;
private UIData data;
private UIOutput first;
+ private UIOutput first_disabled;
private UIOutput fastrewind;
+ private UIOutput fastrewind_disabled;
private UIOutput previous;
+ private UIOutput previous_disabled;
private UIOutput fastforward;
+ private UIOutput fastforward_disabled;
private UIOutput next;
+ private UIOutput next_disabled;
private UIOutput last;
+ private UIOutput last_disabled;
private UICommand command = null;
/**
@@ -106,29 +112,65 @@
first = (UIOutput) application.createComponent(UIOutput.COMPONENT_TYPE);
first.setId("first");
first.setValue("first");
+ first_disabled = (UIOutput) application.createComponent(UIOutput.COMPONENT_TYPE);
+ first_disabled.setId("first_disabled");
+ first_disabled.setValue("first_disabled");
+
fastrewind = (UIOutput) application.createComponent(UIOutput.COMPONENT_TYPE);
fastrewind.setId("fastrewind");
fastrewind.setValue("fastrewind");
+
+ fastrewind_disabled = (UIOutput) application.createComponent(UIOutput.COMPONENT_TYPE);
+ fastrewind_disabled.setId("fastrewind_disabled");
+ fastrewind_disabled.setValue("fastrewind_disabled");
+
previous = (UIOutput) application.createComponent(UIOutput.COMPONENT_TYPE);
previous.setId("previous");
previous.setValue("previous");
+
+ previous_disabled = (UIOutput) application.createComponent(UIOutput.COMPONENT_TYPE);
+ previous_disabled.setId("previous_disabled");
+ previous_disabled.setValue("previous_disabled");
+
fastforward = (UIOutput) application.createComponent(UIOutput.COMPONENT_TYPE);
fastforward.setId("fastforward");
fastforward.setValue("fastforward");
+
+ fastforward_disabled = (UIOutput) application.createComponent(UIOutput.COMPONENT_TYPE);
+ fastforward_disabled.setId("fastforward_disabled");
+ fastforward_disabled.setValue("fastforward_disabled");
+
next = (UIOutput) application.createComponent(UIOutput.COMPONENT_TYPE);
next.setId("next");
next.setValue("next");
+
+ next_disabled = (UIOutput) application.createComponent(UIOutput.COMPONENT_TYPE);
+ next_disabled.setId("next_disabled");
+ next_disabled.setValue("next_disabled");
+
last = (UIOutput) application.createComponent(UIOutput.COMPONENT_TYPE);
last.setId("last");
last.setValue("last");
- scroller.getFacets().put(first.getId(), first);
+ last_disabled = (UIOutput) application.createComponent(UIOutput.COMPONENT_TYPE);
+ last_disabled.setId("last_disabled");
+ last_disabled.setValue("last_disabled");
+
+ scroller.getFacets().put(first.getId(), first);
scroller.getFacets().put(fastrewind.getId(), fastrewind);
scroller.getFacets().put(previous.getId(), previous);
scroller.getFacets().put(fastforward.getId(), fastforward);
scroller.getFacets().put(next.getId(), next);
scroller.getFacets().put(last.getId(), last);
+ scroller.getFacets().put(first_disabled.getId(), first_disabled);
+ scroller.getFacets().put(fastrewind_disabled.getId(), fastrewind_disabled);
+ scroller.getFacets().put(previous_disabled.getId(), previous_disabled);
+ scroller.getFacets().put(fastforward_disabled.getId(), fastforward_disabled);
+ scroller.getFacets().put(next_disabled.getId(), next_disabled);
+ scroller.getFacets().put(last_disabled.getId(), last_disabled);
+
+
form.getChildren().add(scroller);
command = new HtmlCommandLink();
@@ -167,18 +209,18 @@
assertNotNull(div);
assertEquals("div", div.getNodeName());
- HtmlElement f1 = page.getHtmlElementById(first.getClientId(facesContext));
- assertNotNull(f1);
+ HtmlElement f1_d = page.getHtmlElementById(first_disabled.getClientId(facesContext));
+ assertNotNull(f1_d);
HtmlElement f2 = page.getHtmlElementById(last.getClientId(facesContext));
assertNotNull(f2);
HtmlElement f3 = page.getHtmlElementById(fastforward.getClientId(facesContext));
assertNotNull(f3);
- HtmlElement f4 = page.getHtmlElementById(fastrewind.getClientId(facesContext));
- assertNotNull(f4);
+ HtmlElement f4_d = page.getHtmlElementById(fastrewind_disabled.getClientId(facesContext));
+ assertNotNull(f4_d);
HtmlElement f5 = page.getHtmlElementById(next.getClientId(facesContext));
assertNotNull(f5);
- HtmlElement f6 = page.getHtmlElementById(previous.getClientId(facesContext));
- assertNotNull(f6);
+ HtmlElement f6_d = page.getHtmlElementById(previous_disabled.getClientId(facesContext));
+ assertNotNull(f6_d);
String classAttr = div.getAttributeValue("class");
assertTrue(classAttr.contains("dr-dscr"));
17 years, 8 months
JBoss Rich Faces SVN: r637 - trunk/richfaces/spacer/src/test/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: A.Skokov
Date: 2007-05-03 11:01:12 -0400 (Thu, 03 May 2007)
New Revision: 637
Modified:
trunk/richfaces/spacer/src/test/java/org/richfaces/component/SpacerComponentTest.java
Log:
test fixed
Modified: trunk/richfaces/spacer/src/test/java/org/richfaces/component/SpacerComponentTest.java
===================================================================
--- trunk/richfaces/spacer/src/test/java/org/richfaces/component/SpacerComponentTest.java 2007-05-03 14:56:08 UTC (rev 636)
+++ trunk/richfaces/spacer/src/test/java/org/richfaces/component/SpacerComponentTest.java 2007-05-03 15:01:12 UTC (rev 637)
@@ -43,7 +43,7 @@
/**
* Create the test case
- *
+ *
* @param testName
* name of the test case
*/
@@ -85,13 +85,13 @@
/**
* Rigourous Test :-)
- *
+ *
* @throws Exception
*/
public void testComponent() throws Exception {
HtmlPage renderedView = renderView();
assertNotNull(renderedView);
- // System.out.println(renderedView.getWebResponse().getContentAsString());
+ System.out.println(renderedView.asXml());
HtmlAnchor htmlLink = (HtmlAnchor) renderedView
.getHtmlElementById(command.getClientId(facesContext));
@@ -113,8 +113,7 @@
assertTrue(str.contains("rich-spacer"));
str = htmlSpacer.getSrcAttribute();
- assertEquals("/testContext/a4j.res/org/richfaces/renderkit/html/images/spacer.gif",
- str);
+ assertTrue(str.contains("images/spacer.gif"));
System.out.println(renderedView.getWebResponse().getContentAsString());
@@ -122,13 +121,13 @@
* List lastParameters = this.webConnection.getLastParameters(); for
* (Iterator iterator = lastParameters.iterator(); iterator.hasNext();) {
* KeyValuePair keyValue = (KeyValuePair) iterator.next();
- *
+ *
* externalContext.addRequestParameterMap((String) keyValue.getKey(),
* (String) keyValue.getValue()); }
-
+
// System.out.println(this.webConnection.getLastParameters());
-
+
UIViewRoot root = facesContext.getViewRoot();
root.processDecodes(facesContext);
root.processValidators(facesContext);
17 years, 8 months
JBoss Rich Faces SVN: r636 - trunk/richfaces/simpleTogglePanel/src/test/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: d.bulahov
Date: 2007-05-03 10:56:08 -0400 (Thu, 03 May 2007)
New Revision: 636
Modified:
trunk/richfaces/simpleTogglePanel/src/test/java/org/richfaces/component/SimpleTogglePanelComponentTest.java
Log:
test fixed
Modified: trunk/richfaces/simpleTogglePanel/src/test/java/org/richfaces/component/SimpleTogglePanelComponentTest.java
===================================================================
--- trunk/richfaces/simpleTogglePanel/src/test/java/org/richfaces/component/SimpleTogglePanelComponentTest.java 2007-05-03 14:32:10 UTC (rev 635)
+++ trunk/richfaces/simpleTogglePanel/src/test/java/org/richfaces/component/SimpleTogglePanelComponentTest.java 2007-05-03 14:56:08 UTC (rev 636)
@@ -48,11 +48,11 @@
static {
javaScripts.add("org.ajax4jsf.framework.ajax.AjaxScript");
- javaScripts.add("prototype.js");
+ javaScripts.add("org.ajax4jsf.framework.resource.PrototypeScript");
javaScripts.add("org.ajax4jsf.framework.ajax.ImageCacheScript");
javaScripts.add("org/ajax4jsf/renderkit/html/scripts/form.js");
javaScripts.add("org/richfaces/renderkit/html/scripts/browser_info.js");
- javaScripts.add("org/richfaces/renderkit/html/scripts/simpleTogglePanel.js");
+ javaScripts.add("scripts/simpleTogglePanel.js");
}
private UISimpleTogglePanel stp1;
@@ -206,7 +206,7 @@
List links = page.getDocumentElement().getHtmlElementsByTagName("link");
assertEquals(1, links.size());
HtmlElement link = (HtmlElement) links.get(0);
- assertTrue(link.getAttributeValue("href").contains("org/richfaces/renderkit/html/css/simpleTogglePanel.xcss"));
+ assertTrue(link.getAttributeValue("href").contains("css/simpleTogglePanel.xcss"));
}
/**
17 years, 8 months
JBoss Rich Faces SVN: r635 - trunk/richfaces/menu-components/src/test/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: F.antonov
Date: 2007-05-03 10:32:10 -0400 (Thu, 03 May 2007)
New Revision: 635
Modified:
trunk/richfaces/menu-components/src/test/java/org/richfaces/component/MenuItemComponentTest.java
Log:
Test cases correction.
Modified: trunk/richfaces/menu-components/src/test/java/org/richfaces/component/MenuItemComponentTest.java
===================================================================
--- trunk/richfaces/menu-components/src/test/java/org/richfaces/component/MenuItemComponentTest.java 2007-05-03 14:28:05 UTC (rev 634)
+++ trunk/richfaces/menu-components/src/test/java/org/richfaces/component/MenuItemComponentTest.java 2007-05-03 14:32:10 UTC (rev 635)
@@ -58,7 +58,7 @@
private static Set javaScripts = new HashSet();
static {
- javaScripts.add("prototype.js");
+ javaScripts.add("PrototypeScript");
javaScripts.add("AjaxScript");
javaScripts.add("CommandScript");
}
@@ -102,7 +102,7 @@
* MenuItem rendering test.
*/
public void testMenuItemRender() throws Exception {
- menuItem.setSubmitMode(MenuComponent.MODE_NONE);
+ menuItem.setMode(MenuComponent.MODE_NONE);
HtmlPage page = renderView();
assertNotNull(page);
// System.out.println(page.asXml());
@@ -191,7 +191,7 @@
public void testEnabledMenuItemServerMode() throws Exception {
assertEquals(false, menuItem.isDisabled());
menuItem.getAttributes().put("iconClass", "iconClass");
- menuItem.setSubmitMode(MenuComponent.MODE_SERVER);
+ menuItem.setMode(MenuComponent.MODE_SERVER);
menuItem.getAttributes().put("target", "target");
menuItem.getAttributes().put("selectStyle", "menuItemSelectStyle");
HtmlPage page = renderView();
@@ -201,7 +201,7 @@
.getClientId(facesContext)
+ ":anchor");
assertNotNull(anchor);
- assertEquals("a", anchor.getNodeName());
+ assertEquals("span", anchor.getNodeName());
String classAttr = anchor.getAttributeValue("class");
assertTrue(classAttr.contains("rich-menu-item-label"));
@@ -233,7 +233,7 @@
* Test for enabled MenuItem component in "ajax" mode.
*/
public void testEnabledMenuItemAJAXMode() throws Exception {
- menuItem.setSubmitMode(MenuComponent.MODE_AJAX);
+ menuItem.setMode(MenuComponent.MODE_AJAX);
menuItem.getAttributes().put("style", "menuItemStyle");
HtmlPage page = renderView();
assertNotNull(page);
@@ -251,7 +251,7 @@
* Test for enabled MenuItem component in "none" mode.
*/
public void testEnabledMenuItemNoneMode() throws Exception {
- menuItem.setSubmitMode(MenuComponent.MODE_NONE);
+ menuItem.setMode(MenuComponent.MODE_NONE);
HtmlPage page = renderView();
assertNotNull(page);
// System.out.println(page.asXml());
@@ -274,7 +274,7 @@
assertNotNull(links);
HtmlElement link = (HtmlElement) links.get(0);
assertTrue(link.getAttributeValue("href").contains(
- "org/richfaces/renderkit/html/css/menucomponents.xcss"));
+ "menucomponents.xcss"));
}
/**
@@ -312,7 +312,7 @@
public void testMenuItemDoDecodeAJAXMode() throws Exception {
menuItem.setImmediate(true);
- menuItem.setSubmitMode(MenuComponent.MODE_AJAX);
+ menuItem.setMode(MenuComponent.MODE_AJAX);
externalContext.getRequestParameterMap().put(
menuItem.getClientId(facesContext), "Action");
@@ -331,7 +331,7 @@
public void testMenuItemDoDecodeServerMode() throws Exception {
menuItem.setImmediate(false);
- menuItem.setSubmitMode(MenuComponent.MODE_SERVER);
+ menuItem.setMode(MenuComponent.MODE_SERVER);
externalContext.getRequestParameterMap().put(
menuItem.getClientId(facesContext) + ":hidden", "Action");
@@ -366,16 +366,17 @@
public void testRenderImages() throws Exception {
renderView();
InternetResourceBuilder builder = ResourceBuilderImpl.getInstance();
- InternetResource resource = builder.createResource(null, MenuItemBackground.class.getName());
+ InternetResource resource = builder.createResource(null,
+ MenuItemBackground.class.getName());
assertNotNull(resource);
String uri = "http:" + resource.getUri(facesContext, null);
Page page = webClient.getPage(uri);
assertTrue(page.getWebResponse().getStatusCode() == HttpServletResponse.SC_OK);
ImageInfo info = new ImageInfo();
info.setInput(page.getWebResponse().getContentAsStream());
- //image recognizable?
+ // image recognizable?
assertTrue(info.check());
assertEquals(ImageInfo.FORMAT_GIF, info.getFormat());
}
-
+
}
17 years, 8 months