JBoss Rich Faces SVN: r1349 - trunk/richfaces/tree/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: A.Skokov
Date: 2007-06-27 12:33:47 -0400 (Wed, 27 Jun 2007)
New Revision: 1349
Modified:
trunk/richfaces/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree-item.js
trunk/richfaces/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree.js
Log:
http://jira.jboss.com/jira/browse/RF-295
Modified: trunk/richfaces/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree-item.js
===================================================================
--- trunk/richfaces/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree-item.js 2007-06-27 16:17:02 UTC (rev 1348)
+++ trunk/richfaces/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree-item.js 2007-06-27 16:33:47 UTC (rev 1349)
@@ -18,10 +18,10 @@
if (this.onContextMenu) {
this.eventRightClick = this.onContextMenu.bindAsEventListener();
}
-
+
this.observeEvents();
},
-
+
observeEvents: function() {
Event.observe(this.elements.icon, "mousedown", this.eventSelectionClick);
Event.observe(this.elements.text, "mousedown", this.eventSelectionClick);
@@ -46,9 +46,9 @@
this.elements.text.oncontextmenu = this.eventRightClick;
}
},
-
+
getElements: function() {
- ($(this.id)).object = this;
+ //($(this.id)).object = this; //dublicate: see initialize()
this.nodeStateInput = $(this.id + "NodeExpanded");
this.childs = [];
var childsRowId = this.id + Tree.ID_DEVIDER + Tree.ID_CHILDS_ROW;
@@ -60,22 +60,29 @@
this.elements.handleImgCollapsed = $(handleId + Tree.ID_DEVIDER + Tree.ID_HANDLE_IMG_COLLAPSED);
this.elements.icon = $(this.id + Tree.ID_DEVIDER + Tree.ID_ICON);
this.elements.text = $(this.id + Tree.ID_DEVIDER + Tree.ID_TEXT);
-
+
var contextMenu = Richfaces.getNSAttribute("oncontextmenu", this.elements.icon);
if (contextMenu && contextMenu.length > 0) {
this.onContextMenu = new Function(contextMenu + "; return true;");
}
-
+
var childsTd = $(childsRowId + Tree.ID_DEVIDER + Tree.ID_CHILDS_TD);
if (childsTd) {
- for (var i = 0; i < childsTd.childNodes.length; i++) {
+ for(var child = childsTd.firstChild; child != null; child = child.nextSibling ) {
+ if (child.nodeType == 1 && child.tagName.toLowerCase() == "table") {
+ this.addChild(new Tree.Item(child.id, this.tree, this, this.childs.length, this.switchType, this.toggleOnClick));
+ }
+ }
+ /*
+ for (var i = 0; i < childsTd.childNodes.length; i++) {
var child = childsTd.childNodes[i];
if (child.nodeType == 1 && child.tagName.toLowerCase() == "table") {
this.addChild(new Tree.Item(child.id, this.tree, this, this.childs.length, this.switchType, this.toggleOnClick));
}
}
+ */
}
-
+
this.elements.mainRow = $(mainRowId);
},
@@ -87,29 +94,29 @@
fireExpansionEvent: function() {
var props = new Object();
props[Richfaces.TreeExpandEvent] = true;
- props["expandedNode"] = this.id;
- props["treeItem"] = this;
+ props["expandedNode"] = this.id;
+ props["treeItem"] = this;
Richfaces.createEvent("click", this.tree.element, null, props).fire();
},
fireCollapsionEvent: function() {
var props = new Object();
props[Richfaces.TreeCollapseEvent] = true;
- props["collapsedNode"] = this.id;
- props["treeItem"] = this;
+ props["collapsedNode"] = this.id;
+ props["treeItem"] = this;
Richfaces.createEvent("click", this.tree.element, null, props).fire();
},
toggleCollapsion: function() {
if (this.hasChilds()) Element.toggle(this.elements.row);
-
+
// Rerender main row to avoid bad representation in Opera and Konqueror/Safari
if (this.elements.mainRow) {
Element.hide(this.elements.mainRow);
Element.show(this.elements.mainRow);
}
-
+
if (this.isCollapsed()) {
this.elements.handleImgExpanded.style.display="none";
this.elements.handleImgCollapsed.style.display="";
@@ -117,11 +124,11 @@
Element.removeClassName(this.elements.icon, Tree.CLASS_ITEM_EXPANDED);
Element.addClassName(this.elements.icon, Tree.CLASS_ITEM_COLLAPSED);
}
-
+
if (this.nodeStateInput) {
this.nodeStateInput.value = "false";
}
-
+
this.fireCollapsionEvent();
} else {
this.elements.handleImgExpanded.style.display="";
@@ -134,7 +141,7 @@
if (this.nodeStateInput) {
this.nodeStateInput.value = "true";
}
-
+
this.fireExpansionEvent();
}
@@ -148,7 +155,7 @@
if (!this.isCollapsed() && this.switchType!="client") {
if (this.toggleOnClick) {
if (this.elements.mainRow)
- this.elements.mainRow.onclick();
+ this.elements.mainRow.onclick();
} else {
if (this.elements.handle)
this.elements.handle.onclick();
@@ -171,7 +178,7 @@
if (this.isCollapsed() && this.switchType!="client") {
if (this.toggleOnClick) {
if (this.elements.mainRow)
- this.elements.mainRow.onclick();
+ this.elements.mainRow.onclick();
} else {
if (this.elements.handle)
this.elements.handle.onclick();
@@ -209,7 +216,7 @@
}
if (window.drag){
this.dragLeave(e);
- }
+ }
}
}
},
@@ -225,7 +232,7 @@
}
if (window.drag) {
this.dragEnter(e);
- }
+ }
}
}
},
@@ -233,63 +240,63 @@
toggleSelection: function(e) {
if (e && !e[Richfaces.TreeSelectEvent] && !Richfaces.eventIsSynthetic(e)) {
if (e && e.type == "mousedown" /* can be keydown */) {
- if(Event.isLeftClick(e)) {
+ if(Event.isLeftClick(e)) {
var src = Event.element(e);
if(src.tagName && (
src.tagName.toUpperCase() == 'INPUT' ||
src.tagName.toUpperCase() == 'SELECT' ||
src.tagName.toUpperCase() == 'OPTION' ||
src.tagName.toUpperCase() == 'BUTTON' ||
- src.tagName.toUpperCase() == 'TEXTAREA'))
+ src.tagName.toUpperCase() == 'TEXTAREA'))
return;
-
+
Event.stop(e);
} else {
- //do not process non-left clicks
+ //do not process non-left clicks
return ;
}
}
var props = new Object();
props[Richfaces.TreeSelectEvent] = true;
- props["originatingEventType"] = e.type;
- props["treeItem"] = this;
- props["selectedNode"] = this.id;
+ props["originatingEventType"] = e.type;
+ props["treeItem"] = this;
+ props["selectedNode"] = this.id;
var evt = Richfaces.createEvent("click", this.tree.element, null, props);
evt.fire();
-
+
return !evt.event["cancelSelection"];
} else {
this.tree.deselectAll();
-
+
/*
var attr = this.elements.text.attributes;
var s = "";
for (var i = 0; i < attr.length; i++) {
s += attr[i].nodeName + ": " + attr[i].nodeValue + "; ";
}
-
+
alert(s);
*/
-
+
var sClass = Richfaces.getNSAttribute("selectedclass", this.elements.text);
if (sClass) {
-
+
var classNames = sClass.split(' ')
for (var i = 0; i < classNames.length; i++) {
Element.addClassName(this.elements.text, classNames[i]);
}
this.tree.input.value = this.id;
this.tree.selectionManager.activeItem = this;
-
+
if (this.tree.options.onSelection) this.tree.options.onSelection(this.id);
this.tree.showNode(this.elements.text.parentNode);
-
+
if (e && e["originatingEventType"] == "mousedown" /* can be keydown */) {
this.startDrag(e);
}
}
-
+
return true;
}
},
Modified: trunk/richfaces/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree.js
===================================================================
--- trunk/richfaces/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree.js 2007-06-27 16:17:02 UTC (rev 1348)
+++ trunk/richfaces/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree.js 2007-06-27 16:33:47 UTC (rev 1349)
@@ -35,7 +35,7 @@
this.inputId = input;
this.input = $(this.inputId);
this.toggleOnClick = toggleOnClick;
-
+
var options = Object.extend({
columnCount: 0
}, arguments[1] || {}
@@ -51,27 +51,27 @@
Event.observe(this.element, "click", function(event) {
if (Richfaces.eventIsSynthetic(event)) {
var treeItem = event["treeItem"];
-
+
if (event[Richfaces.TreeSelectEvent]){
Event.stop(event);
-
+
var itemOnSelect = treeItem.getRichAttribute("onselected");
itemOnSelect = new Function('event', (itemOnSelect ? itemOnSelect : "") + "; return true;");
-
- var selectResult = itemOnSelect(event);
+
+ var selectResult = itemOnSelect(event);
if (!selectResult) {
event["cancelSelection"] = true;
- return ;
+ return ;
}
- selectResult = this.onselect(event);
+ selectResult = this.onselect(event);
if (!selectResult) {
event["cancelSelection"] = true;
- return ;
+ return ;
}
-
+
treeItem.toggleSelection(event);
-
+
var attr = Richfaces.getNSAttribute("ajaxselectedlistener", $(event.selectedNode + Tree.ID_DEVIDER + Tree.ID_ICON));
if (attr) {
this.onAjaxSelect(event);
@@ -84,7 +84,7 @@
new Function('event', handler).call(Event.element(event), event);
}
- this.onexpand(event);
+ this.onexpand(event);
} else if (event[Richfaces.TreeCollapseEvent]){
Event.stop(event);
@@ -92,8 +92,8 @@
if (handler) {
new Function('event', handler).call(Event.element(event), event);
}
-
- this.oncollapse(event);
+
+ this.oncollapse(event);
}
}
}.bindAsEventListener(this));
@@ -109,12 +109,19 @@
this.elements.contentTd = $(contentId);
if (this.elements.contentTd) {
- for (var i = 0; i < this.elements.contentTd.childNodes.length; i++) {
+ for(var child = this.elements.contentTd.firstChild; child != null; child = child.nextSibling ) {
+ if (child.nodeType == 1 && child.tagName.toLowerCase() == "table") {
+ this.addChild(new Tree.Item(child.id, this, this, this.childs.length, this.switchType, this.toggleOnClick));
+ }
+ }
+ /*
+ for (var i = 0; i < this.elements.contentTd.childNodes.length; i++) {
var child = this.elements.contentTd.childNodes[i];
if (child.nodeType == 1 && child.tagName.toLowerCase() == "table") {
this.addChild(new Tree.Item(child.id, this, this, this.childs.length, this.switchType, this.toggleOnClick));
}
}
+ */
}
},
@@ -126,7 +133,7 @@
var dim = {};
var bc = {width: 0, height: 0};
-
+
/* - commented by nick
if (/MSIE/.test(navigator.userAgent)) {
bc.width = parseInt(Element.getStyle(this.element, "border-left-width")) + parseInt(Element.getStyle(this.element, "border-right-width"));
@@ -161,7 +168,7 @@
this.items.each(function(item) {item.deselect();} );
},
-
+
getNodeElements: function(nodeIds) {
if (nodeIds) {
for (var i = 0; i < nodeIds.length; i++ ) {
@@ -171,7 +178,7 @@
this.selectionManager.restoreSelection();
}
},
-
+
_getNodeElements: function(node, nodeId) {
if (node.id == nodeId) {
node.getElements();
@@ -183,7 +190,7 @@
}
}
},
-
+
showNode: function(itemNode) {
var node = itemNode;
var offsetTopItem = 0;
@@ -201,7 +208,7 @@
this.element.scrollTop = nodeBottom - this.element.clientHeight;
}
},
-
+
getElement: function() {
return $(this.id);
}
17 years, 6 months
JBoss Rich Faces SVN: r1348 - trunk/sandbox/scrollable-grid/src/test/java/org/richfaces/component/html.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2007-06-27 12:17:02 -0400 (Wed, 27 Jun 2007)
New Revision: 1348
Modified:
trunk/sandbox/scrollable-grid/src/test/java/org/richfaces/component/html/HtmlScrollableGridColumnComponentTest.java
Log:
Modified: trunk/sandbox/scrollable-grid/src/test/java/org/richfaces/component/html/HtmlScrollableGridColumnComponentTest.java
===================================================================
--- trunk/sandbox/scrollable-grid/src/test/java/org/richfaces/component/html/HtmlScrollableGridColumnComponentTest.java 2007-06-27 16:14:30 UTC (rev 1347)
+++ trunk/sandbox/scrollable-grid/src/test/java/org/richfaces/component/html/HtmlScrollableGridColumnComponentTest.java 2007-06-27 16:17:02 UTC (rev 1348)
@@ -26,8 +26,8 @@
// public static final String COMPONENT_TYPE = "org.richfaces.component.ScrollableGridColumn";
- private boolean _breakBeforeSet = false;
- private boolean _sortableSet = false;
+ private boolean _breakBeforeSet = false;
+ private boolean _sortableSet = false;
private HtmlScrollableGridColumn component;
private UIForm form;
@@ -51,13 +51,13 @@
facesContext.getViewRoot().getChildren().add(form);
component.setId("component");
- component.setWidth("width" );
- component.setHeaderClass("headerClass" );
- component.setFooterClass("footerClass" );
- component.setStyleClass("styleClass" );
- component.setBreakBefore(true );
- component.setStyle("style" );
- component.setSortable(true );
+ component.setWidth("width" );
+ component.setHeaderClass("headerClass" );
+ component.setFooterClass("footerClass" );
+ component.setStyleClass("styleClass" );
+ component.setBreakBefore(true );
+ component.setStyle("style" );
+ component.setSortable(true );
form.getChildren().add(component);
@@ -105,31 +105,31 @@
public void testGetters() {
HtmlScrollableGridColumn component = new HtmlScrollableGridColumn();
- component.setValueBinding("width", new MockValueBinding("width", java.lang.String.class));
+ component.setValueBinding("width", new MockValueBinding("width", java.lang.String.class));
assertEquals("width", component.getWidth());
component.setWidth("width_width" );
assertEquals("width_width", component.getWidth());
- component.setValueBinding("headerClass", new MockValueBinding("headerClass", java.lang.String.class));
+ component.setValueBinding("headerClass", new MockValueBinding("headerClass", java.lang.String.class));
assertEquals("headerClass", component.getHeaderClass());
component.setHeaderClass("headerClass_headerClass" );
assertEquals("headerClass_headerClass", component.getHeaderClass());
- component.setValueBinding("footerClass", new MockValueBinding("footerClass", java.lang.String.class));
+ component.setValueBinding("footerClass", new MockValueBinding("footerClass", java.lang.String.class));
assertEquals("footerClass", component.getFooterClass());
component.setFooterClass("footerClass_footerClass" );
assertEquals("footerClass_footerClass", component.getFooterClass());
- component.setValueBinding("styleClass", new MockValueBinding("styleClass", java.lang.String.class));
+ component.setValueBinding("styleClass", new MockValueBinding("styleClass", java.lang.String.class));
assertEquals("styleClass", component.getStyleClass());
component.setStyleClass("styleClass_styleClass" );
assertEquals("styleClass_styleClass", component.getStyleClass());
- component.setValueBinding("breakBefore", new MockValueBinding(new Boolean(true), java.lang.Boolean.class));
+ component.setValueBinding("breakBefore", new MockValueBinding(new Boolean(true), java.lang.Boolean.class));
assertEquals(true, component.isBreakBefore());
component.setBreakBefore(false );
assertEquals(false, component.isBreakBefore());
- component.setValueBinding("style", new MockValueBinding("style", java.lang.String.class));
+ component.setValueBinding("style", new MockValueBinding("style", java.lang.String.class));
assertEquals("style", component.getStyle());
component.setStyle("style_style" );
assertEquals("style_style", component.getStyle());
- component.setValueBinding("sortable", new MockValueBinding(new Boolean(true), java.lang.Boolean.class));
+ component.setValueBinding("sortable", new MockValueBinding(new Boolean(true), java.lang.Boolean.class));
assertEquals(true, component.isSortable());
component.setSortable(false );
assertEquals(false, component.isSortable());
@@ -141,13 +141,13 @@
HtmlScrollableGridColumn restoredComponent = new HtmlScrollableGridColumn();
restoredComponent.restoreState(facesContext, state);
- assertEquals(component.getWidth(), restoredComponent.getWidth());
- assertEquals(component.getHeaderClass(), restoredComponent.getHeaderClass());
- assertEquals(component.getFooterClass(), restoredComponent.getFooterClass());
- assertEquals(component.getStyleClass(), restoredComponent.getStyleClass());
- assertEquals(component.isBreakBefore(), restoredComponent.isBreakBefore());
- assertEquals(component.getStyle(), restoredComponent.getStyle());
- assertEquals(component.isSortable(), restoredComponent.isSortable());
+ assertEquals(component.getWidth(), restoredComponent.getWidth());
+ assertEquals(component.getHeaderClass(), restoredComponent.getHeaderClass());
+ assertEquals(component.getFooterClass(), restoredComponent.getFooterClass());
+ assertEquals(component.getStyleClass(), restoredComponent.getStyleClass());
+ assertEquals(component.isBreakBefore(), restoredComponent.isBreakBefore());
+ assertEquals(component.getStyle(), restoredComponent.getStyle());
+ assertEquals(component.isSortable(), restoredComponent.isSortable());
}
17 years, 6 months
JBoss Rich Faces SVN: r1347 - trunk/sandbox/scrollable-grid/src/test/java/org/richfaces/renderkit/html.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2007-06-27 12:14:30 -0400 (Wed, 27 Jun 2007)
New Revision: 1347
Modified:
trunk/sandbox/scrollable-grid/src/test/java/org/richfaces/renderkit/html/ScrollableGridRendererTest.java
Log:
test inputs
Modified: trunk/sandbox/scrollable-grid/src/test/java/org/richfaces/renderkit/html/ScrollableGridRendererTest.java
===================================================================
--- trunk/sandbox/scrollable-grid/src/test/java/org/richfaces/renderkit/html/ScrollableGridRendererTest.java 2007-06-27 16:00:50 UTC (rev 1346)
+++ trunk/sandbox/scrollable-grid/src/test/java/org/richfaces/renderkit/html/ScrollableGridRendererTest.java 2007-06-27 16:14:30 UTC (rev 1347)
@@ -121,16 +121,33 @@
String classAttr = div.getAttributeValue("class");
assertTrue(classAttr.contains("ClientUI_Grid"));
-
Iterator childIter= div.getChildElementsIterator();
+ String id = grid.getId();
+
+ HtmlElement input = page.getHtmlElementById(id+"_hc");
+ assertNotNull(input);
+ input = null;
+ input = page.getHtmlElementById(id + "_state_input");
+ assertNotNull(input);
+ input = null;
+ input = page.getHtmlElementById(id + "_options_input");
+ assertNotNull(input);
+ input = null;
+ input = page.getHtmlElementById(id + "_rows_input");
+ assertNotNull(input);
+ input = null;
+ input = page.getHtmlElementById(id + "_submit_input");
+ assertNotNull(input);
+ input = null;
+
for (; childIter.hasNext();) {
HtmlElement elem = (HtmlElement) childIter.next();
assertNotNull(elem);
boolean res = (elem.getNodeName().equals("div") || elem.getNodeName().equals("input"));
- assertEquals(true, res);
+ assertTrue(res);
if(elem.getNodeName().equals("div")){
@@ -159,7 +176,7 @@
assertTrue(elemClassAttr.contains("ClientUI_TmplBox ClientUI_NormalBox"));
}
- String id = grid.getId();
+
for (int i = 0; i < columns; i++) {
HtmlElement hcell = page.getHtmlElementById(id + ":hc_" + i);
17 years, 6 months
JBoss Rich Faces SVN: r1346 - trunk/sandbox/scrollable-grid/src/test/java/org/richfaces/renderkit/html.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2007-06-27 12:00:50 -0400 (Wed, 27 Jun 2007)
New Revision: 1346
Modified:
trunk/sandbox/scrollable-grid/src/test/java/org/richfaces/renderkit/html/ScrollableGridRendererTest.java
Log:
add test methods for styles and scripts
Modified: trunk/sandbox/scrollable-grid/src/test/java/org/richfaces/renderkit/html/ScrollableGridRendererTest.java
===================================================================
--- trunk/sandbox/scrollable-grid/src/test/java/org/richfaces/renderkit/html/ScrollableGridRendererTest.java 2007-06-27 15:29:20 UTC (rev 1345)
+++ trunk/sandbox/scrollable-grid/src/test/java/org/richfaces/renderkit/html/ScrollableGridRendererTest.java 2007-06-27 16:00:50 UTC (rev 1346)
@@ -1,20 +1,22 @@
package org.richfaces.renderkit.html;
-import java.util.ArrayList;
+import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
+import java.util.Set;
import javax.faces.component.UIOutput;
import javax.faces.component.html.HtmlOutputText;
-import org.ajax4jsf.ajax.repeat.ExtendedDataModel;
import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
+import org.apache.commons.lang.StringUtils;
import org.richfaces.component.UIScrollableGridColumn;
import org.richfaces.component.html.HtmlScrollableGrid;
import org.richfaces.component.html.HtmlScrollableGridColumn;
import com.gargoylesoftware.htmlunit.html.HtmlElement;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
+import com.gargoylesoftware.htmlunit.html.HtmlScript;
/**
* @author Anton Belevich
@@ -24,7 +26,15 @@
HtmlScrollableGrid grid;
int columns = 7;
+ private static Set javaScripts = new HashSet();
+ static {
+ javaScripts.add("org.ajax4jsf.framework.ajax.AjaxScript");
+ javaScripts.add("org.ajax4jsf.framework.resource.PrototypeScript");
+ javaScripts.add("org.ajax4jsf.framework.resource.PrototypeScript");
+ javaScripts.add("org/richfaces/renderkit/html/scripts/scrollable-grid.js");
+ }
+
public ScrollableGridRendererTest(String arg0) {
super(arg0);
}
@@ -66,11 +76,45 @@
grid = null;
}
+ public void testRenderStyle() throws Exception {
+ HtmlPage page = renderView();
+ assertNotNull(page);
+ List links = page.getDocumentElement().getHtmlElementsByTagName("link");
+ assertNotNull(links);
+ HtmlElement link = (HtmlElement)links.get(0);
+ assertTrue(link.getAttributeValue("href").contains("css/grid.xcss"));
+ }
+ public void testRenderScripts() throws Exception {
+ HtmlPage page = renderView();
+ assertNotNull(page);
+ List scripts = page.getDocumentElement().getHtmlElementsByTagName("script");
+ for (Iterator it = scripts.iterator(); it.hasNext();) {
+ HtmlScript item = (HtmlScript) it.next();
+ String srcAttr = item.getSrcAttribute();
+
+ if (StringUtils.isNotBlank(srcAttr)) {
+ boolean found = false;
+ for (Iterator srcIt = javaScripts.iterator(); srcIt.hasNext();)
+ {
+ String src = (String) srcIt.next();
+ found = srcAttr.contains(src);
+ if (found) {
+ break;
+ }
+ }
+ assertTrue(found);
+ }
+ }
+ }
+
+
public void testRenderingFrozenNormalColumns()throws Exception{
HtmlPage page = renderView();
assertNotNull(page);
+
+
HtmlElement div = page.getHtmlElementById(grid.getClientId(facesContext));
assertNotNull(div);
assertEquals("div", div.getNodeName());
17 years, 6 months
JBoss Rich Faces SVN: r1345 - trunk/docs/userguide/en/src/main/docbook/modules.
by richfaces-svn-commits@lists.jboss.org
Author: vkorluzhenko
Date: 2007-06-27 11:29:20 -0400 (Wed, 27 Jun 2007)
New Revision: 1345
Modified:
trunk/docs/userguide/en/src/main/docbook/modules/RFCfaq.xml
Log:
fixed spelling errors
Modified: trunk/docs/userguide/en/src/main/docbook/modules/RFCfaq.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/modules/RFCfaq.xml 2007-06-27 15:25:01 UTC (rev 1344)
+++ trunk/docs/userguide/en/src/main/docbook/modules/RFCfaq.xml 2007-06-27 15:29:20 UTC (rev 1345)
@@ -374,7 +374,7 @@
</section>
<section>
- <?dbhtml filename="Howtoretrievethecurrentvalue"?>
+ <?dbhtml filename="Howtoapplyskins"?>
<title>How to apply skins to the standard input components?</title>
<para>The answer could be found <ulink
url="http://www.jboss.com/index.html?module=bb&op=viewtopic&t=103494"
@@ -382,16 +382,16 @@
</section>
<section>
- <?dbhtml filename="Howtoretrievethecurrentvalue"?>
- <title>Is there a way to capture the rowdata of a dataTable and rich:subTable?</title>
+ <?dbhtml filename="Isthereawaytocapturetherowdata"?>
+ <title>Is there a way to capture the rowdata of dataTable and rich:subTable?</title>
<para> For information you can see discussion about this problem on the <ulink
url="http://jboss.com/index.html?module=bb&op=viewtopic&t=111965"
>RichFaces Users Forum</ulink></para>
</section>
<section>
- <?dbhtml filename="Howtoretrievethecurrentvalue"?>
- <title>Is it possible to use the datascroller without it's table border and styles (to show only the links)?</title>
+ <?dbhtml filename="Isitpossibletouse thedatascroller"?>
+ <title>Is it possible to use datascroller without it's table border and styles (to show only links)?</title>
<para> It' necessary to redefine rich* classes for example like this:</para>
<programlisting role="JAVA"><![CDATA[.rich-datascr-button {
border: 0px;
17 years, 6 months
JBoss Rich Faces SVN: r1344 - in trunk/richfaces/modal-panel/src/main: templates/org/richfaces and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: sergeyhalipov
Date: 2007-06-27 11:25:01 -0400 (Wed, 27 Jun 2007)
New Revision: 1344
Modified:
trunk/richfaces/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js
trunk/richfaces/modal-panel/src/main/templates/org/richfaces/htmlModalPanel.jspx
Log:
Some improvements for RF-46.
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-06-27 15:24:39 UTC (rev 1343)
+++ trunk/richfaces/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js 2007-06-27 15:25:01 UTC (rev 1344)
@@ -288,9 +288,9 @@
return false;
},
- processTabindexes: function(inputs, tabindex) {
- if (!inputs || !tabindex || !inputs.length)
- return tabindex;
+ processTabindexes: function(inputs) {
+ if (!inputs || !inputs.length)
+ return ;
for (var i = 0; i < inputs.length; i++) {
if (!this.isInModalPanel(inputs[i])) {
if (!this.firstOutside)
@@ -298,16 +298,14 @@
this.lastOutside = inputs[i];
if (inputs[i].tabIndex) {
inputs[i].prevTabIndex = inputs[i].tabIndex;
- inputs[i].tabIndex = tabindex;
}
+ inputs[i].tabIndex = null;
if (inputs[i].accesskey) {
inputs[i].prevAccesskey = inputs[i].accesskey;
- inputs[i].accesskey = undefined;
}
- tabindex--;
+ inputs[i].accesskey = undefined;
}
}
- return tabindex;
},
restoreTabindexes: function(inputs) {
@@ -315,24 +313,23 @@
return;
for (var i = 0; i < inputs.length; i++) {
if (!this.isInModalPanel(inputs[i])) {
- if (inputs[i].prevTabIndex)
- inputs[i].tabIndex = inputs[i].prevTabIndex;
- if (inputs[i].prevAccesskey)
- inputs[i].accesskey = inputs[i].prevAccesskey;
+ inputs[i].tabIndex = inputs[i].prevTabIndex;
+ inputs[i].accesskey = inputs[i].prevAccesskey;
}
}
},
preventFocus: function() {
- var tabindex = 32768;
var inputs = document.getElementsByTagName("input");
- tabindex = this.processTabindexes(inputs, tabindex);
+ this.processTabindexes(inputs);
var selects = document.getElementsByTagName("select");
- tabindex = this.processTabindexes(selects, tabindex);
+ this.processTabindexes(selects);
var buttons = document.getElementsByTagName("button");
- tabindex = this.processTabindexes(buttons, tabindex);
+ this.processTabindexes(buttons);
var hrefs = document.getElementsByTagName("a");
- tabindex = this.processTabindexes(hrefs, tabindex);
+ this.processTabindexes(hrefs);
+ var texts = document.getElementsByTagName("textarea");
+ this.processTabindexes(texts);
if (this.firstOutside) {
Event.observe(this.firstOutside, "focus", this.eventFirstOnfocus);
@@ -340,8 +337,6 @@
if (this.lastOutside) {
Event.observe(this.lastOutside, "focus", this.eventLastOnfocus);
}
- if (RichFaces.navigatorType() != "MSIE")
- this.lastOnfocus();
},
restoreFocus: function() {
@@ -353,6 +348,8 @@
this.restoreTabindexes(buttons);
var hrefs = document.getElementsByTagName("a");
this.restoreTabindexes(hrefs);
+ var texts = document.getElementsByTagName("textarea");
+ this.restoreTabindexes(texts);
if (this.firstOutside) {
Event.stopObserving(this.firstOutside, "focus", this.eventFirstOnfocus);
@@ -516,6 +513,8 @@
var event = {};
event.parameters = opts || {};
if (this.eventOnShow) this.eventOnShow(event);
+
+ this.lastOnfocus();
},
startDrag: function(border) {
Modified: trunk/richfaces/modal-panel/src/main/templates/org/richfaces/htmlModalPanel.jspx
===================================================================
--- trunk/richfaces/modal-panel/src/main/templates/org/richfaces/htmlModalPanel.jspx 2007-06-27 15:24:39 UTC (rev 1343)
+++ trunk/richfaces/modal-panel/src/main/templates/org/richfaces/htmlModalPanel.jspx 2007-06-27 15:25:01 UTC (rev 1344)
@@ -73,9 +73,9 @@
<div style="position: absolute; overflow: hidden; z-index: 2;"
class="dr-mpnl-pnl" id="#{clientId}ContentDiv">
-
- <table style="height: 100%; width: 100%;" border="0" cellpadding="0" cellspacing="0">
- <a href="#" style="position: absolute; left: -32000" id="#{clientId}FirstHref" >_</a>
+
+ <a href="#" style="position: absolute; left: -32000" 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()) {]]>
</jsp:scriptlet>
17 years, 6 months
JBoss Rich Faces SVN: r1343 - trunk/docs/userguide/en/src/main/docbook/modules.
by richfaces-svn-commits@lists.jboss.org
Author: vkorluzhenko
Date: 2007-06-27 11:24:39 -0400 (Wed, 27 Jun 2007)
New Revision: 1343
Modified:
trunk/docs/userguide/en/src/main/docbook/modules/RFCfaq.xml
Log:
added new questions
Modified: trunk/docs/userguide/en/src/main/docbook/modules/RFCfaq.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/modules/RFCfaq.xml 2007-06-27 14:52:01 UTC (rev 1342)
+++ trunk/docs/userguide/en/src/main/docbook/modules/RFCfaq.xml 2007-06-27 15:24:39 UTC (rev 1343)
@@ -88,6 +88,9 @@
<para><ulink
url="http://www.jboss.com/index.html?module=bb&op=viewtopic&t=111143"
>Here</ulink> is an article that explains the Skinnability basics.</para>
+ <para> For information you can also see discussion about this problem on the <ulink
+ url="http://www.jboss.com/index.html?module=bb&op=viewtopic&t=103772"
+ >RichFaces Users Forum</ulink></para>
<para>Also, the effect of predefined skins on the application whole look-and-feel
could be seen <ulink url="http://livedemo.exadel.com/richfaces-demo/"
>here</ulink>.</para>
@@ -95,8 +98,8 @@
<section>
<?dbhtml filename="WhyRichFaceslibrarycondataTablecomp"?>
- <title>Why RichFaces library contains <rich:dataTable> component, though there is
- the standard <h:dataTable></title>
+ <title>Why RichFaces library contains <rich:dataTable> component,
+ though there is the standard <h:dataTable></title>
<para>The answer could be found <ulink
url="http://labs.jboss.com/wiki/RichFacesArticleDataTable"
>here</ulink>.</para>
@@ -226,8 +229,8 @@
<section>
<?dbhtml filename="Isitpossibletocustomizelookofdatascroller"?>
- <title>Is it possible to customize the look of dataScroller (the forward/back buttons)
- and replace them with an images?</title>
+ <title>Is it possible to customize the look of dataScroller (the forward/back
+ buttons) and replace them with an images?</title>
<para>The answer is yes. Use facets: "first_disabled",
"last_disabled", "next_disabled",
"previous_disabled",
@@ -245,8 +248,8 @@
<section>
<?dbhtml filename="Howtoredirecttoanotherpage"?>
<title><rich:dropDown> component: How to redirect to another page?</title>
- <para>If you want to navigate outside, when application uses an external URL, you should use the
- following approach:</para>
+ <para>If you want to navigate outside, when application uses an external URL, you
+ should use the following approach:</para>
<programlisting role="XML"><![CDATA[...
<rich:dropDownMenu>
…
@@ -271,10 +274,10 @@
<?dbhtml filename="CanthedropDownMenubeincludedintreenodes"?>
<title>Can dropDownMenu be included in tree nodes?</title>
<para>The <emphasis role="bold"><rich:dropDownMenu></emphasis> is
- designed keeping in mind that it should not be used for a contextMenu purpose.
- We have a <emphasis role="bold"><rich:contextMenu></emphasis>
- component in the TODO list. However, it is not schedule for the nearest
- versions.</para>
+ designed keeping in mind that it should not be used for a contextMenu
+ purpose. We have a <emphasis role="bold"
+ ><rich:contextMenu></emphasis> component in the TODO list.
+ However, it is not schedule for the nearest versions.</para>
</section>
<section>
@@ -333,7 +336,8 @@
<para>To implement this feature use the "action" attribute of
<emphasis role="bold"><rich:tab></emphasis> and
"selectedTab" of the <emphasis role="bold"
- ><rich:tabPanel></emphasis>. Simple code is placed below:</para>
+ ><rich:tabPanel></emphasis>. Simple code is placed
+ below:</para>
<programlisting role="XML"><![CDATA[...
<rich:tab label="MyName" id="MyName" action="#{MySessionBean.activateSecuritySettingsTab}" >
...
@@ -348,8 +352,8 @@
<section>
<?dbhtml filename="Howtoretrievethecurrentvalue"?>
<title>How to retrieve the current value from the inputNumberSlider?</title>
- <para>To catch the value of the inputNumberSlider from the JavaScrip, use
- the following approach:</para>
+ <para>To catch the value of the inputNumberSlider from the JavaScrip, use the
+ following approach:</para>
<programlisting role="XML"><![CDATA[...
<rich:inputNumberSlider width="500" step="20"
onchange="someFunctionCall(this.input.value)"
@@ -376,5 +380,28 @@
url="http://www.jboss.com/index.html?module=bb&op=viewtopic&t=103494"
>here</ulink>.</para>
</section>
+
+ <section>
+ <?dbhtml filename="Howtoretrievethecurrentvalue"?>
+ <title>Is there a way to capture the rowdata of a dataTable and rich:subTable?</title>
+ <para> For information you can see discussion about this problem on the <ulink
+ url="http://jboss.com/index.html?module=bb&op=viewtopic&t=111965"
+ >RichFaces Users Forum</ulink></para>
+ </section>
+
+ <section>
+ <?dbhtml filename="Howtoretrievethecurrentvalue"?>
+ <title>Is it possible to use the datascroller without it's table border and styles (to show only the links)?</title>
+ <para> It' necessary to redefine rich* classes for example like this:</para>
+ <programlisting role="JAVA"><![CDATA[.rich-datascr-button {
+border: 0px;
+}
+.rich-dtascroller-table {
+border: 0px;
+}
+.rich-datascr-button {
+background-color: transparent;
+}]]></programlisting>
+ </section>
</chapter>
17 years, 6 months
JBoss Rich Faces SVN: r1342 - in trunk/sandbox/scrollable-grid/src/test/java/org/richfaces: taglib and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2007-06-27 10:52:01 -0400 (Wed, 27 Jun 2007)
New Revision: 1342
Added:
trunk/sandbox/scrollable-grid/src/test/java/org/richfaces/taglib/
trunk/sandbox/scrollable-grid/src/test/java/org/richfaces/taglib/ScrollableGridColumnTagTest.java
trunk/sandbox/scrollable-grid/src/test/java/org/richfaces/taglib/ScrollableGridTagTest.java
Log:
test for tags
Added: trunk/sandbox/scrollable-grid/src/test/java/org/richfaces/taglib/ScrollableGridColumnTagTest.java
===================================================================
--- trunk/sandbox/scrollable-grid/src/test/java/org/richfaces/taglib/ScrollableGridColumnTagTest.java (rev 0)
+++ trunk/sandbox/scrollable-grid/src/test/java/org/richfaces/taglib/ScrollableGridColumnTagTest.java 2007-06-27 14:52:01 UTC (rev 1342)
@@ -0,0 +1,116 @@
+/**
+ * GENERATED FILE - DO NOT EDIT
+ *
+ */
+package org.richfaces.taglib;
+
+import java.lang.String ;
+import org.ajax4jsf.tests.AbstractAjax4JsfTestCase ;
+import javax.faces.component.UIComponent ;
+import javax.faces.component.UIComponent;
+import javax.faces.webapp.UIComponentTag;
+import org.richfaces.component.html.HtmlScrollableGridColumn;
+import javax.faces.application.Application;
+import javax.faces.el.ValueBinding;
+import javax.servlet.Servlet;
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServletRequestWrapper;
+import javax.servlet.http.HttpSession;
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.JspWriter;
+import javax.servlet.jsp.PageContext;
+import javax.servlet.jsp.el.ExpressionEvaluator;
+import javax.servlet.jsp.el.VariableResolver;
+import javax.servlet.jsp.tagext.Tag;
+import java.io.IOException;
+import java.util.Enumeration;
+
+
+
+/**
+ * @author shura (latest modification by $Author: alexsmirnov $)
+ * @version $Revision: 1.1.2.2 $ $Date: 2007/01/03 21:05:14 $
+ *
+ */
+public class ScrollableGridColumnTagTest extends org.ajax4jsf.tests.AbstractAjax4JsfTestCase {
+
+
+ private ScrollableGridColumnTag tag;
+
+ /**
+ * Constructor to init default renderers
+ */
+ public ScrollableGridColumnTagTest (String name){
+ super(name);
+ }
+
+
+ public void setUp() throws Exception {
+ super.setUp();
+ tag = new ScrollableGridColumnTag();
+ tag.setParent(new UIComponentTag(){
+
+ public String getComponentType() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public String getRendererType() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public int doStartTag() throws JspException {
+ // TODO Auto-generated method stub
+ return Tag.EVAL_BODY_INCLUDE;
+ }
+
+ public int doEndTag() throws JspException {
+ // TODO Auto-generated method stub
+ return Tag.EVAL_BODY_INCLUDE;
+ }
+
+ });
+
+ }
+
+ public void tearDown() throws Exception {
+ super.tearDown();
+ tag = null;
+ }
+
+
+ public void testSetPropertiesUIComponent() {
+ HtmlScrollableGridColumn component = new HtmlScrollableGridColumn();
+ // create binding
+ Application application = null;
+ ValueBinding binding = null;
+
+
+ tag.setProperties(component);
+
+/*
+ // TODO - setup properties for other cases.
+ // name footer with type javax.faces.component.UIComponent
+ setStringProperty(component, "width",this._width);
+ // TODO - setup properties for other cases.
+ // name header with type javax.faces.component.UIComponent
+ setStringProperty(component, "headerClass",this._headerClass);
+ setStringProperty(component, "footerClass",this._footerClass);
+ // Simple type - boolean
+ setBooleanProperty(component, "breakBefore",this._breakBefore);
+ // Simple type - boolean
+ setBooleanProperty(component, "sortable",this._sortable);
+ */
+ }
+
+ public void testGetComponentType(){
+ assertNotNull(tag.getComponentType());
+ }
+
+
+}
Added: trunk/sandbox/scrollable-grid/src/test/java/org/richfaces/taglib/ScrollableGridTagTest.java
===================================================================
--- trunk/sandbox/scrollable-grid/src/test/java/org/richfaces/taglib/ScrollableGridTagTest.java (rev 0)
+++ trunk/sandbox/scrollable-grid/src/test/java/org/richfaces/taglib/ScrollableGridTagTest.java 2007-06-27 14:52:01 UTC (rev 1342)
@@ -0,0 +1,175 @@
+/**
+ * GENERATED FILE - DO NOT EDIT
+ *
+ */
+package org.richfaces.taglib;
+
+import java.lang.String ;
+import org.ajax4jsf.tests.AbstractAjax4JsfTestCase ;
+import java.util.Collection ;
+import java.lang.Object ;
+import java.util.List ;
+import org.ajax4jsf.ajax.repeat.DataComponentState ;
+import java.util.Set ;
+import javax.faces.component.UIComponent ;
+import javax.faces.component.UIComponent;
+import javax.faces.webapp.UIComponentTag;
+import org.richfaces.component.html.HtmlScrollableGrid;
+import javax.faces.application.Application;
+import javax.faces.el.ValueBinding;
+import javax.servlet.Servlet;
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServletRequestWrapper;
+import javax.servlet.http.HttpSession;
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.JspWriter;
+import javax.servlet.jsp.PageContext;
+import javax.servlet.jsp.el.ExpressionEvaluator;
+import javax.servlet.jsp.el.VariableResolver;
+import javax.servlet.jsp.tagext.Tag;
+import java.io.IOException;
+import java.util.Enumeration;
+
+
+
+/**
+ * @author shura (latest modification by $Author: alexsmirnov $)
+ * @version $Revision: 1.1.2.2 $ $Date: 2007/01/03 21:05:14 $
+ *
+ */
+public class ScrollableGridTagTest extends org.ajax4jsf.tests.AbstractAjax4JsfTestCase {
+
+
+ private ScrollableGridTag tag;
+
+ /**
+ * Constructor to init default renderers
+ */
+ public ScrollableGridTagTest (String name){
+ super(name);
+ }
+
+
+ public void setUp() throws Exception {
+ super.setUp();
+ tag = new ScrollableGridTag();
+ tag.setParent(new UIComponentTag(){
+
+ public String getComponentType() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public String getRendererType() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public int doStartTag() throws JspException {
+ // TODO Auto-generated method stub
+ return Tag.EVAL_BODY_INCLUDE;
+ }
+
+ public int doEndTag() throws JspException {
+ // TODO Auto-generated method stub
+ return Tag.EVAL_BODY_INCLUDE;
+ }
+
+ });
+
+ }
+
+ public void tearDown() throws Exception {
+ super.tearDown();
+ tag = null;
+ }
+
+
+ public void testSetPropertiesUIComponent() {
+ HtmlScrollableGrid component = new HtmlScrollableGrid();
+ // create binding
+ Application application = null;
+ ValueBinding binding = null;
+
+
+ tag.setProperties(component);
+
+/*
+ setStringProperty(component, "onselectionchange",this._onselectionchange);
+ // TODO - setup properties for other cases.
+ // name footer with type javax.faces.component.UIComponent
+ setStringProperty(component, "width",this._width);
+ setStringProperty(component, "stateVar",this._stateVar);
+ setStringProperty(component, "rowKeyVar",this._rowKeyVar);
+ setStringProperty(component, "focus",this._focus);
+ // Simple type - boolean
+ setBooleanProperty(component, "bypassUpdates",this._bypassUpdates);
+ // TODO - handle object
+ setStringProperty(component, "rowKey",this._rowKey);
+ // Simple type - boolean
+ setBooleanProperty(component, "limitToList",this._limitToList);
+ setStringProperty(component, "var",this._var);
+ // Simple type - int
+ setIntegerProperty(component, "rows",this._rows);
+ // Simple type - int
+ setIntegerProperty(component, "timeout",this._timeout);
+ setStringProperty(component, "columnClasses",this._columnClasses);
+ // TODO - setup properties for other cases.
+ // name header with type javax.faces.component.UIComponent
+ // Simple type - int
+ setIntegerProperty(component, "first",this._first);
+ // TODO - setup properties for other cases.
+ // name selection with type org.richfaces.model.selection.Selection
+ setStringProperty(component, "headerClass",this._headerClass);
+ // TODO - setup properties for other cases.
+ // name responseData with type java.util.Collection
+ setStringProperty(component, "rowClasses",this._rowClasses);
+ setStringProperty(component, "oncomplete",this._oncomplete);
+ // TODO - setup properties for other cases.
+ // name componentState with type org.ajax4jsf.ajax.repeat.DataComponentState
+ // TODO - setup properties for other cases.
+ // name sortOrder with type org.richfaces.model.SortOrder
+ setStringProperty(component, "footerClass",this._footerClass);
+ // TODO - handle object
+ setStringProperty(component, "reRender",this._reRender);
+ setStringProperty(component, "activeClass",this._activeClass);
+ // TODO - setup properties for other cases.
+ // name ajaxKeys with type java.util.Set
+ setStringProperty(component, "height",this._height);
+ setStringProperty(component, "captionClass",this._captionClass);
+ // Simple type - boolean
+ setBooleanProperty(component, "ajaxSingle",this._ajaxSingle);
+ setStringProperty(component, "selectedClass",this._selectedClass);
+ // Simple type - int
+ setIntegerProperty(component, "frozenColCount",this._frozenColCount);
+ // Simple type - int
+ setIntegerProperty(component, "rowIndex",this._rowIndex);
+ // TODO - setup properties for other cases.
+ // name ranges with type java.util.List
+ // Simple type - int
+ setIntegerProperty(component, "reqRowsCount",this._reqRowsCount);
+ setStringProperty(component, "status",this._status);
+ // Simple type - int
+ setIntegerProperty(component, "requestDelay",this._requestDelay);
+ setStringProperty(component, "eventsQueue",this._eventsQueue);
+ // TODO - handle object
+ setStringProperty(component, "data",this._data);
+ // Simple type - boolean
+ setBooleanProperty(component, "ignoreDupResponses",this._ignoreDupResponses);
+ */
+ }
+
+ public void testGetRendererType(){
+ assertNotNull(tag.getRendererType());
+ }
+
+ public void testGetComponentType(){
+ assertNotNull(tag.getComponentType());
+ }
+
+
+}
17 years, 6 months
JBoss Rich Faces SVN: r1341 - in trunk/sandbox/scrollable-grid/src/test/java/org/richfaces/component: html and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2007-06-27 10:50:52 -0400 (Wed, 27 Jun 2007)
New Revision: 1341
Added:
trunk/sandbox/scrollable-grid/src/test/java/org/richfaces/component/html/
trunk/sandbox/scrollable-grid/src/test/java/org/richfaces/component/html/HtmlScrollableGridColumnComponentTest.java
trunk/sandbox/scrollable-grid/src/test/java/org/richfaces/component/html/HtmlScrollableGridComponentTest.java
Log:
Junit for grid and columns
Added: trunk/sandbox/scrollable-grid/src/test/java/org/richfaces/component/html/HtmlScrollableGridColumnComponentTest.java
===================================================================
--- trunk/sandbox/scrollable-grid/src/test/java/org/richfaces/component/html/HtmlScrollableGridColumnComponentTest.java (rev 0)
+++ trunk/sandbox/scrollable-grid/src/test/java/org/richfaces/component/html/HtmlScrollableGridColumnComponentTest.java 2007-06-27 14:50:52 UTC (rev 1341)
@@ -0,0 +1,161 @@
+/**
+ * GENERATED FILE - DO NOT EDIT
+ *
+ */
+
+package org.richfaces.component.html;
+
+import java.lang.String ;
+import org.ajax4jsf.tests.AbstractAjax4JsfTestCase ;
+
+import com.gargoylesoftware.htmlunit.Page;
+import javax.faces.component.UIForm;
+import javax.faces.component.html.HtmlForm;
+import com.gargoylesoftware.htmlunit.html.HtmlPage;
+import com.gargoylesoftware.htmlunit.html.HtmlElement;
+import javax.faces.context.FacesContext;
+import javax.faces.el.ValueBinding;
+import javax.faces.component.UIViewRoot;
+
+import org.ajax4jsf.tests.MockValueBinding;
+
+//import org.richfaces.component.html.HtmlScrollableGridColumn;
+
+public class HtmlScrollableGridColumnComponentTest extends org.ajax4jsf.tests.AbstractAjax4JsfTestCase {
+
+// public static final String COMPONENT_TYPE = "org.richfaces.component.ScrollableGridColumn";
+
+
+ private boolean _breakBeforeSet = false;
+ private boolean _sortableSet = false;
+
+ private HtmlScrollableGridColumn component;
+ private UIForm form;
+// private FacesContext context;
+
+ /**
+ * Constructor to init default renderers
+ */
+ public HtmlScrollableGridColumnComponentTest (String name){
+ super(name);
+ }
+
+ /*
+ * setup the tets
+ */
+ public void setUp() throws Exception {
+ super.setUp();
+ component = new HtmlScrollableGridColumn();
+ form = new HtmlForm();
+ form.setId("form");
+ facesContext.getViewRoot().getChildren().add(form);
+
+ component.setId("component");
+ component.setWidth("width" );
+ component.setHeaderClass("headerClass" );
+ component.setFooterClass("footerClass" );
+ component.setStyleClass("styleClass" );
+ component.setBreakBefore(true );
+ component.setStyle("style" );
+ component.setSortable(true );
+
+ form.getChildren().add(component);
+
+ }
+
+ /*
+ * setup the tets
+ */
+ public void tearDown() throws Exception{
+ super.tearDown();
+ component = null;
+ form = null;
+ }
+
+ public void testComponent() throws Exception {
+
+/*
+ HtmlPage renderedView = renderView();
+ assertNotNull(renderedView);
+ System.out.println(renderedView.getWebResponse().getContentAsString());
+ HtmlElement element = renderedView.getHtmlElementById(form.getId() + ":" + component.getId());
+ assertNotNull(element);
+*/
+// values[0] = component.saveState(facesContext);
+
+ }
+/*
+ public void testDefaultValues(){
+
+ }
+*/
+ public void testContext(){
+
+ Object state = component.saveState(facesContext);
+/*
+ UIViewRoot root = facesContext.getViewRoot();
+ root.processDecodes(facesContext);
+ root.processValidators(facesContext);
+ root.processUpdates(facesContext);
+ root.processApplication(facesContext);
+*/
+ testRestoreState(state);
+ }
+
+ public void testGetters() {
+ HtmlScrollableGridColumn component = new HtmlScrollableGridColumn();
+
+ component.setValueBinding("width", new MockValueBinding("width", java.lang.String.class));
+ assertEquals("width", component.getWidth());
+ component.setWidth("width_width" );
+ assertEquals("width_width", component.getWidth());
+ component.setValueBinding("headerClass", new MockValueBinding("headerClass", java.lang.String.class));
+ assertEquals("headerClass", component.getHeaderClass());
+ component.setHeaderClass("headerClass_headerClass" );
+ assertEquals("headerClass_headerClass", component.getHeaderClass());
+ component.setValueBinding("footerClass", new MockValueBinding("footerClass", java.lang.String.class));
+ assertEquals("footerClass", component.getFooterClass());
+ component.setFooterClass("footerClass_footerClass" );
+ assertEquals("footerClass_footerClass", component.getFooterClass());
+ component.setValueBinding("styleClass", new MockValueBinding("styleClass", java.lang.String.class));
+ assertEquals("styleClass", component.getStyleClass());
+ component.setStyleClass("styleClass_styleClass" );
+ assertEquals("styleClass_styleClass", component.getStyleClass());
+ component.setValueBinding("breakBefore", new MockValueBinding(new Boolean(true), java.lang.Boolean.class));
+ assertEquals(true, component.isBreakBefore());
+ component.setBreakBefore(false );
+ assertEquals(false, component.isBreakBefore());
+ component.setValueBinding("style", new MockValueBinding("style", java.lang.String.class));
+ assertEquals("style", component.getStyle());
+ component.setStyle("style_style" );
+ assertEquals("style_style", component.getStyle());
+ component.setValueBinding("sortable", new MockValueBinding(new Boolean(true), java.lang.Boolean.class));
+ assertEquals(true, component.isSortable());
+ component.setSortable(false );
+ assertEquals(false, component.isSortable());
+
+
+ }
+
+ private void testRestoreState(Object state){
+ HtmlScrollableGridColumn restoredComponent = new HtmlScrollableGridColumn();
+ restoredComponent.restoreState(facesContext, state);
+
+ assertEquals(component.getWidth(), restoredComponent.getWidth());
+ assertEquals(component.getHeaderClass(), restoredComponent.getHeaderClass());
+ assertEquals(component.getFooterClass(), restoredComponent.getFooterClass());
+ assertEquals(component.getStyleClass(), restoredComponent.getStyleClass());
+ assertEquals(component.isBreakBefore(), restoredComponent.isBreakBefore());
+ assertEquals(component.getStyle(), restoredComponent.getStyle());
+ assertEquals(component.isSortable(), restoredComponent.isSortable());
+
+ }
+
+ private void assertEquals(double d1, double d2) {
+ assertEquals(d1, d2, 0);
+ }
+
+ private void assertEquals(float d1, float d2) {
+ assertEquals(d1, d2, 0);
+ }
+}
Added: trunk/sandbox/scrollable-grid/src/test/java/org/richfaces/component/html/HtmlScrollableGridComponentTest.java
===================================================================
--- trunk/sandbox/scrollable-grid/src/test/java/org/richfaces/component/html/HtmlScrollableGridComponentTest.java (rev 0)
+++ trunk/sandbox/scrollable-grid/src/test/java/org/richfaces/component/html/HtmlScrollableGridComponentTest.java 2007-06-27 14:50:52 UTC (rev 1341)
@@ -0,0 +1,290 @@
+/**
+ * GENERATED FILE - DO NOT EDIT
+ *
+ */
+
+package org.richfaces.component.html;
+
+import java.lang.String ;
+import org.ajax4jsf.tests.AbstractAjax4JsfTestCase ;
+import org.richfaces.model.SortOrder ;
+import java.lang.Object ;
+import org.richfaces.model.selection.Selection ;
+import org.richfaces.model.selection.SimpleSelection;
+
+import com.gargoylesoftware.htmlunit.Page;
+import javax.faces.component.UIForm;
+import javax.faces.component.html.HtmlForm;
+import com.gargoylesoftware.htmlunit.html.HtmlPage;
+import com.gargoylesoftware.htmlunit.html.HtmlElement;
+import javax.faces.context.FacesContext;
+import javax.faces.el.ValueBinding;
+import javax.faces.component.UIViewRoot;
+
+import org.ajax4jsf.tests.MockValueBinding;
+
+//import org.richfaces.component.html.HtmlScrollableGrid;
+
+public class HtmlScrollableGridComponentTest extends org.ajax4jsf.tests.AbstractAjax4JsfTestCase {
+
+// public static final String COMPONENT_TYPE = "org.richfaces.component.ScrollableGrid";
+
+
+ private boolean _bypassUpdatesSet = false;
+ private boolean _limitToListSet = false;
+ private boolean _timeoutSet = false;
+ private boolean _ajaxSingleSet = false;
+ private boolean _frozenColCountSet = false;
+ private boolean _requestDelaySet = false;
+ private boolean _ignoreDupResponsesSet = false;
+
+ private HtmlScrollableGrid component;
+ private UIForm form;
+// private FacesContext context;
+
+ /**
+ * Constructor to init default renderers
+ */
+ public HtmlScrollableGridComponentTest (String name){
+ super(name);
+ }
+
+ /*
+ * setup the tets
+ */
+ public void setUp() throws Exception {
+ super.setUp();
+ component = new HtmlScrollableGrid();
+ form = new HtmlForm();
+ form.setId("form");
+ facesContext.getViewRoot().getChildren().add(form);
+
+ component.setId("component");
+ component.setOnselectionchange("onselectionchange" );
+ component.setWidth("width" );
+ component.setFocus("focus" );
+ component.setBypassUpdates(true );
+ component.setLimitToList(true );
+ component.setTimeout(20 );
+ component.setColumnClasses("columnClasses" );
+// component.setSelection("selection" );
+ component.setHeaderClass("headerClass" );
+ component.setRowClasses("rowClasses" );
+ component.setOncomplete("oncomplete" );
+// component.setSortOrder("sortOrder" );
+ component.setFooterClass("footerClass" );
+ component.setReRender("reRender" );
+ component.setActiveClass("activeClass" );
+ component.setStyleClass("styleClass" );
+ component.setHeight("height" );
+ component.setCaptionClass("captionClass" );
+ component.setAjaxSingle(true );
+ component.setSelectedClass("selectedClass" );
+ component.setFrozenColCount(20 );
+ component.setStatus("status" );
+ component.setRequestDelay(20 );
+ component.setEventsQueue("eventsQueue" );
+ component.setData("data" );
+ component.setIgnoreDupResponses(true );
+
+ form.getChildren().add(component);
+
+ }
+
+ /*
+ * setup the tets
+ */
+ public void tearDown() throws Exception{
+ super.tearDown();
+ component = null;
+ form = null;
+ }
+
+ public void testComponent() throws Exception {
+ assertEquals("org.richfaces.renderkit.html.ScrollableGridRenderer", component.getRendererType());
+
+/*
+ HtmlPage renderedView = renderView();
+ assertNotNull(renderedView);
+ System.out.println(renderedView.getWebResponse().getContentAsString());
+ HtmlElement element = renderedView.getHtmlElementById(form.getId() + ":" + component.getId());
+ assertNotNull(element);
+*/
+// values[0] = component.saveState(facesContext);
+
+ }
+/*
+ public void testDefaultValues(){
+
+ }
+*/
+ public void testContext(){
+
+ Object state = component.saveState(facesContext);
+/*
+ UIViewRoot root = facesContext.getViewRoot();
+ root.processDecodes(facesContext);
+ root.processValidators(facesContext);
+ root.processUpdates(facesContext);
+ root.processApplication(facesContext);
+*/
+ testRestoreState(state);
+ }
+
+ public void testGetters() {
+ HtmlScrollableGrid component = new HtmlScrollableGrid();
+
+ component.setValueBinding("onselectionchange", new MockValueBinding("onselectionchange", java.lang.String.class));
+ assertEquals("onselectionchange", component.getOnselectionchange());
+ component.setOnselectionchange("onselectionchange_onselectionchange" );
+ assertEquals("onselectionchange_onselectionchange", component.getOnselectionchange());
+ component.setValueBinding("width", new MockValueBinding("width", java.lang.String.class));
+ assertEquals("width", component.getWidth());
+ component.setWidth("width_width" );
+ assertEquals("width_width", component.getWidth());
+ component.setValueBinding("focus", new MockValueBinding("focus", java.lang.String.class));
+ assertEquals("focus", component.getFocus());
+ component.setFocus("focus_focus" );
+ assertEquals("focus_focus", component.getFocus());
+ component.setValueBinding("bypassUpdates", new MockValueBinding(new Boolean(true), java.lang.Boolean.class));
+ assertEquals(true, component.isBypassUpdates());
+ component.setBypassUpdates(false );
+ assertEquals(false, component.isBypassUpdates());
+ component.setValueBinding("limitToList", new MockValueBinding(new Boolean(true), java.lang.Boolean.class));
+ assertEquals(true, component.isLimitToList());
+ component.setLimitToList(false );
+ assertEquals(false, component.isLimitToList());
+ component.setValueBinding("timeout", new MockValueBinding(new Integer(20), java.lang.Integer.class));
+ assertEquals(20, component.getTimeout());
+ component.setTimeout(15 );
+ assertEquals(15, component.getTimeout());
+ component.setValueBinding("columnClasses", new MockValueBinding("columnClasses", java.lang.String.class));
+ assertEquals("columnClasses", component.getColumnClasses());
+ component.setColumnClasses("columnClasses_columnClasses" );
+ assertEquals("columnClasses_columnClasses", component.getColumnClasses());
+ component.setValueBinding("selection", new MockValueBinding("selection", org.richfaces.model.selection.Selection.class));
+
+ SimpleSelection selection = new SimpleSelection();
+ selection.addKey("key");
+ component.setSelection(selection);
+ assertEquals(selection, component.getSelection());
+
+ component.setValueBinding("headerClass", new MockValueBinding("headerClass", java.lang.String.class));
+ assertEquals("headerClass", component.getHeaderClass());
+ component.setHeaderClass("headerClass_headerClass" );
+ assertEquals("headerClass_headerClass", component.getHeaderClass());
+ component.setValueBinding("rowClasses", new MockValueBinding("rowClasses", java.lang.String.class));
+ assertEquals("rowClasses", component.getRowClasses());
+ component.setRowClasses("rowClasses_rowClasses" );
+ assertEquals("rowClasses_rowClasses", component.getRowClasses());
+ component.setValueBinding("oncomplete", new MockValueBinding("oncomplete", java.lang.String.class));
+ assertEquals("oncomplete", component.getOncomplete());
+ component.setOncomplete("oncomplete_oncomplete" );
+ assertEquals("oncomplete_oncomplete", component.getOncomplete());
+ component.setValueBinding("sortOrder", new MockValueBinding("sortOrder", org.richfaces.model.SortOrder.class));
+ SortOrder sortOrder = new SortOrder();
+ sortOrder.setSortColumn(2);
+ sortOrder.setAscending(true);
+ component.setSortOrder(sortOrder);
+ assertEquals(sortOrder, component.getSortOrder());
+ component.setValueBinding("footerClass", new MockValueBinding("footerClass", java.lang.String.class));
+ assertEquals("footerClass", component.getFooterClass());
+ component.setFooterClass("footerClass_footerClass" );
+ assertEquals("footerClass_footerClass", component.getFooterClass());
+ component.setValueBinding("reRender", new MockValueBinding("reRender", java.lang.Object.class));
+ assertEquals("reRender", component.getReRender());
+ component.setReRender("reRender_reRender" );
+ assertEquals("reRender_reRender", component.getReRender());
+ component.setValueBinding("activeClass", new MockValueBinding("activeClass", java.lang.String.class));
+ assertEquals("activeClass", component.getActiveClass());
+ component.setActiveClass("activeClass_activeClass" );
+ assertEquals("activeClass_activeClass", component.getActiveClass());
+ component.setValueBinding("styleClass", new MockValueBinding("styleClass", java.lang.String.class));
+ assertEquals("styleClass", component.getStyleClass());
+ component.setStyleClass("styleClass_styleClass" );
+ assertEquals("styleClass_styleClass", component.getStyleClass());
+ component.setValueBinding("height", new MockValueBinding("height", java.lang.String.class));
+ assertEquals("height", component.getHeight());
+ component.setHeight("height_height" );
+ assertEquals("height_height", component.getHeight());
+ component.setValueBinding("captionClass", new MockValueBinding("captionClass", java.lang.String.class));
+ assertEquals("captionClass", component.getCaptionClass());
+ component.setCaptionClass("captionClass_captionClass" );
+ assertEquals("captionClass_captionClass", component.getCaptionClass());
+ component.setValueBinding("ajaxSingle", new MockValueBinding(new Boolean(true), java.lang.Boolean.class));
+ assertEquals(true, component.isAjaxSingle());
+ component.setAjaxSingle(false );
+ assertEquals(false, component.isAjaxSingle());
+ component.setValueBinding("selectedClass", new MockValueBinding("selectedClass", java.lang.String.class));
+ assertEquals("selectedClass", component.getSelectedClass());
+ component.setSelectedClass("selectedClass_selectedClass" );
+ assertEquals("selectedClass_selectedClass", component.getSelectedClass());
+ component.setValueBinding("frozenColCount", new MockValueBinding(new Integer(20), java.lang.Integer.class));
+ assertEquals(20, component.getFrozenColCount());
+ component.setFrozenColCount(15 );
+ assertEquals(15, component.getFrozenColCount());
+ component.setValueBinding("status", new MockValueBinding("status", java.lang.String.class));
+ assertEquals("status", component.getStatus());
+ component.setStatus("status_status" );
+ assertEquals("status_status", component.getStatus());
+ component.setValueBinding("requestDelay", new MockValueBinding(new Integer(20), java.lang.Integer.class));
+ assertEquals(20, component.getRequestDelay());
+ component.setRequestDelay(15 );
+ assertEquals(15, component.getRequestDelay());
+ component.setValueBinding("eventsQueue", new MockValueBinding("eventsQueue", java.lang.String.class));
+ assertEquals("eventsQueue", component.getEventsQueue());
+ component.setEventsQueue("eventsQueue_eventsQueue" );
+ assertEquals("eventsQueue_eventsQueue", component.getEventsQueue());
+ component.setValueBinding("data", new MockValueBinding("data", java.lang.Object.class));
+ assertEquals("data", component.getData());
+ component.setData("data_data" );
+ assertEquals("data_data", component.getData());
+ component.setValueBinding("ignoreDupResponses", new MockValueBinding(new Boolean(true), java.lang.Boolean.class));
+ assertEquals(true, component.isIgnoreDupResponses());
+ component.setIgnoreDupResponses(false );
+ assertEquals(false, component.isIgnoreDupResponses());
+
+
+ }
+
+ private void testRestoreState(Object state){
+ HtmlScrollableGrid restoredComponent = new HtmlScrollableGrid();
+ restoredComponent.restoreState(facesContext, state);
+
+ assertEquals(component.getOnselectionchange(), restoredComponent.getOnselectionchange());
+ assertEquals(component.getWidth(), restoredComponent.getWidth());
+ assertEquals(component.getFocus(), restoredComponent.getFocus());
+ assertEquals(component.isBypassUpdates(), restoredComponent.isBypassUpdates());
+ assertEquals(component.isLimitToList(), restoredComponent.isLimitToList());
+ assertEquals(component.getTimeout(), restoredComponent.getTimeout());
+ assertEquals(component.getColumnClasses(), restoredComponent.getColumnClasses());
+ assertEquals(component.getSelection(), restoredComponent.getSelection());
+ assertEquals(component.getHeaderClass(), restoredComponent.getHeaderClass());
+ assertEquals(component.getRowClasses(), restoredComponent.getRowClasses());
+ assertEquals(component.getOncomplete(), restoredComponent.getOncomplete());
+ assertEquals(component.getSortOrder(), restoredComponent.getSortOrder());
+ assertEquals(component.getFooterClass(), restoredComponent.getFooterClass());
+ assertEquals(component.getReRender(), restoredComponent.getReRender());
+ assertEquals(component.getActiveClass(), restoredComponent.getActiveClass());
+ assertEquals(component.getStyleClass(), restoredComponent.getStyleClass());
+ assertEquals(component.getHeight(), restoredComponent.getHeight());
+ assertEquals(component.getCaptionClass(), restoredComponent.getCaptionClass());
+ assertEquals(component.isAjaxSingle(), restoredComponent.isAjaxSingle());
+ assertEquals(component.getSelectedClass(), restoredComponent.getSelectedClass());
+ assertEquals(component.getFrozenColCount(), restoredComponent.getFrozenColCount());
+ assertEquals(component.getStatus(), restoredComponent.getStatus());
+ assertEquals(component.getRequestDelay(), restoredComponent.getRequestDelay());
+ assertEquals(component.getEventsQueue(), restoredComponent.getEventsQueue());
+ assertEquals(component.getData(), restoredComponent.getData());
+ assertEquals(component.isIgnoreDupResponses(), restoredComponent.isIgnoreDupResponses());
+
+ }
+
+ private void assertEquals(double d1, double d2) {
+ assertEquals(d1, d2, 0);
+ }
+
+ private void assertEquals(float d1, float d2) {
+ assertEquals(d1, d2, 0);
+ }
+}
17 years, 6 months
JBoss Rich Faces SVN: r1340 - trunk/richfaces/menu-components/src/main/config/component.
by richfaces-svn-commits@lists.jboss.org
Author: a.izobov
Date: 2007-06-27 10:49:38 -0400 (Wed, 27 Jun 2007)
New Revision: 1340
Modified:
trunk/richfaces/menu-components/src/main/config/component/menucomponents.xml
Log:
http://jira.jboss.com/jira/browse/RF-378 fixed
Modified: trunk/richfaces/menu-components/src/main/config/component/menucomponents.xml
===================================================================
--- trunk/richfaces/menu-components/src/main/config/component/menucomponents.xml 2007-06-27 14:46:57 UTC (rev 1339)
+++ trunk/richfaces/menu-components/src/main/config/component/menucomponents.xml 2007-06-27 14:49:38 UTC (rev 1340)
@@ -54,7 +54,7 @@
<name>direction</name>
<classname>java.lang.String</classname>
<description>Defines direction of the popup sublist to appear
- (right, left, auto(Default))</description>
+ (right, left, auto(Default), left-down, left-up, right-down, right-up)</description>
</property>
<property>
<name>iconFolder</name>
17 years, 6 months