JBoss Rich Faces SVN: r20913 - in trunk/ui/output/ui/src/main: java/org/richfaces/renderkit/html and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: amarkhel
Date: 2011-01-06 12:50:51 -0500 (Thu, 06 Jan 2011)
New Revision: 20913
Added:
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/menu-base.js
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/menuKeyNavigation.js
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/menuitem.js
Modified:
trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractDropDownMenu.java
trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractMenuGroup.java
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/DropDownMenuRendererBase.java
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/dropdownmenu.ecss
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/menu.js
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/menugroup.js
trunk/ui/output/ui/src/main/templates/dropdownmenu.template.xml
trunk/ui/output/ui/src/main/templates/menugroup.template.xml
trunk/ui/output/ui/src/main/templates/menuitem.template.xml
Log:
https://issues.jboss.org/browse/RF-10107 Drop down menu: keyboard navigation
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractDropDownMenu.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractDropDownMenu.java 2011-01-06 17:14:29 UTC (rev 20912)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractDropDownMenu.java 2011-01-06 17:50:51 UTC (rev 20913)
@@ -19,7 +19,7 @@
public static final String COMPONENT_FAMILY = "org.richfaces.DropDownMenu";
- @Attribute
+ @Attribute (defaultValue = "click")
public abstract String getShowEvent();
@Attribute(defaultValue = "server")
@@ -37,6 +37,12 @@
@Attribute(defaultValue = "250")
public abstract int getPopupWith();
+ @Attribute(defaultValue = "0")
+ public abstract int getHorizontalOffset();
+
+ @Attribute(defaultValue = "0")
+ public abstract int getVerticalOffset();
+
//TODO is it correct or cdk issue
@Attribute(defaultValue = "org.richfaces.component.Positioning.DEFAULT")
public abstract Positioning getJointPoint();
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractMenuGroup.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractMenuGroup.java 2011-01-06 17:14:29 UTC (rev 20912)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractMenuGroup.java 2011-01-06 17:50:51 UTC (rev 20913)
@@ -41,15 +41,19 @@
@Attribute
public abstract String getStyle();
-// @Attribute(defaultValue = "auto")
-// public abstract String getDirection();
-//
-// @Attribute(defaultValue = "0")
-// public abstract String getVerticalOffset();
-//
-// @Attribute(defaultValue = "0")
-// public abstract String getHorizontalOffset();
+ @Attribute(defaultValue = "org.richfaces.component.Positioning.DEFAULT")
+ public abstract Positioning getDirection();
+ //TODO is it correct or cdk issue
+ @Attribute(defaultValue = "org.richfaces.component.Positioning.DEFAULT")
+ public abstract Positioning getJointPoint();
+
+ @Attribute(defaultValue = "0")
+ public abstract String getVerticalOffset();
+
+ @Attribute(defaultValue = "0")
+ public abstract String getHorizontalOffset();
+
@Attribute(events = @EventName("show"))
public abstract String getOnshow();
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/DropDownMenuRendererBase.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/DropDownMenuRendererBase.java 2011-01-06 17:14:29 UTC (rev 20912)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/DropDownMenuRendererBase.java 2011-01-06 17:50:51 UTC (rev 20913)
@@ -28,6 +28,8 @@
@ResourceDependency(name = "richfaces-event.js"),
@ResourceDependency(library = "org.richfaces", name = "popup.js"),
@ResourceDependency(library = "org.richfaces", name = "dropdownmenu.ecss", target="head"),
+ @ResourceDependency(library = "org.richfaces", name = "menuKeyNavigation.js"),
+ @ResourceDependency(library = "org.richfaces", name = "menu-base.js"),
@ResourceDependency(library = "org.richfaces", name = "menu.js"),
@ResourceDependency(library = "org.richfaces", name = "popupList.js")})
public abstract class DropDownMenuRendererBase extends RendererBase {
@@ -86,6 +88,11 @@
map.put("id", group.getClientId());
RenderKitUtils.addToScriptHash(map, "onhide", group.getOnhide(), null, ScriptHashVariableWrapper.eventHandler);
RenderKitUtils.addToScriptHash(map, "onshow", group.getOnshow(), null, ScriptHashVariableWrapper.eventHandler);
+ RenderKitUtils.addToScriptHash(map, "verticalOffset", group.getVerticalOffset(), "0");
+ RenderKitUtils.addToScriptHash(map, "horizontalOffset", group.getHorizontalOffset(), "0");
+ RenderKitUtils.addToScriptHash(map, "jointPoint", group.getJointPoint(), org.richfaces.component.Positioning.DEFAULT);
+ RenderKitUtils.addToScriptHash(map, "direction", group.getDirection(), org.richfaces.component.Positioning.DEFAULT);
+
results.add(map);
}
}
Modified: trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/dropdownmenu.ecss
===================================================================
--- trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/dropdownmenu.ecss 2011-01-06 17:14:29 UTC (rev 20912)
+++ trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/dropdownmenu.ecss 2011-01-06 17:50:51 UTC (rev 20913)
@@ -28,6 +28,7 @@
min-width:250px;
position:absolute;
z-index:10;
+ outline: none;
}
.rf-ddm-sublst {
position:absolute;
Added: trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/menu-base.js
===================================================================
--- trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/menu-base.js (rev 0)
+++ trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/menu-base.js 2011-01-06 17:50:51 UTC (rev 20913)
@@ -0,0 +1,238 @@
+(function($, rf) {
+
+ rf.ui = rf.ui || {};
+
+ var defaultOptions = {
+ mode : 'server',
+ attachToBody : false,
+ showDelay : 50,
+ hideDelay : 300,
+ verticalOffset : 0,
+ horisantalOffset : 0,
+ showEvent : 'mouseover',
+ positionOffset : [0, 0],
+ itemCss : "rf-ddm-itm",
+ selectItemCss : "rf-ddm-itm-sel",
+ unselectItemCss : "rf-ddm-itm-unsel",
+ disabledItemCss : "rf-ddm-itm-dis",
+ listCss : "rf-ddm-lst",
+ listContainerCss : "rf-ddm-lst-bg"
+ };
+
+ rf.ui.MenuBase = function(componentId, options) {
+ $super.constructor.call(this, componentId, options);
+ this.id = componentId;
+ this.namespace = this.namespace || "."
+ + rf.Event.createNamespace(this.name, this.id);
+
+ this.options = {};
+ $.extend(this.options, defaultOptions, options || {});
+ this.attachToDom(componentId);
+
+ this.element = rf.getDomElement(this.id);
+
+ this.displayed = false;
+
+ this.options.attachTo = this.id;
+ this.options.attachToBody = false;
+
+ this.options.positionOffset = [this.options.horisantalOffset,
+ this.options.verticalOffset];
+ this.popup = new RichFaces.ui.Popup(this.id + "_list", {
+ attachTo : this.id,
+ direction : this.options.direction,
+ jointPoint : this.options.jointPoint,
+ positionType : this.options.positionType,
+ positionOffset : this.options.positionOffset,
+ attachToBody : this.options.attachToBody
+ });
+
+ this.selectedGroup = null;
+
+ rf.Event.bindById(this.id, this.options.showEvent, $.proxy(
+ this.__showHandler, this), this);
+ rf.Event.bindById(this.id, "mouseenter", $.proxy(this.__overHandler,
+ this), this);
+ rf.Event.bindById(this.id, "mouseleave", $.proxy(this.__leaveHandler,
+ this), this);
+
+ this.popupElement = rf.getDomElement(this.popup.id);
+ this.popupElement.tabIndex = -1;
+
+ this.__updateItemsList();
+
+ rf.Event.bind(this.items, "mouseenter", $.proxy(
+ this.__itemMouseEnterHandler, this), this);
+
+ this.currentSelectedItemIndex = -1;
+ var navEventHandlers;
+ navEventHandlers = {};
+ navEventHandlers["keydown" + this.namespace] = this.__keydownHandler;
+
+ rf.Event.bind(this.popupElement, navEventHandlers, this);
+ }
+
+ rf.BaseComponent.extend(rf.ui.MenuBase);
+
+ // define super class link
+ var $super = rf.ui.MenuBase.$super;
+
+ $.extend(rf.ui.MenuBase.prototype, (function() {
+ return {
+ name : "MenuBase",
+
+ show : function() {
+ this.__showPopup();
+ },
+
+ hide : function() {
+ this.__hidePopup();
+ },
+
+ processItem : function(item) {
+ if (item && item.attr('id') && !this.__isDisabled(item)
+ && !this.__isGroup(item)) {
+ this.invokeEvent("itemclick", rf.getDomElement(this.id),
+ null);
+ this.hide();
+ }
+ },
+
+ activateItem : function(menuItemId) {
+ var item = $(RichFaces.getDomElement(menuItemId));
+ rf.Event.fireById(item.attr('id'), 'click');
+ },
+
+ __showPopup : function() {
+ if (!this.__isShown()) {
+ this.invokeEvent("show", rf.getDomElement(this.id), null);
+ this.popup.show();
+ this.displayed = true;
+ rf.ui.MenuManager.setActiveSubMenu(rf.$(this.element));
+ }
+ this.popupElement.focus();
+
+ },
+
+ __hidePopup : function() {
+ /*
+ * for (var i in this.groupList) { this.groupList[i].hide(); }
+ */
+ if (this.__isShown()) {
+ this.invokeEvent("hide", rf.getDomElement(this.id), null);
+ this.__closeChildGroups();
+ this.popup.hide();
+ this.displayed = false;
+ this.__deselectCurrentItem();
+ this.currentSelectedItemIndex = -1;
+ parentMenu = rf.$(this.__getParentMenu());
+ parentMenu.popupElement.focus();
+ rf.ui.MenuManager.setActiveSubMenu(parentMenu);
+ }
+
+ },
+
+ __closeChildGroups : function() {
+ var i = 0;
+ for (i in this.items) {
+ menuItem = this.items.eq(i);
+ if (this.__isGroup(menuItem)) {
+ rf.$(menuItem).hide();
+ }
+ }
+ },
+
+ __getParentMenuFromItem : function(item) {
+ if (item)
+ menu = item.parents('div.rf-ddm-itm')
+ .has('div.rf-ddm-lst-bg').eq(1);
+ if (menu && menu.length > 0)
+ return menu;
+ else {
+ menu = item.parents('div.rf-ddm-lbl');
+ if (menu && menu.length > 0)
+ return menu;
+ else
+ return null;
+ }
+ },
+
+ __getParentMenu : function() {
+ menu = $(this.element).parents('div.rf-ddm-itm')
+ .has('div.rf-ddm-lst-bg').eq(0);
+ if (menu && menu.length > 0)
+ return menu;
+ else {
+ var item = this.items.eq(0);
+ return this.__getParentMenuFromItem(item);
+ }
+ },
+
+ __isGroup : function(item) {
+ var group = item.find('div.' + this.options.listCss);
+ if (group.length > 0) {
+ return true;
+ }
+ return false;
+ },
+
+ __isDisabled : function(item) {
+ return item.hasClass(this.options.disabledItemCss);
+ },
+
+ __isShown : function() {
+ return this.displayed;
+
+ },
+
+ __itemMouseEnterHandler : function(e) {
+ var item = this.__getItemFromEvent(e);
+ if (item) {
+ //this.__selectItem(item);
+ if (this.currentSelectedItemIndex != this.items.index(item)) {
+ this.__deselectCurrentItem();
+ this.currentSelectedItemIndex = this.items.index(item);
+ }
+ }
+ },
+
+ __selectItem : function(item) {
+ if (!rf.$(item).isSelected) {
+
+ rf.$(item).select();
+ }
+ },
+
+ __getItemFromEvent : function(e) {
+ return $(e.target).closest("." + this.options.itemCss,
+ e.currentTarget).eq(0);
+ },
+
+ __showHandler : function() {
+ this.showTimeoutId = window.setTimeout($.proxy(function() {
+ this.show();
+ }, this), this.options.showDelay);
+ },
+
+ __leaveHandler : function(e) {
+ window.clearTimeout(this.showTimeoutId);
+ this.hideTimeoutId = window.setTimeout($.proxy(function() {
+ this.hide();
+ }, this), this.options.hideDelay);
+ },
+
+ __overHandler : function(e) {
+ window.clearTimeout(this.hideTimeoutId);
+ },
+
+ destroy : function() {
+ // clean up code here
+ this.detach(this.id);
+
+ // call parent's destroy method
+ $super.destroy.call(this);
+ }
+ };
+ })());
+
+})(jQuery, RichFaces)
\ No newline at end of file
Property changes on: trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/menu-base.js
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/menu.js
===================================================================
--- trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/menu.js 2011-01-06 17:14:29 UTC (rev 20912)
+++ trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/menu.js 2011-01-06 17:50:51 UTC (rev 20913)
@@ -4,223 +4,142 @@
var defaultOptions = {
mode : 'server',
attachToBody : false,
- positionOffset : [ 0, 0 ],
showDelay : 50,
hideDelay : 300,
verticalOffset : 0,
horisantalOffset : 0,
- showEvent : 'mouseover',
+ showEvent : 'click',
+ positionOffset : [0, 0],
direction : "AA",
jointPoint : "AA",
+ positionType : "DROPDOWN",
itemCss : "rf-ddm-itm",
selectItemCss : "rf-ddm-itm-sel",
unselectItemCss : "rf-ddm-itm-unsel",
disabledItemCss : "rf-ddm-itm-dis",
- listCss : "rf-ddm-lst"
- };
+ listCss : "rf-ddm-lst",
+ listContainerCss : "rf-ddm-lst-bg"
+ }
// constructor definition
rf.ui.Menu = function(componentId, options) {
- $super.constructor.call(this, componentId);
- this.id = componentId;
- this.groupList = new Array();
this.options = {};
$.extend(this.options, defaultOptions, options || {});
- this.attachToDom(componentId);
+ $super.constructor.call(this, componentId, this.options);
+ this.id = componentId;
+ this.namespace = this.namespace || "."
+ + rf.Event.createNamespace(this.name, this.id);
+ this.groupList = new Array();
- this.element = rf.getDomElement(this.id);
-
- this.selectItemCss = this.options.selectItemCss;
- this.unselectItemCss = this.options.unselectItemCss;
-
- this.displayed = false;
-
- this.options.attachTo = this.id;
- this.options.positionOffset = [ this.options.horisantalOffset,
- this.options.verticalOffset ];
- this.popupList = new RichFaces.ui.PopupList(this.id + "_list", this,
- this.options);
- this.selectedGroup = null;
- rf.Event.bindById(this.id, this.options.showEvent, $.proxy(
- this.___showHandler, this), this);
- rf.Event.bindById(this.id, "mouseenter", $.proxy(this.__overHandler,
- this), this);
- rf.Event.bindById(this.id, "mouseleave", $.proxy(this.__leaveHandler,
- this), this);
+ this.attachToDom(componentId);
if (!rf.ui.MenuManager)
rf.ui.MenuManager = {};
- this.menuManager=rf.ui.MenuManager;
-
+ this.menuManager = rf.ui.MenuManager;
};
- rf.BaseComponent.extend(rf.ui.Menu);
+ rf.ui.MenuBase.extend(rf.ui.Menu);
// define super class link
var $super = rf.ui.Menu.$super;
- $.extend(rf.ui.Menu.prototype, (function() {
- return {
- name : "Menu",
- initiateGroups : function(groupOptions) {
- for ( var i in groupOptions) {
- var groupId = groupOptions[i].id;
- var positionOffset = [ groupOptions[i].horizontalOffset,
- groupOptions[i].verticalOffset ]
- var onshow = groupOptions[i].onshow;
- var onhide = groupOptions[i].onhide;
+ $.extend(rf.ui.Menu.prototype, rf.ui.MenuKeyNavigation);
- var eventType = "mouseover";
+ $.extend(rf.ui.Menu.prototype, (function() {
+ return {
+ name : "Menu",
+ initiateGroups : function(groupOptions) {
- if (null != groupId) {
- // var popup = new RichFaces.ui.Popup(groupId +
- // '_list', options);
- var group = new RichFaces.ui.MenuGroup(groupId, {
- parentMenuId : this.id,
- onshow : onshow,
- onhide : onhide
- });
- this.groupList[groupId] = group;
- }
- }
- },
+ for (var i in groupOptions) {
+ var groupId = groupOptions[i].id;
+ var positionOffset = [
+ groupOptions[i].horizontalOffset,
+ groupOptions[i].verticalOffset]
+ var onshow = groupOptions[i].onshow;
+ var onhide = groupOptions[i].onhide;
- submitForm : function(item) {
- var form = this.__getParentForm(item);
- if (this.options.mode == "server") {
- rf.submitForm(form, {selectedMenuItem: item.id});
- }
- if (this.options.mode == "ajax") {
- rf.ajax(item.id);
- }
- },
+ var eventType = "mouseover";
- processItem : function(item) {
- if (item && item.attr('id') && !this.__isDisabled(item)
- && !this.__isGroup(item)) {
- this.invokeEvent("itemclick", rf.getDomElement(this.id),
- null);
- this.hide();
- }
- },
-
- activateItem : function(menuItemId){
- var item=$(RichFaces.getDomElement(menuItemId));
- this.processItem(item);
- },
+ if (null != groupId) {
+ // var popup = new RichFaces.ui.Popup(groupId +
+ // '_list', options);
+ var group = new RichFaces.ui.MenuGroup(groupId,
+ {
+ rootMenuId : this.id,
+ onshow : onshow,
+ onhide : onhide
+ });
+ this.groupList[groupId] = group;
+ }
+ }
+ },
- selectItem : function(item) {
- // if(item.attr('id') && !this.isDisabled(item)){
- // item.addClass(this.selectItemCss);
- // if(item.attr('id').search('group') != -1){
- // this.selectedGroup=item.attr('id');
- // } else {
- // this.selectedGroup = null;
- // }
- // }
- },
- unselectItem : function(item) {
- // var nextItem = this.popupList.nextSelectItem();
- // if (item.attr('id') && (nextItem.attr('id') !=
- // this.selectedGroup) && !this.isWithin(nextItem) ){
- // item.removeClass(this.selectItemCss);
- // item.addClass(this.unselectItemCss);
- // }
+ submitForm : function(item) {
+ var form = this.__getParentForm(item);
+ if (this.options.mode == "server") {
+ rf.submitForm(form, {
+ selectedMenuItem : item.id
+ });
+ }
+ if (this.options.mode == "ajax") {
+ rf.ajax(item.id);
+ }
+ },
- },
-
- show: function() {
- this.menuManager.shutdownMenu();
- this.menuManager.addMenuId(this.id);
- this.__showPopup();
- },
-
- hide: function() {
- this.__hidePopup();
- this.menuManager.deletedMenuId();
- },
+ show : function() {
+ if (this.menuManager.openedMenu != this.id) {
+ this.menuManager.shutdownMenu();
+ this.menuManager.addMenuId(this.id);
+ this.__showPopup();
+ }
+ this.popupElement.focus();
+ },
- __showPopup : function() {
- if (!this.__isShown()) {
- this.invokeEvent("show", rf.getDomElement(this.id), null);
- this.popupList.show();
- this.displayed = true;
- }
- },
+ hide : function() {
+ this.__hidePopup();
+ this.menuManager.deletedMenuId();
+ },
- __hidePopup : function() {
- /*
- * for (var i in this.groupList) { this.groupList[i].hide(); }
- */
- if (this.__isShown()) {
- this.invokeEvent("hide", rf.getDomElement(this.id), null);
- this.popupList.hide();
- this.displayed = false;
- }
+ __getParentForm : function(item) {
+ return item.parents("form")[0];
+ },
- },
+ destroy : function() {
+ // clean up code here
+ this.detach(this.id);
- __isGroup : function(item) {
- return 'object' == typeof this.groupList[item.attr('id')];
- },
+ // call parent's destroy method
+ $super.destroy.call(this);
+ }
+ };
+ })());
- __isDisabled : function(item) {
- return item.hasClass(this.options.disabledItemCss);
- },
+ rf.ui.MenuManager = {
+ openedMenu : null,
- __isShown : function() {
- return this.displayed;
+ activeSubMenu : null,
- },
-
- ___showHandler : function() {
- this.showTimeoutId = window.setTimeout($.proxy(function() {
- this.show();
- }, this), this.options.showDelay);
- },
-
- __getParentForm : function(item) {
- return item.parents("form")[0];
- },
-
- __leaveHandler : function(e) {
- window.clearTimeout(this.showTimeoutId);
- this.hideTimeoutId = window.setTimeout($.proxy(function() {
- this.hide();
- }, this), this.options.hideDelay);
- },
-
- __overHandler : function(e) {
- window.clearTimeout(this.hideTimeoutId);
- },
-
- destroy : function() {
- // clean up code here
- this.detach(this.id);
-
- // call parent's destroy method
- $super.destroy.call(this);
- }
- };
- })());
-
- rf.ui.MenuManager = {
- openedMenu: null,
-
- addMenuId: function(menuId) {
+ addMenuId : function(menuId) {
this.openedMenu = menuId;
-
},
-
- deletedMenuId: function () {
+
+ deletedMenuId : function() {
this.openedMenu = null;
},
-
- shutdownMenu: function () {
- if (this.openedMenu != null){
+
+ shutdownMenu : function() {
+ if (this.openedMenu != null) {
rf.$(rf.getDomElement(this.openedMenu)).hide();
}
this.deletedMenuId();
+ },
+
+ setActiveSubMenu : function(submenu) {
+ this.activeSubMenu = submenu;
+ },
+
+ getActiveSubMenu : function() {
+ return this.activeSubMenu;
}
-
+
}
})(jQuery, RichFaces)
\ No newline at end of file
Added: trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/menuKeyNavigation.js
===================================================================
--- trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/menuKeyNavigation.js (rev 0)
+++ trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/menuKeyNavigation.js 2011-01-06 17:50:51 UTC (rev 20913)
@@ -0,0 +1,176 @@
+(function ($, rf) {
+
+ rf.ui = rf.ui || {};
+ //rf.ui.MenuKeyNavigation = rf.ui.MenuKeyNavigation || {};
+
+
+ rf.ui.MenuKeyNavigation={
+
+ __updateItemsList : function() {
+ var items = $('.'+this.options.listContainerCss+':first',this.popup.popup).find('>.'+this.options.itemCss)
+ .not('.'+this.options.disabledItemCss);
+ return (this.items = items);
+ },
+
+ __selectPrev : function() {
+ if (-1 == this.currentSelectedItemIndex){
+ this.currentSelectedItemIndex=this.items.length-1;
+ } else {
+ this.__deselectCurrentItem();
+ }
+
+ if (this.currentSelectedItemIndex > 0){
+ this.currentSelectedItemIndex--;
+ }
+ else {
+ this.currentSelectedItemIndex=this.items.length-1;
+ }
+
+ this.__selectCurrentItem();
+ },
+
+ __selectNext : function() {
+ if (-1 != this.currentSelectedItemIndex){
+ this.__deselectCurrentItem();
+ }
+ if (this.currentSelectedItemIndex < this.items.length-1){
+ this.currentSelectedItemIndex++;
+ }
+ else {
+ this.currentSelectedItemIndex = 0;
+ }
+
+ this.__selectCurrentItem();
+ },
+
+ __deselectCurrentItem : function () {
+ this.__deselectByIndex(this.currentSelectedItemIndex);
+ },
+
+ __selectCurrentItem : function () {
+ this.__selectByIndex(this.currentSelectedItemIndex);
+ },
+
+ __selectFirstItem : function () {
+ this.currentSelectedItemIndex = 0;
+ this.__selectCurrentItem();
+ },
+
+ __selectByIndex : function(index) {
+ if( -1 != index ){
+ rf.$(this.items.eq(index)).select();
+ }
+ },
+
+ __deselectByIndex : function (index) {
+ if( index > -1 ){
+ rf.$(this.items.eq(index)).unselect();
+ }
+
+ },
+
+ __openGroup : function () {
+ var item = this.__getItemByIndex(this.currentSelectedItemIndex);
+ if (this.__isGroup(item)){
+ rf.$(item).show();
+ rf.$(item).__selectFirstItem();
+ this.active = false;
+ }
+ },
+
+ __closeGroup : function () {
+ var item = this.__getItemByIndex(this.currentSelectedItemIndex);
+ if (this.__isGroup(item)){
+ rf.$(item).__deselectCurrentItem();
+ rf.$(item).hide();
+ this.active = true;
+ }
+ },
+
+ __returnToParentMenu : function () {
+ var item = this.__getItemByIndex(this.currentSelectedItemIndex);
+ var menu;
+ menu = this.__getParentMenu()||this.__getParentMenuFromItem(item);
+ if (menu != null){
+ this.hide();
+// this.active=false;
+// rf.$(menu).active=true;
+ rf.$(menu).popupElement.focus();
+ } else {
+ this.hide();
+ }
+ },
+
+ __activateMenuItem : function () {
+ var item = this.__getCurrentItem();
+ if (item){
+ menuItemId=item.attr('id');
+ this.activateItem(menuItemId);
+ }
+ },
+
+ __getItemByIndex : function(index) {
+ if (index > -1){
+ return this.items.eq(index);
+ } else{
+ return null;
+ }
+ },
+
+ __getCurrentItem : function() {
+ return this.__getItemByIndex(this.currentSelectedItemIndex);
+ },
+
+ __keydownHandler : function (e){
+ var code;
+
+ if(e.keyCode) {
+ code = e.keyCode;
+ } else if(e.which) {
+ code = e.which;
+ }
+
+ activeMenu=rf.ui.MenuManager.getActiveSubMenu();
+
+// console.info('__keydownHandler. this.id='+this.id+';' )
+// console.info('__keydownHandler.focId:'+document.activeElement+'; this.id:'+this.id+'; parent menu id:'+this.__getParentMenu().attr('id'));
+ if(this.popup.isVisible()) {
+ switch(code) {
+ case rf.KEYS.DOWN:
+ e.preventDefault();
+ activeMenu.__selectNext();
+ //this.__setInputFocus();
+ break;
+
+ case rf.KEYS.UP:
+ e.preventDefault();
+ activeMenu.__selectPrev();
+ //this.__setInputFocus();
+ break;
+ case rf.KEYS.LEFT:
+ e.preventDefault();
+ activeMenu.__returnToParentMenu();
+ break;
+
+ case rf.KEYS.RIGHT:
+ e.preventDefault();
+ activeMenu.__openGroup();
+ break;
+
+ case rf.KEYS.ESC:
+ e.preventDefault();
+ activeMenu.__returnToParentMenu();
+ break;
+
+ case rf.KEYS.RETURN:
+ e.preventDefault();
+ activeMenu.__activateMenuItem();
+ //this.__setInputFocus();
+ //return false;
+ break;
+ }
+ e.stopPropagation();
+ }
+ }
+ }
+})(jQuery, RichFaces);
\ No newline at end of file
Property changes on: trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/menuKeyNavigation.js
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/menugroup.js
===================================================================
--- trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/menugroup.js 2011-01-06 17:14:29 UTC (rev 20912)
+++ trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/menugroup.js 2011-01-06 17:50:51 UTC (rev 20913)
@@ -1,72 +1,94 @@
(function($, rf) {
rf.ui = rf.ui || {};
var defaultOptions = {
- showEvent: 'mouseover',
- attachToBody: false,
- positionOffset: [0, 0],
- selectItemCss: "rf-ddm-itm-sel",
- listCss: "rf-ddm-lst"
+ showEvent : 'mouseenter',
+ showDelay : 300,
+ attachToBody : false,
+ positionOffset : [0, 0],
+
+ selectItemCss : "rf-ddm-itm-sel",
+ itemCss : "rf-ddm-itm",
+ disabledItemCss : "rf-ddm-itm-dis",
+ listCss : "rf-ddm-lst",
+ listContainerCss : "rf-ddm-lst-bg"
}
- //constructor definition
- rf.ui.MenuGroup = function(componentId, options) {
- this.id = componentId;
- $super.constructor.call(this, componentId);
- this.attachToDom(componentId);
- this.options = {};
- $.extend(this.options, defaultOptions, options || {});
- this.parentMenu = rf.$(this.options.parentMenuId);
- this.popup = new RichFaces.ui.Popup(this.id + '_list',
- {attachTo: this.id,
- positionOffset: this.options.positionOffset,
- attachToBody: this.options.attachToBody
- }
- );
- rf.Event.bindById(this.id, "mouseenter", $.proxy(this.__enterHandler,this), this);
- rf.Event.bindById(this.id, "mouseleave",$.proxy(this.__leaveHandler,this), this);
- this.shown = false;
- };
-
- rf.BaseComponent.extend(rf.ui.MenuGroup);
-
- // define super class link
- var $super = rf.ui.MenuGroup.$super;
-
- $.extend(rf.ui.MenuGroup.prototype, (function() {
- return {
- name: "MenuGroup",
- show: function() {
- var id=this.id;
- if (this.parentMenu.groupList[id] && !this.shown) {
- this.parentMenu.invokeEvent("groupshow", rf.getDomElement(this.parentMenu.id), null);
- this.invokeEvent("show", rf.getDomElement(id), null);
- this.popup.show();
- this.shown=true;
- }
- },
- hide: function() {
- var id=this.id;
- var menu = this.parentMenu;
- if (menu.groupList[this.id] && this.shown) {
- menu.invokeEvent("grouphide", rf.getDomElement(menu.id), null);
- this.invokeEvent("hide", rf.getDomElement(id), null);
- this.popup.hide();
- this.shown = false;
- }
- },
+ //constructor definition
+ rf.ui.MenuGroup = function(componentId, options) {
+ this.id = componentId;
+ this.options = {};
+ $.extend(this.options, defaultOptions, options || {});
+ $super.constructor.call(this, componentId, this.options);
+ this.namespace = this.namespace || "."
+ + rf.Event.createNamespace(this.name, this.id);
+ this.attachToDom(componentId);
- __enterHandler: function(){
- this.show();
- },
- __leaveHandler: function(){
- this.hide();
- },
- destroy: function() {
- // clean up code here
- this.detach(this.id);
- // call parent's destroy method
- $super.destroy.call(this);
- }
- }
-
- })());
+ this.rootMenu = rf.$(this.options.rootMenuId);
+
+ this.shown = false;
+ this.jqueryElement = $(this.element);
+
+ };
+
+ rf.ui.MenuBase.extend(rf.ui.MenuGroup);
+
+ // define super class link
+ var $super = rf.ui.MenuGroup.$super;
+
+ $.extend(rf.ui.MenuGroup.prototype, rf.ui.MenuKeyNavigation);
+
+ $.extend(rf.ui.MenuGroup.prototype, (function() {
+ return {
+ name : "MenuGroup",
+ show : function() {
+ var id = this.id;
+ if (this.rootMenu.groupList[id] && !this.shown) {
+ this.rootMenu.invokeEvent("groupshow", rf
+ .getDomElement(this.rootMenu.id),
+ null);
+ this.__showPopup();
+ this.shown = true;
+ }
+ },
+ hide : function() {
+ var id = this.id;
+ var menu = this.rootMenu;
+ if (menu.groupList[this.id] && this.shown) {
+ menu.invokeEvent("grouphide", rf
+ .getDomElement(menu.id), null);
+ this.__hidePopup();
+ this.shown = false;
+ }
+ },
+
+ select : function() {
+ this.jqueryElement.removeClass('rf-ddm-itm-unsel');
+ this.jqueryElement.addClass('rf-ddm-itm-sel');
+ },
+ unselect : function() {
+ this.jqueryElement.removeClass('rf-ddm-itm-sel');
+ this.jqueryElement.addClass('rf-ddm-itm-unsel');
+ },
+
+ __showHandler : function() {
+ this.select();
+ $super.__showHandler.call(this);
+ },
+ __leaveHandler : function() {
+ window.clearTimeout(this.showTimeoutId);
+ this.hideTimeoutId = window.setTimeout($.proxy(
+ function() {
+ this.hide();
+ }, this), this.options.hideDelay);
+ this.unselect();
+ },
+
+ destroy : function() {
+ // clean up code here
+ this.detach(this.id);
+ // call parent's destroy method
+ $super.destroy.call(this);
+ }
+ }
+
+ })());
})(jQuery, RichFaces)
\ No newline at end of file
Added: trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/menuitem.js
===================================================================
--- trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/menuitem.js (rev 0)
+++ trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/menuitem.js 2011-01-06 17:50:51 UTC (rev 20913)
@@ -0,0 +1,69 @@
+(function($, rf) {
+ rf.ui = rf.ui || {};
+
+ var defaultOptions = {
+ selectItemCss : "rf-ddm-itm-sel",
+ unselectItemCss : "rf-ddm-itm-unsel",
+
+ }
+
+ // constructor definition
+
+ rf.ui.MenuItem = function(componentId, options) {
+ this.options = options;
+ $super.constructor.call(this, componentId);
+ this.attachToDom(componentId);
+ this.element = $(rf.getDomElement(componentId));
+ rf.Event.bindById(this.id,'click', this.__clickHandler, this);
+ rf.Event.bindById(this.id,'mouseenter',this.select, this);
+ rf.Event.bindById(this.id,'mouseleave',this.unselect, this);
+ this.selected = false;
+ }
+
+ rf.BaseComponent.extend(rf.ui.MenuItem);
+
+ // define super class link
+ var $super = rf.ui.MenuItem.$super;
+
+ $.extend(rf.ui.MenuItem.prototype, (function() {
+
+ return {
+ name : "MenuItem",
+ select : function() {
+ this.element.removeClass('rf-ddm-itm-unsel');
+ this.element.addClass('rf-ddm-itm-sel');
+ this.selected = true;
+ },
+ unselect : function() {
+ this.element.removeClass('rf-ddm-itm-sel');
+ this.element.addClass('rf-ddm-itm-unsel');
+ this.selected = false;
+ },
+ activate : function() {
+ this.invokeEvent('click',rf.getDomElement(this.id));
+ },
+
+ isSelected : function() {
+ return this.selected;
+ },
+
+ __clickHandler : function (e) {
+ parentMenu = this.__getParentMenu();
+ if (parentMenu){
+ this.__getParentMenu().processItem(this.element);
+ if (this.options.submitFunction){
+ this.options.submitFunction.call(this,e);
+ }
+ }
+ },
+
+ __getParentMenu : function () {
+ menu = this.element.parents('div.rf-ddm-lbl');
+ if (menu && menu.length > 0) return rf.$(menu);
+ else return null;
+
+ },
+ };
+})());
+
+})(jQuery, RichFaces)
\ No newline at end of file
Property changes on: trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/menuitem.js
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/ui/output/ui/src/main/templates/dropdownmenu.template.xml
===================================================================
--- trunk/ui/output/ui/src/main/templates/dropdownmenu.template.xml 2011-01-06 17:14:29 UTC (rev 20912)
+++ trunk/ui/output/ui/src/main/templates/dropdownmenu.template.xml 2011-01-06 17:50:51 UTC (rev 20913)
@@ -52,7 +52,7 @@
<cdk:scriptObject name="options">
<cdk:call expression='addToScriptHash(options, "direction", ((org.richfaces.component.Positioning)component.getAttributes().get("direction")).getValue())' />
<cdk:call expression='addToScriptHash(options, "jointPoint", ((org.richfaces.component.Positioning)component.getAttributes().get("jointPoint")).getValue())' />
- <cdk:scriptOption attributes="hideDelay showDelay popupWith mode" />
+ <cdk:scriptOption attributes="hideDelay showEvent showDelay popupWith mode horizontalOffset verticalOffset" />
<cdk:scriptOption attributes="onshow onhide ongroupshow ongrouphide onitemclick" wrapper="eventHandler"/>
</cdk:scriptObject>
Modified: trunk/ui/output/ui/src/main/templates/menugroup.template.xml
===================================================================
--- trunk/ui/output/ui/src/main/templates/menugroup.template.xml 2011-01-06 17:14:29 UTC (rev 20912)
+++ trunk/ui/output/ui/src/main/templates/menugroup.template.xml 2011-01-06 17:50:51 UTC (rev 20913)
@@ -27,13 +27,9 @@
<cdk:object name="isDisabled" type="boolean" value="#{isDisabled(facesContext, component)}" />
<cdk:object name="iconFacet" value="#{getIconFacet(facesContext, component)}" type="javax.faces.component.UIComponent" />
<cdk:object name="iconAttribute" value="#{getIconAttribute(facesContext, component)}" type="java.lang.String" />
+
- <cdk:object name="onmouseover" type="java.lang.String" value="this.className='rf-ddm-itm rf-ddm-itm-sel #{selectedClass}'" />
- <cdk:object name="onmouseout" type="java.lang.String" value="this.className='rf-ddm-itm rf-ddm-itm-unsel'" />
-
<div id="#{clientId}" class="rf-ddm-itm #{isDisabled ? 'rf-ddm-itm-dis '+disabledClass : 'rf-ddm-itm-unsel '+styleClass}" style="#{style}"
- onmouseover="#{isDisabled ? '' : onmouseover}"
- onmouseout="#{isDisabled ? '' : onmouseout}"
cdk:passThroughWithExclusions="" >
<span class="rf-ddm-itm-ic #{iconClass}">
<c:choose>
Modified: trunk/ui/output/ui/src/main/templates/menuitem.template.xml
===================================================================
--- trunk/ui/output/ui/src/main/templates/menuitem.template.xml 2011-01-06 17:14:29 UTC (rev 20912)
+++ trunk/ui/output/ui/src/main/templates/menuitem.template.xml 2011-01-06 17:50:51 UTC (rev 20913)
@@ -16,6 +16,9 @@
<cdk:resource-dependency name="dropdownmenu.ecss" library="org.richfaces" />
<cdk:resource-dependency name="ajax.reslib" library="org.richfaces" />
<cdk:resource-dependency name="base-component.reslib" library="org.richfaces" />
+
+ <cdk:resource-dependency name="menuitem.js" library="org.richfaces" />
+
</cc:interface>
<cc:implementation>
@@ -27,16 +30,12 @@
<cdk:object name="disabledClass" type="java.lang.String" value="#{getStyleClass(facesContext, component, 'disabledItemClass', 'disabledClass', 'disabledClass')}" />
<cdk:object name="isDisabled" type="boolean" value="#{isDisabled(facesContext, component)}" />
- <cdk:object name="onmouseover" type="java.lang.String" value="this.className='rf-ddm-itm rf-ddm-itm-sel #{selectedClass}'" />
- <cdk:object name="onmouseout" type="java.lang.String" value="this.className='rf-ddm-itm rf-ddm-itm-unsel #{styleClass}'" />
+
<cdk:object name="iconFacet" value="#{getIconFacet(facesContext, component)}" type="javax.faces.component.UIComponent" />
<cdk:object name="iconAttribute" value="#{getIconAttribute(facesContext, component)}" type="java.lang.String" />
- <div id="#{clientId}" class="rf-ddm-itm #{isDisabled ? 'rf-ddm-itm-dis '+disabledClass : 'rf-ddm-itm-unsel '+styleClass}" style="#{style}"
- onmouseover="#{isDisabled ? '' : onmouseover}"
- onmouseout="#{isDisabled ? '' : onmouseout}"
- onclick="#{getOnClickFunction(facesContext, component)}"
+ <div id="#{clientId}" class="rf-ddm-itm #{isDisabled ? 'rf-ddm-itm-dis '+disabledClass : 'rf-ddm-itm-unsel '+styleClass}" style="#{style}"
cdk:passThroughWithExclusions="">
<span class="rf-ddm-itm-ic #{iconClass}">
<c:choose>
@@ -77,6 +76,20 @@
</c:otherwise>
</c:choose>
- </div>
+ </div>
+ <c:choose>
+ <c:when test="#{not isDisabled}">
+ <script type="text/javascript">
+ <cdk:scriptObject name="options">
+ <cdk:scriptOption name="submitFunction" value="#{getOnClickFunction(facesContext, component)}" wrapper="eventHandler"/>
+ </cdk:scriptObject>
+
+ new RichFaces.ui.MenuItem(#{toScriptArgs(clientId, options)});
+
+ </script>
+ </c:when>
+ <c:otherwise>
+ </c:otherwise>
+ </c:choose>
</cc:implementation>
</cdk:root>
13 years, 11 months
JBoss Rich Faces SVN: r20912 - modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCalendar.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2011-01-06 12:14:29 -0500 (Thu, 06 Jan 2011)
New Revision: 20912
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCalendar/AbstractCalendarTest.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCalendar/TestRichCalendarAttributes.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCalendar/TestRichCalendarBasic.java
Log:
* fixed bugs in calendar tests
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCalendar/AbstractCalendarTest.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCalendar/AbstractCalendarTest.java 2011-01-06 16:14:50 UTC (rev 20911)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCalendar/AbstractCalendarTest.java 2011-01-06 17:14:29 UTC (rev 20912)
@@ -53,29 +53,29 @@
// basic parts
protected JQueryLocator calendar = pjq("span[id$=calendar]");
protected JQueryLocator inputs = pjq("span[id$=calendarPopup]");
- protected JQueryLocator input = pjq("input.rf-ca-inp");
- protected JQueryLocator image = pjq("img.rf-ca-btn");
- protected JQueryLocator button = pjq("button.rf-ca-btn");
+ protected JQueryLocator input = pjq("input.rf-cal-inp");
+ protected JQueryLocator image = pjq("img.rf-cal-btn");
+ protected JQueryLocator button = pjq("button.rf-cal-btn");
// popup
protected JQueryLocator popup = pjq("table[id$=calendarContent]");
- protected JQueryLocator prevYearButton = pjq("td.rf-ca-tl:eq(0) > div");
- protected JQueryLocator nextYearButton = pjq("td.rf-ca-tl:eq(3) > div");
- protected JQueryLocator prevMonthButton = pjq("td.rf-ca-tl:eq(1) > div");
- protected JQueryLocator nextMonthButton = pjq("td.rf-ca-tl:eq(2) > div");
- protected JQueryLocator closeButton = pjq("td.rf-ca-tl:eq(4) > div");
- protected JQueryLocator monthLabel = pjq("td.rf-ca-month > div");
+ protected JQueryLocator prevYearButton = pjq("td.rf-cal-tl:eq(0) > div");
+ protected JQueryLocator nextYearButton = pjq("td.rf-cal-tl:eq(3) > div");
+ protected JQueryLocator prevMonthButton = pjq("td.rf-cal-tl:eq(1) > div");
+ protected JQueryLocator nextMonthButton = pjq("td.rf-cal-tl:eq(2) > div");
+ protected JQueryLocator closeButton = pjq("td.rf-cal-tl:eq(4) > div");
+ protected JQueryLocator monthLabel = pjq("td.rf-cal-hdr-month > div");
// 0 = blank, 1 = Sun, 2 = Mon, 3 = Tue ...
- protected JQueryLocator weekDayLabel = pjq("td.rf-ca-days:eq({0})");
+ protected JQueryLocator weekDayLabel = pjq("td.rf-cal-day-lbl:eq({0})");
// week = 1..6, day = 0..6
protected JQueryLocator cellWeekDay = pjq("tr[id$=calendarWeekNum{0}] > td:eq({1})");
// day = 0..41
- protected JQueryLocator cellDay = pjq("td.rf-ca-c:eq({0})");
+ protected JQueryLocator cellDay = pjq("td.rf-cal-c:eq({0})");
// 0..6
- protected JQueryLocator week = pjq("td.rf-ca-week:eq({0})");
- protected JQueryLocator cleanButton = pjq("td.rf-ca-tl-ftr:eq(1) > div");
- protected JQueryLocator timeButton = pjq("td.rf-ca-tl-ftr:eq(2) > div");
- protected JQueryLocator todayButton = pjq("td.rf-ca-tl-ftr:eq(4) > div");
- protected JQueryLocator applyButton = pjq("td.rf-ca-tl-ftr:eq(5) > div");
+ protected JQueryLocator week = pjq("td.rf-cal-week:eq({0})");
+ protected JQueryLocator cleanButton = pjq("td.rf-cal-tl-ftr:eq(1) > div");
+ protected JQueryLocator timeButton = pjq("td.rf-cal-tl-ftr:eq(2) > div");
+ protected JQueryLocator todayButton = pjq("td.rf-cal-tl-ftr:eq(4) > div");
+ protected JQueryLocator applyButton = pjq("td.rf-cal-tl-ftr:eq(5) > div");
// time panel
protected JQueryLocator timePanel = pjq("table[id$=calendarEditor]");
protected JQueryLocator hoursInput = pjq("input[id$=calendarTimeHours]");
@@ -84,8 +84,8 @@
protected JQueryLocator minutesInput = pjq("input[id$=calendarTimeMinutes]");
protected JQueryLocator minutesInputUp = pjq("div[id$=calendarTimeMinutesBtnUp]");
protected JQueryLocator minutesInputDown = pjq("div[id$=calendarTimeMinutesBtnDown]");
- protected JQueryLocator okButton = pjq("td.rf-ca-time-layout-ok > div");
- protected JQueryLocator cancelButton = pjq("td.rf-ca-time-layout-cancel > div");
+ protected JQueryLocator okButton = pjq("td.rf-cal-time-layout-ok > div");
+ protected JQueryLocator cancelButton = pjq("td.rf-cal-time-layout-cancel > div");
protected JQueryLocator output = pjq("span[id$=output]");
}
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCalendar/TestRichCalendarAttributes.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCalendar/TestRichCalendarAttributes.java 2011-01-06 16:14:50 UTC (rev 20911)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCalendar/TestRichCalendarAttributes.java 2011-01-06 17:14:29 UTC (rev 20912)
@@ -261,7 +261,7 @@
selenium.click(input);
for (int i = 2; i < 42; i += 7) {
- if (!selenium.belongsClass(cellDay.format(i), "rf-ca-boundary-dates")) {
+ if (!selenium.belongsClass(cellDay.format(i), "rf-cal-boundary-day")) {
assertTrue(selenium.belongsClass(cellDay.format(i), "yellowDay"), "Cell nr. " + i + " should be yellow.");
}
}
@@ -674,7 +674,7 @@
*/
private void assertNoDateSelected() {
for (int i = 0; i < 42; i++) {
- assertFalse(selenium.belongsClass(cellDay.format(i), "rf-ca-sel"), "Cell nr. " + i + " should not be selected.");
+ assertFalse(selenium.belongsClass(cellDay.format(i), "rf-cal-sel"), "Cell nr. " + i + " should not be selected.");
}
}
@@ -695,9 +695,9 @@
// check 3 lines of cells that contain selected date
for (int i = lowerBoundary; i < upperBoundary; i++) {
if (exceptOfDate.equals(selenium.getText(cellDay.format(i)))) {
- assertTrue(selenium.belongsClass(cellDay.format(i), "rf-ca-sel"), "Cell nr. " + i + " should not be selected.");
+ assertTrue(selenium.belongsClass(cellDay.format(i), "rf-cal-sel"), "Cell nr. " + i + " should not be selected.");
} else {
- assertFalse(selenium.belongsClass(cellDay.format(i), "rf-ca-sel"), "Cell nr. " + i + " should not be selected.");
+ assertFalse(selenium.belongsClass(cellDay.format(i), "rf-cal-sel"), "Cell nr. " + i + " should not be selected.");
}
}
@@ -706,7 +706,7 @@
// check other 3 lines of cells
for (int i = lowerBoundary; i < upperBoundary; i++) {
- assertFalse(selenium.belongsClass(cellDay.format(i), "rf-ca-sel"), "Cell nr. " + i + " should not be selected.");
+ assertFalse(selenium.belongsClass(cellDay.format(i), "rf-cal-sel"), "Cell nr. " + i + " should not be selected.");
}
}
}
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCalendar/TestRichCalendarBasic.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCalendar/TestRichCalendarBasic.java 2011-01-06 16:14:50 UTC (rev 20911)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCalendar/TestRichCalendarBasic.java 2011-01-06 17:14:29 UTC (rev 20912)
@@ -184,7 +184,7 @@
for (int i = lowerBoundary; i < upperBoundary; i++) {
String day = selenium.getText(cellDay.format(i));
if (day.equals(today)) {
- assertTrue(selenium.belongsClass(cellDay.format(i), "rf-ca-today"), "Today's date is not styled correctly.");
+ assertTrue(selenium.belongsClass(cellDay.format(i), "rf-cal-today"), "Today's date is not styled correctly.");
return;
}
}
@@ -214,10 +214,10 @@
selenium.click(input);
guardNoRequest(selenium).click(cellDay.format(6));
- assertTrue(selenium.belongsClass(cellDay.format(6), "rf-ca-sel"), "Last date in the first week is not selected.");
+ assertTrue(selenium.belongsClass(cellDay.format(6), "rf-cal-sel"), "Last date in the first week is not selected.");
selenium.click(cellDay.format(8));
- assertFalse(selenium.belongsClass(cellDay.format(6), "rf-ca-sel"), "Last date in the first week should not be selected.");
+ assertFalse(selenium.belongsClass(cellDay.format(6), "rf-cal-sel"), "Last date in the first week should not be selected.");
}
@Test
@@ -226,7 +226,7 @@
selenium.click(cellDay.format(6));
guardNoRequest(selenium).click(cleanButton);
- assertFalse(selenium.belongsClass(cellDay.format(6), "rf-ca-sel"), "Last date in the first week should not be selected.");
+ assertFalse(selenium.belongsClass(cellDay.format(6), "rf-cal-sel"), "Last date in the first week should not be selected.");
}
@Test
13 years, 11 months
JBoss Rich Faces SVN: r20911 - in trunk: examples/output-demo/src/main/webapp/resources/tests and 4 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2011-01-06 11:14:50 -0500 (Thu, 06 Jan 2011)
New Revision: 20911
Modified:
trunk/examples/output-demo/src/main/webapp/examples/accordion.xhtml
trunk/examples/output-demo/src/main/webapp/examples/togglePanel-mixed.xhtml
trunk/examples/output-demo/src/main/webapp/resources/tests/richfaces-accordion-headers-qunit.js
trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractTogglePanelItem.java
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/AccordionItemRenderer.java
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/AccordionRenderer.java
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/CollapsiblePanelRenderer.java
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/DivPanelRenderer.java
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TabPanelRenderer.java
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TogglePanelItemRenderer.java
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TogglePanelRenderer.java
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/accordionItem.js
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/collapsiblePanel.js
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/togglePanel.js
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/togglePanelItem.js
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/collapsiblePanel.xmlunit.xml
Log:
RF-9895 Toggle panel item: attributes onenter and onleave ignored
RF-9821 Accordion item: attributes onenter and onleave do not work
Modified: trunk/examples/output-demo/src/main/webapp/examples/accordion.xhtml
===================================================================
--- trunk/examples/output-demo/src/main/webapp/examples/accordion.xhtml 2011-01-06 14:24:34 UTC (rev 20910)
+++ trunk/examples/output-demo/src/main/webapp/examples/accordion.xhtml 2011-01-06 16:14:50 UTC (rev 20911)
@@ -16,10 +16,12 @@
<h:form id="f" style="border:blue solid thin;">
<h:panelGroup>
- <pn:accordion width="500px" height="300px" itemChangeListener="#{togglePanelBean.itemChangeActionListener}">
- <pn:accordionItem header="label 1">Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here.</pn:accordionItem>
- <pn:accordionItem header="label 2">content 2</pn:accordionItem>
- <pn:accordionItem header="label 3">content 3</pn:accordionItem>
+ <pn:accordion width="500px" height="300px" itemChangeListener="#{togglePanelBean.itemChangeActionListener}" switchType="ajax"
+ itemRightIconActive="triangleDown" itemRightIconInactive="triangleUp" itemRightIconDisabled="disc" itemLeftIconDisabled="disc" >
+ <pn:accordionItem header="label 1" >Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here.</pn:accordionItem>
+ <pn:accordionItem header="label 2" >content 2</pn:accordionItem>
+ <pn:accordionItem header="label 3" onenter="alert('hello, world!')" >content 3</pn:accordionItem>
+ <pn:accordionItem header="label 4" disabled="true" >content 4</pn:accordionItem>
</pn:accordion>
</h:panelGroup>
</h:form>
Modified: trunk/examples/output-demo/src/main/webapp/examples/togglePanel-mixed.xhtml
===================================================================
--- trunk/examples/output-demo/src/main/webapp/examples/togglePanel-mixed.xhtml 2011-01-06 14:24:34 UTC (rev 20910)
+++ trunk/examples/output-demo/src/main/webapp/examples/togglePanel-mixed.xhtml 2011-01-06 16:14:50 UTC (rev 20911)
@@ -15,8 +15,8 @@
<ui:define name="body">
<h:form id="f">
<pn:togglePanel id="panel" activeItem="name1" switchType="client" lang="en" cycledSwitching="true" >
- <pn:togglePanelItem name="name1">hello name1 client</pn:togglePanelItem>
- <pn:togglePanelItem name="name2" switchType="ajax">hello name2 ajax</pn:togglePanelItem>
+ <pn:togglePanelItem name="name1" >hello name1 client</pn:togglePanelItem>
+ <pn:togglePanelItem name="name2" onenter="alert('onenter ajax');" switchType="ajax">hello name2 ajax</pn:togglePanelItem>
<pn:togglePanelItem name="name3" switchType="server">hello name3 server</pn:togglePanelItem>
</pn:togglePanel>
Modified: trunk/examples/output-demo/src/main/webapp/resources/tests/richfaces-accordion-headers-qunit.js
===================================================================
--- trunk/examples/output-demo/src/main/webapp/resources/tests/richfaces-accordion-headers-qunit.js 2011-01-06 14:24:34 UTC (rev 20910)
+++ trunk/examples/output-demo/src/main/webapp/resources/tests/richfaces-accordion-headers-qunit.js 2011-01-06 16:14:50 UTC (rev 20911)
@@ -25,32 +25,37 @@
var ACCORDION_ID = "f:panel";
+ function isLabelVisible(item, state) {
+ return item.__header().find(".rf-ac-itm-lbl-" + state).is(":visible");
+ }
+
function testFirst(items) {
- ok(items[0].__header("act").is(":visible"), "1 item: active visible");
- ok(!items[0].__header("inact").is(":visible"), "1 item: inactive unvisible");
- ok(!items[0].__header("dis").is(":visible"), "1 item: disabled unvisible");
- ok(!items[1].__header("act").is(":visible"), "2 item: active visible");
- ok(!items[1].__header("inact").is(":visible"), "2 item: inactive unvisible");
- ok(items[1].__header("dis").is(":visible"), "2 item: disabled unvisible");
+ ok( isLabelVisible(items[0], "act"), "1 item: active visible");
+ ok(!isLabelVisible(items[0], "inact"), "1 item: inactive unvisible");
+ ok(!isLabelVisible(items[0],"dis"), "1 item: disabled unvisible");
- ok(!items[2].__header("act").is(":visible"), "3 item: active unvisible");
- ok(items[2].__header("inact").is(":visible"), "3 item: inactive visible");
- ok(!items[2].__header("dis").is(":visible"), "3 item: disabled unvisible");
+ ok(!isLabelVisible(items[1],"act"), "2 item: active visible");
+ ok(!isLabelVisible(items[1],"inact"), "2 item: inactive unvisible");
+ ok( isLabelVisible(items[1],"dis"), "2 item: disabled unvisible");
+
+ ok(!isLabelVisible(items[2], "act"), "3 item: active unvisible");
+ ok( isLabelVisible(items[2], "inact"), "3 item: inactive visible");
+ ok(!isLabelVisible(items[2], "dis"), "3 item: disabled unvisible");
}
-
+
function testLast(items) {
- ok(!items[0].__header("act").is(":visible"), "1 item: active unvisible");
- ok(items[0].__header("inact").is(":visible"), "1 item: inactive visible");
- ok(!items[0].__header("dis").is(":visible"), "1 item: disabled unvisible");
+ ok(!isLabelVisible(items[0], "act"), "1 item: active unvisible");
+ ok( isLabelVisible(items[0], "inact"), "1 item: inactive visible");
+ ok(!isLabelVisible(items[0], "dis"), "1 item: disabled unvisible");
- ok(!items[1].__header("act").is(":visible"), "2 item: active visible");
- ok(!items[1].__header("inact").is(":visible"), "2 item: inactive unvisible");
- ok(items[1].__header("dis").is(":visible"), "2 item: disabled unvisible");
+ ok(!isLabelVisible(items[1], "act"), "2 item: active visible");
+ ok(!isLabelVisible(items[1], "inact"), "2 item: inactive unvisible");
+ ok( isLabelVisible(items[1], "dis"), "2 item: disabled unvisible");
- ok(items[2].__header("act").is(":visible"), "3 item: active visible");
- ok(!items[2].__header("inact").is(":visible"), "3 item: inactive unvisible");
- ok(!items[2].__header("dis").is(":visible"), "3 item: disabled unvisible");
+ ok( isLabelVisible(items[2], "act"), "3 item: active visible");
+ ok(!isLabelVisible(items[2], "inact"), "3 item: inactive unvisible");
+ ok(!isLabelVisible(items[2], "dis"), "3 item: disabled unvisible");
}
test("RichFaces.ui.Accordion change headers", function () {
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractTogglePanelItem.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractTogglePanelItem.java 2011-01-06 14:24:34 UTC (rev 20910)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractTogglePanelItem.java 2011-01-06 16:14:50 UTC (rev 20911)
@@ -22,15 +22,15 @@
package org.richfaces.component;
-import java.io.IOException;
-import java.util.Map;
+import org.richfaces.renderkit.html.TogglePanelItemRenderer;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
+import javax.faces.event.PreRenderComponentEvent;
import javax.faces.render.Renderer;
+import java.io.IOException;
+import java.util.Map;
-import org.richfaces.renderkit.HtmlConstants;
-
/**
* @author akolonitsky
* @version 1.0
@@ -78,11 +78,8 @@
break;
case ajax:
- context.getResponseWriter().write(getPlaceHolder());
- break;
-
case server:
- // Do nothing.
+ this.encodePlaceHolderWithJs(context);
break;
default:
@@ -91,14 +88,34 @@
}
}
- private String getPlaceHolder() {
- return "<div id=\"" + getClientId() + "\" style=\"display: none\" ></div>";
+ public void encodePlaceHolderWithJs(FacesContext context) throws IOException {
+ if (context == null) {
+ throw new IllegalArgumentException();
+ }
+
+ if (!isRendered()) {
+ return;
+ }
+
+ pushComponentToEL(context, null);
+
+ context.getApplication().publishEvent(context, PreRenderComponentEvent.class, this);
+
+ if (this.getRendererType() != null) {
+ TogglePanelItemRenderer renderer = (TogglePanelItemRenderer) this.getRenderer(context);
+ if (renderer != null) {
+ renderer.encodePlaceHolderWithJs(context, this);
+ }
+ }
+
+ popComponentFromEL(context);
}
protected static void hidePanelItem(UIComponent item) {
+ // TODO move to renderer
Map<String,Object> attrs = item.getAttributes();
- Object style = attrs.get(HtmlConstants.STYLE_ATTRIBUTE);
- attrs.put(HtmlConstants.STYLE_ATTRIBUTE, "display:none; " + style);
+ Object style = attrs.get("style");
+ attrs.put("style", "display:none; " + style);
}
public abstract String getName();
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/AccordionItemRenderer.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/AccordionItemRenderer.java 2011-01-06 14:24:34 UTC (rev 20910)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/AccordionItemRenderer.java 2011-01-06 16:14:50 UTC (rev 20911)
@@ -22,24 +22,22 @@
package org.richfaces.renderkit.html;
-import static org.richfaces.renderkit.HtmlConstants.*;
-import static org.richfaces.renderkit.RenderKitUtils.renderPassThroughAttributes;
+import org.ajax4jsf.javascript.JSObject;
+import org.richfaces.component.AbstractTogglePanelTitledItem;
+import org.richfaces.component.html.HtmlAccordionItem;
+import org.richfaces.component.html.HtmlAccordionItem.PropertyKeys;
+import org.richfaces.renderkit.RenderKitUtils;
-import java.io.IOException;
-import java.util.Map;
-
import javax.faces.application.ResourceDependencies;
import javax.faces.application.ResourceDependency;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
+import java.io.IOException;
+import java.util.Map;
-import org.ajax4jsf.javascript.JSObject;
-import org.richfaces.component.AbstractTogglePanelTitledItem;
-import org.richfaces.component.html.HtmlAccordionItem;
-import org.richfaces.component.html.HtmlAccordionItem.PropertyKeys;
-import org.richfaces.renderkit.HtmlConstants;
-import org.richfaces.renderkit.RenderKitUtils;
+import static org.richfaces.renderkit.HtmlConstants.*;
+import static org.richfaces.renderkit.RenderKitUtils.renderPassThroughAttributes;
/**
*
@@ -88,19 +86,6 @@
super.doEncodeEnd(writer, context, component);
}
- @Override
- protected void writeJavaScript(ResponseWriter writer, FacesContext context, UIComponent component) throws IOException {
- Object script = getScriptObject(context, component);
- if (script == null) {
- return;
- }
-
- writer.startElement(HtmlConstants.SCRIPT_ELEM, component);
- writer.writeAttribute(HtmlConstants.TYPE_ATTR, "text/javascript", "type");
- writer.writeText(script, null);
- writer.endElement(HtmlConstants.SCRIPT_ELEM);
- }
-
private void encodeContentBegin(UIComponent component, ResponseWriter writer) throws IOException {
writer.startElement(DIV_ELEM, component);
writer.writeAttribute(CLASS_ATTRIBUTE, concatClasses("rf-ac-itm-cnt", attributeAsString(component, "contentClass")), null);
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/AccordionRenderer.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/AccordionRenderer.java 2011-01-06 14:24:34 UTC (rev 20910)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/AccordionRenderer.java 2011-01-06 16:14:50 UTC (rev 20911)
@@ -25,17 +25,15 @@
import org.ajax4jsf.javascript.JSObject;
import org.richfaces.component.AbstractAccordion;
import org.richfaces.component.util.HtmlUtil;
-import org.richfaces.renderkit.HtmlConstants;
import javax.faces.application.ResourceDependencies;
import javax.faces.application.ResourceDependency;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
-import javax.faces.context.ResponseWriter;
-import java.io.IOException;
import java.util.Map;
-import static org.richfaces.component.html.HtmlAccordion.PropertyKeys.*;
+import static org.richfaces.component.html.HtmlAccordion.PropertyKeys.height;
+import static org.richfaces.component.html.HtmlAccordion.PropertyKeys.width;
/**
* @author akolonitsky
@@ -52,19 +50,9 @@
public class AccordionRenderer extends TogglePanelRenderer {
@Override
- protected void doEncodeBegin(ResponseWriter writer, FacesContext context, UIComponent component) throws IOException {
- super.doEncodeBegin(writer, context, component);
-
- writeJavaScript(writer, context, component);
- }
-
- @Override
protected String getStyle(UIComponent component) {
- return HtmlUtil.concatStyles(
- attributeAsStyle(component, height),
- attributeAsStyle(component, width),
-
- super.getStyle(component));
+ return HtmlUtil.concatStyles(attributeAsStyle(component, height), attributeAsStyle(component, width),
+ super.getStyle(component));
}
@Override
@@ -73,11 +61,6 @@
}
@Override
- protected void doEncodeEnd(ResponseWriter writer, FacesContext context, UIComponent component) throws IOException {
- writer.endElement(HtmlConstants.DIV_ELEM);
- }
-
- @Override
protected Class<? extends UIComponent> getComponentClass() {
return AbstractAccordion.class;
}
@@ -92,7 +75,6 @@
protected Map<String, Object> getScriptObjectOptions(FacesContext context, UIComponent component) {
Map<String, Object> options = super.getScriptObjectOptions(context, component);
options.put("isKeepHeight", attributeAsString(component, height).length() > 0);
- options.remove("items");
return options;
}
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/CollapsiblePanelRenderer.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/CollapsiblePanelRenderer.java 2011-01-06 14:24:34 UTC (rev 20910)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/CollapsiblePanelRenderer.java 2011-01-06 16:14:50 UTC (rev 20911)
@@ -34,7 +34,6 @@
import javax.faces.context.ResponseWriter;
import java.io.IOException;
import java.util.HashMap;
-import java.util.List;
import java.util.Map;
import static org.richfaces.renderkit.HtmlConstants.*;
@@ -115,10 +114,10 @@
}
@Override
- protected void doEncodeBegin(ResponseWriter writer, FacesContext context, UIComponent comp) throws IOException {
- super.doEncodeBegin(writer, context, comp);
+ protected void doEncodeBegin(ResponseWriter writer, FacesContext context, UIComponent component) throws IOException {
+ super.doEncodeBegin(writer, context, component);
- encodeHeader(writer, context, (HtmlCollapsiblePanel) comp);
+ encodeHeader(writer, context, (HtmlCollapsiblePanel) component);
}
@Override
@@ -240,11 +239,6 @@
}
@Override
- protected List<JSObject> getChildrenScriptObjects(FacesContext context, UIComponent component) {
- return null;
- }
-
- @Override
protected Class<? extends UIComponent> getComponentClass() {
return AbstractCollapsiblePanel.class;
}
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/DivPanelRenderer.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/DivPanelRenderer.java 2011-01-06 14:24:34 UTC (rev 20910)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/DivPanelRenderer.java 2011-01-06 16:14:50 UTC (rev 20911)
@@ -130,12 +130,14 @@
protected void writeJavaScript(ResponseWriter writer, FacesContext context, UIComponent component) throws IOException {
Object script = getScriptObject(context, component);
- if (script != null) {
- writer.startElement(HtmlConstants.SCRIPT_ELEM, component);
- writer.writeAttribute(HtmlConstants.TYPE_ATTR, "text/javascript", "type");
- writer.writeText(script, null);
- writer.endElement(HtmlConstants.SCRIPT_ELEM);
+ if (script == null) {
+ return;
}
+
+ writer.startElement(HtmlConstants.SCRIPT_ELEM, component);
+ writer.writeAttribute(HtmlConstants.TYPE_ATTR, "text/javascript", "type");
+ writer.writeText(script, null);
+ writer.endElement(HtmlConstants.SCRIPT_ELEM);
}
protected Object getScriptObject(FacesContext context, UIComponent component) {
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TabPanelRenderer.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TabPanelRenderer.java 2011-01-06 14:24:34 UTC (rev 20910)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TabPanelRenderer.java 2011-01-06 16:14:50 UTC (rev 20911)
@@ -76,11 +76,11 @@
private static final String CLASS = CLASS_ATTRIBUTE;
@Override
- protected void doEncodeBegin(ResponseWriter w, FacesContext context, UIComponent comp) throws IOException {
- super.doEncodeBegin(w, context, comp);
- writeJavaScript(w, context, comp);
+ protected void doEncodeBegin(ResponseWriter w, FacesContext context, UIComponent component) throws IOException {
+ super.doEncodeBegin(w, context, component);
+ writeJavaScript(w, context, component);
- writeTabsLine(w, context, comp);
+ writeTabsLine(w, context, component);
writeTabsLineSeparator(w);
}
@@ -212,7 +212,6 @@
protected Map<String, Object> getScriptObjectOptions(FacesContext context, UIComponent component) {
Map<String, Object> options = super.getScriptObjectOptions(context, component);
options.put("isKeepHeight", attributeAsString(component, height).length() > 0);
- options.remove("items");
return options;
}
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TogglePanelItemRenderer.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TogglePanelItemRenderer.java 2011-01-06 14:24:34 UTC (rev 20910)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TogglePanelItemRenderer.java 2011-01-06 16:14:50 UTC (rev 20911)
@@ -25,7 +25,6 @@
import org.ajax4jsf.javascript.JSObject;
import org.richfaces.component.AbstractTogglePanel;
import org.richfaces.component.AbstractTogglePanelItem;
-import org.richfaces.component.util.HtmlUtil;
import javax.faces.application.ResourceDependencies;
import javax.faces.application.ResourceDependency;
@@ -54,17 +53,10 @@
@Override
protected String getStyleClass(UIComponent component) {
- return HtmlUtil.concatClasses("rf-tgp-itm", attributeAsString(component, "styleClass"));
+ return concatClasses("rf-tgp-itm", attributeAsString(component, "styleClass"));
}
@Override
- protected void writeJavaScript(ResponseWriter writer, FacesContext context, UIComponent component)
- throws IOException {
-
- // All script should be written by TogglePanel using method getScriptObject
- }
-
- @Override
protected JSObject getScriptObject(FacesContext context, UIComponent component) {
return new JSObject("RichFaces.ui.TogglePanelItem", component.getClientId(),
getScriptObjectOptions(context, component));
@@ -74,7 +66,7 @@
protected Map<String, Object> getScriptObjectOptions(FacesContext context, UIComponent component) {
AbstractTogglePanelItem panelItem = (AbstractTogglePanelItem) component;
- Map<String, Object> options = new HashMap<String, Object>(5);
+ Map<String, Object> options = new HashMap<String, Object>();
options.put("name", panelItem.getName());
options.put("togglePanelId", panelItem.getParent().getClientId());
options.put("switchMode", panelItem.getSwitchType());
@@ -93,5 +85,17 @@
protected Class<? extends UIComponent> getComponentClass() {
return AbstractTogglePanelItem.class;
}
+
+ public void encodePlaceHolderWithJs(FacesContext context, AbstractTogglePanelItem item) throws IOException {
+ ResponseWriter writer = context.getResponseWriter();
+
+ writer.startElement("div", null);
+ writer.writeAttribute("id", item.getClientId(context), null);
+ writer.writeAttribute("style", "display:none;", null);
+
+ writeJavaScript(writer, context, item);
+
+ writer.endElement("div");
+ }
}
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TogglePanelRenderer.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TogglePanelRenderer.java 2011-01-06 14:24:34 UTC (rev 20910)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TogglePanelRenderer.java 2011-01-06 16:14:50 UTC (rev 20911)
@@ -22,18 +22,6 @@
package org.richfaces.renderkit.html;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.faces.application.ResourceDependencies;
-import javax.faces.application.ResourceDependency;
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-import javax.faces.context.ResponseWriter;
-
import org.ajax4jsf.javascript.JSFunctionDefinition;
import org.ajax4jsf.javascript.JSObject;
import org.ajax4jsf.javascript.JSReference;
@@ -47,6 +35,15 @@
import org.richfaces.renderkit.util.FormUtil;
import org.richfaces.renderkit.util.HandlersChain;
+import javax.faces.application.ResourceDependencies;
+import javax.faces.application.ResourceDependency;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+
/**
* @author akolonitsky
* @since -4712-01-01
@@ -105,18 +102,20 @@
}
@Override
- protected void doEncodeBegin(ResponseWriter writer, FacesContext context, UIComponent comp) throws IOException {
- FormUtil.throwEnclFormReqExceptionIfNeed(context, comp);
+ protected void doEncodeBegin(ResponseWriter writer, FacesContext context, UIComponent component) throws IOException {
+ FormUtil.throwEnclFormReqExceptionIfNeed(context, component);
- super.doEncodeBegin(writer, context, comp);
- AbstractTogglePanel panel = (AbstractTogglePanel) comp;
+ super.doEncodeBegin(writer, context, component);
+ AbstractTogglePanel panel = (AbstractTogglePanel) component;
- writer.startElement(HtmlConstants.INPUT_ELEM, comp);
+ writer.startElement(HtmlConstants.INPUT_ELEM, component);
writer.writeAttribute(HtmlConstants.TYPE_ATTR, HtmlConstants.INPUT_TYPE_HIDDEN, null);
writer.writeAttribute(HtmlConstants.VALUE_ATTRIBUTE, panel.getActiveItem(), "activeItem");
- writer.writeAttribute(HtmlConstants.ID_ATTRIBUTE, getValueRequestParamName(context, comp), null);
- writer.writeAttribute(HtmlConstants.NAME_ATTRIBUTE, getValueRequestParamName(context, comp), null);
+ writer.writeAttribute(HtmlConstants.ID_ATTRIBUTE, getValueRequestParamName(context, component), null);
+ writer.writeAttribute(HtmlConstants.NAME_ATTRIBUTE, getValueRequestParamName(context, component), null);
writer.endElement(HtmlConstants.INPUT_ELEM);
+
+ writeJavaScript(writer, context, component);
}
@Override
@@ -132,6 +131,11 @@
}
@Override
+ protected void doEncodeEnd(ResponseWriter writer, FacesContext context, UIComponent component) throws IOException {
+ writer.endElement(HtmlConstants.DIV_ELEM);
+ }
+
+ @Override
protected JSObject getScriptObject(FacesContext context, UIComponent component) {
return new JSObject("RichFaces.ui.TogglePanel",
component.getClientId(), getScriptObjectOptions(context, component));
@@ -144,7 +148,6 @@
Map<String, Object> options = new HashMap<String, Object>();
options.put("activeItem", panel.getActiveItem());
options.put("cycledSwitching", panel.isCycledSwitching());
- options.put("items", getChildrenScriptObjects(context, panel));
options.put("ajax", getAjaxOptions(context, panel));
addEventOption(context, panel, options, ITEM_CHANGE);
@@ -172,19 +175,6 @@
return AjaxRendererUtils.buildEventOptions(context, panel);
}
- protected List<JSObject> getChildrenScriptObjects(FacesContext context, UIComponent component) {
- List<JSObject> res = new ArrayList<JSObject>(component.getChildCount());
- for (UIComponent child : component.getChildren()) {
- res.add(getChildScriptObject(context, (AbstractTogglePanelItem) child));
- }
- return res;
- }
-
- private JSObject getChildScriptObject(FacesContext context, AbstractTogglePanelItem child) {
- return ((TogglePanelItemRenderer) child.getRenderer(context))
- .getScriptObject(context, child);
- }
-
@Override
protected Class<? extends UIComponent> getComponentClass() {
return AbstractTogglePanel.class;
Modified: trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/accordionItem.js
===================================================================
--- trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/accordionItem.js 2011-01-06 14:24:34 UTC (rev 20910)
+++ trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/accordionItem.js 2011-01-06 16:14:50 UTC (rev 20911)
@@ -38,8 +38,6 @@
* */
init : function (componentId, options) {
$super.constructor.call(this, componentId, options);
- this.index = options["index"];
- this.getTogglePanel().getItems()[this.index] = this;
if (!this.disabled) {
rf.Event.bindById(this.id + ":header", "click", this.__onHeaderClick, this);
@@ -60,12 +58,9 @@
},
/**
- * @param state {string} = inactive | active | disabled
- * in that case looking header by css class appropriate to this state
- *
* @return {jQuery Object}
* */
- __header : function (state) {
+ __header : function () {
return $(rf.getDomElement(this.id + ":header"));
},
@@ -131,18 +126,6 @@
this.__header().removeClass("rf-ac-itm-hdr-act").addClass("rf-ac-itm-hdr-inact");
return true;
- },
-
- /***************************** Private Methods ********************************************************/
-
-
- destroy: function () {
- var parent = this.getTogglePanel();
- delete parent.getItems()[this.index];
-
- rf.Event.unbindById(this.id, "."+this.namespace);
-
- $super.destroy.call(this);
}
});
Modified: trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/collapsiblePanel.js
===================================================================
--- trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/collapsiblePanel.js 2011-01-06 14:24:34 UTC (rev 20910)
+++ trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/collapsiblePanel.js 2011-01-06 16:14:50 UTC (rev 20911)
@@ -43,16 +43,18 @@
this.__addUserEventHandler("beforeswitch");
this.__addUserEventHandler("switch");
- this.items = [
+ this.options.cycledSwitching = true;
+
+ var panel = this;
+ $(document.getElementById(this.id)).ready(function () { // TODO
+ rf.Event.bindById(panel.id + ":header", "click", panel.__onHeaderClick, panel);
+
new RichFaces.ui.CollapsiblePanelItem(
- this.id + ":content", {"index":0, "togglePanelId":this.id, "switchMode":this.switchMode, "name":"true"}),
+ panel.id + ":content", {"index":0, "togglePanelId":panel.id, "switchMode":panel.switchMode, "name":"true"}),
new RichFaces.ui.CollapsiblePanelItem(
- this.id + ":empty", {"index":1, "togglePanelId":this.id, "switchMode":this.switchMode, "name":"false"})
- ];
- this.options.cycledSwitching = true;
-
- rf.Event.bindById(this.id + ":header", "click", this.__onHeaderClick, this);
+ panel.id + ":empty", {"index":1, "togglePanelId":panel.id, "switchMode":panel.switchMode, "name":"false"})
+ })
},
switchPanel : function (to) {
Modified: trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/togglePanel.js
===================================================================
--- trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/togglePanel.js 2011-01-06 14:24:34 UTC (rev 20910)
+++ trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/togglePanel.js 2011-01-06 16:14:50 UTC (rev 20911)
@@ -156,9 +156,10 @@
$super.constructor.call(this, componentId);
this.attachToDom();
+ this.items = [];
+
this.options = $.extend(this.options, options || {});
this.activeItem = this.options.activeItem;
- this.items = this.options.items;
this.__addUserEventHandler("itemchange");
this.__addUserEventHandler("beforeitemchange");
@@ -421,10 +422,6 @@
oldItem : oldItem,
newItem : newItem
});
- },
-
- destroy: function () {
- $super.destroy.call(this);
}
});
Modified: trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/togglePanelItem.js
===================================================================
--- trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/togglePanelItem.js 2011-01-06 14:24:34 UTC (rev 20910)
+++ trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/togglePanelItem.js 2011-01-06 16:14:50 UTC (rev 20911)
@@ -30,9 +30,8 @@
name:"TogglePanelItem",
init : function (componentId, options) {
- // call constructor of parent class
$super.constructor.call(this, componentId);
- this.attachToDom();
+ this.attachToDom(this.id);
this.options = $.extend(this.options, options || {});
this.name = this.options.name;
@@ -40,6 +39,9 @@
this.switchMode = this.options.switchMode;
this.disabled = this.options.disabled || false;
+ this.index = options["index"];
+ this.getTogglePanel().getItems()[this.index] = this;
+
this.__addUserEventHandler("enter");
this.__addUserEventHandler("leave");
},
@@ -84,7 +86,7 @@
__addUserEventHandler : function (name) {
var handler = this.options["on" + name];
if (handler) {
- rf.Event.bindById(this.togglePanelId, name, handler);
+ rf.Event.bindById(this.id, name, handler);
}
},
@@ -124,6 +126,9 @@
// class stuff
destroy: function () {
+ var parent = this.getTogglePanel();
+ delete parent.getItems()[this.index];
+
$super.destroy.call(this);
}
});
Modified: trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/collapsiblePanel.xmlunit.xml
===================================================================
--- trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/collapsiblePanel.xmlunit.xml 2011-01-06 14:24:34 UTC (rev 20910)
+++ trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/collapsiblePanel.xmlunit.xml 2011-01-06 16:14:50 UTC (rev 20911)
@@ -1,5 +1,8 @@
<div class="rf-cp rf-tgp" id="f:panel">
<input type="hidden" name="f:panel-value" id="f:panel-value" value="true"></input>
+ <script type="text/javascript">
+ Text
+ </script>
<div class="rf-cp-hdr rf-cp-hdr-exp" id="f:panel:header">
<table class="rf-cp-gr">
<tbody>
@@ -22,7 +25,4 @@
</div>
<div id="f:panel:content" class="rf-cp-b" style="display:block"></div>
<div id="f:panel:empty" style="display:none"></div>
- <script type="text/javascript">
- Text
- </script>
</div>
\ No newline at end of file
13 years, 11 months
JBoss Rich Faces SVN: r20910 - in trunk: examples/richfaces-showcase/src/main/webapp/richfaces/panelMenu/samples and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2011-01-06 09:24:34 -0500 (Thu, 06 Jan 2011)
New Revision: 20910
Modified:
trunk/examples/output-demo/src/main/webapp/qunit/panelMenu.xhtml
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/panelMenu/samples/panelMenu-sample.xhtml
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuGroupRenderer.java
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenu.ecss
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenuGroup.js
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-group.xmlunit.xml
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-groupDis.xmlunit.xml
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-topGroup.xmlunit.xml
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-topGroupDis.xmlunit.xml
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenuGroup-expanded.xmlunit.xml
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenuGroup-topGroup.xmlunit.xml
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenuGroup.xmlunit.xml
Log:
fix Panel Menu Icons
Modified: trunk/examples/output-demo/src/main/webapp/qunit/panelMenu.xhtml
===================================================================
--- trunk/examples/output-demo/src/main/webapp/qunit/panelMenu.xhtml 2011-01-06 13:47:03 UTC (rev 20909)
+++ trunk/examples/output-demo/src/main/webapp/qunit/panelMenu.xhtml 2011-01-06 14:24:34 UTC (rev 20910)
@@ -36,10 +36,6 @@
<h:outputScript name="qunit/qunit.js"/>
<h:outputScript name="qunit/richfaces-qunit.js"/>
- <h:outputScript name="PanelMenu.js"/>
- <h:outputScript name="PanelMenuItem.js"/>
- <h:outputScript name="PanelMenuGroup.js"/>
-
<h:outputStylesheet name="qunit/qunit.css"/>
</ui:define>
Modified: trunk/examples/richfaces-showcase/src/main/webapp/richfaces/panelMenu/samples/panelMenu-sample.xhtml
===================================================================
--- trunk/examples/richfaces-showcase/src/main/webapp/richfaces/panelMenu/samples/panelMenu-sample.xhtml 2011-01-06 13:47:03 UTC (rev 20909)
+++ trunk/examples/richfaces-showcase/src/main/webapp/richfaces/panelMenu/samples/panelMenu-sample.xhtml 2011-01-06 14:24:34 UTC (rev 20910)
@@ -16,7 +16,7 @@
groupExpandIconLeft="triangleUp"
groupCollapseIconLeft="triangleDown"
topGroupExpandIconRight="chevronUp"
- topGroupCollapseIconRight="chevronUp" itemIconLeft="disc"
+ topGroupCollapseIconRight="chevronDown" itemIconLeft="disc"
itemChangeListener="#{panelMenuBean.updateCurrent}">
<rich:panelMenuGroup label="Group 1">
<rich:panelMenuItem label="Item 1.1" name="Item_1_1" />
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuGroupRenderer.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuGroupRenderer.java 2011-01-06 13:47:03 UTC (rev 20909)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuGroupRenderer.java 2011-01-06 14:24:34 UTC (rev 20910)
@@ -106,7 +106,7 @@
writer.startElement(DIV_ELEM, null);
writer.writeAttribute(ID_ATTRIBUTE, menuGroup.getClientId(context) + ":hdr", null);
writer.writeAttribute(CLASS_ATTRIBUTE, concatClasses(getCssClass(menuGroup, "-hdr"),
- getCssClass(menuGroup, "-hdr-" + (menuGroup.isExpanded() ? "exp" : "colps"))), null);
+ "rf-pm-hdr-" + (menuGroup.isExpanded() ? "exp" : "colps")), null);
(menuGroup.isTopItem() ? topHeaderRenderer : headerRenderer).encodeHeader(writer, context, menuGroup);
Modified: trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenu.ecss
===================================================================
--- trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenu.ecss 2011-01-06 13:47:03 UTC (rev 20909)
+++ trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenu.ecss 2011-01-06 14:24:34 UTC (rev 20910)
@@ -274,7 +274,6 @@
.rf-pm-ico-colps {}
.rf-pm-ico-exp {}
-
.rf-pm-hdr-exp .rf-pm-ico-exp { display: block; }
.rf-pm-hdr-exp .rf-pm-ico-colps { display: none; }
Modified: trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenuGroup.js
===================================================================
--- trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenuGroup.js 2011-01-06 13:47:03 UTC (rev 20909)
+++ trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenuGroup.js 2011-01-06 14:24:34 UTC (rev 20910)
@@ -196,7 +196,7 @@
__expand : function () {
this.__content().removeClass("rf-pm-colps").addClass("rf-pm-exp");
- this.__header().removeClass("rf-pm-gr-hdr-colps").addClass("rf-pm-hdr-exp");
+ this.__header().removeClass("rf-pm-hdr-colps").addClass("rf-pm-hdr-exp");
this.__setExpandValue(true);
},
Modified: trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-group.xmlunit.xml
===================================================================
--- trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-group.xmlunit.xml 2011-01-06 13:47:03 UTC (rev 20909)
+++ trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-group.xmlunit.xml 2011-01-06 14:24:34 UTC (rev 20910)
@@ -1,6 +1,6 @@
<div id="f:panelMenuGroup" class="rf-pm-gr groupClass">
<input id="f:panelMenuGroup:expanded" name="f:panelMenuGroup:expanded" type="hidden" value="false"/>
- <div id="f:panelMenuGroup:hdr" class="rf-pm-gr-hdr rf-pm-gr-hdr-colps">
+ <div id="f:panelMenuGroup:hdr" class="rf-pm-gr-hdr rf-pm-hdr-colps">
<table class="rf-pm-gr-gr">
<tbody>
<tr>
Modified: trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-groupDis.xmlunit.xml
===================================================================
--- trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-groupDis.xmlunit.xml 2011-01-06 13:47:03 UTC (rev 20909)
+++ trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-groupDis.xmlunit.xml 2011-01-06 14:24:34 UTC (rev 20910)
@@ -1,6 +1,6 @@
<div id="f:panelMenuGroup-dis" class="rf-pm-gr groupClass rf-pm-gr-dis groupDisableClass">
<input id="f:panelMenuGroup-dis:expanded" name="f:panelMenuGroup-dis:expanded" type="hidden" value="false"/>
- <div id="f:panelMenuGroup-dis:hdr" class="rf-pm-gr-hdr rf-pm-gr-hdr-colps">
+ <div id="f:panelMenuGroup-dis:hdr" class="rf-pm-gr-hdr rf-pm-hdr-colps">
<table class="rf-pm-gr-gr">
<tbody>
<tr>
Modified: trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-topGroup.xmlunit.xml
===================================================================
--- trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-topGroup.xmlunit.xml 2011-01-06 13:47:03 UTC (rev 20909)
+++ trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-topGroup.xmlunit.xml 2011-01-06 14:24:34 UTC (rev 20910)
@@ -1,6 +1,6 @@
<div id="f:panelMenuGroup-top" class="rf-pm-top-gr topGroupClass">
<input id="f:panelMenuGroup-top:expanded" name="f:panelMenuGroup-top:expanded" type="hidden" value="false"/>
- <div id="f:panelMenuGroup-top:hdr" class="rf-pm-top-gr-hdr rf-pm-top-gr-hdr-colps">
+ <div id="f:panelMenuGroup-top:hdr" class="rf-pm-top-gr-hdr rf-pm-hdr-colps">
<table class="rf-pm-top-gr-gr">
<tbody>
<tr>
Modified: trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-topGroupDis.xmlunit.xml
===================================================================
--- trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-topGroupDis.xmlunit.xml 2011-01-06 13:47:03 UTC (rev 20909)
+++ trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-topGroupDis.xmlunit.xml 2011-01-06 14:24:34 UTC (rev 20910)
@@ -1,6 +1,6 @@
<div id="f:panelMenuGroup-topDis" class="rf-pm-top-gr topGroupClass rf-pm-top-gr-dis topGroupDisableClass">
<input id="f:panelMenuGroup-topDis:expanded" name="f:panelMenuGroup-topDis:expanded" type="hidden" value="false"/>
- <div id="f:panelMenuGroup-topDis:hdr" class="rf-pm-top-gr-hdr rf-pm-top-gr-hdr-colps">
+ <div id="f:panelMenuGroup-topDis:hdr" class="rf-pm-top-gr-hdr rf-pm-hdr-colps">
<table class="rf-pm-top-gr-gr">
<tbody>
<tr>
Modified: trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenuGroup-expanded.xmlunit.xml
===================================================================
--- trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenuGroup-expanded.xmlunit.xml 2011-01-06 13:47:03 UTC (rev 20909)
+++ trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenuGroup-expanded.xmlunit.xml 2011-01-06 14:24:34 UTC (rev 20910)
@@ -1,6 +1,6 @@
<div id="f:panelMenuGroup" class="rf-pm-gr">
<input id="f:panelMenuGroup:expanded" name="f:panelMenuGroup:expanded" type="hidden" value="true"/>
- <div id="f:panelMenuGroup:hdr" class="rf-pm-gr-hdr rf-pm-gr-hdr-exp">
+ <div id="f:panelMenuGroup:hdr" class="rf-pm-gr-hdr rf-pm-hdr-exp">
<table class="rf-pm-gr-gr">
<tbody>
<tr>
Modified: trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenuGroup-topGroup.xmlunit.xml
===================================================================
--- trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenuGroup-topGroup.xmlunit.xml 2011-01-06 13:47:03 UTC (rev 20909)
+++ trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenuGroup-topGroup.xmlunit.xml 2011-01-06 14:24:34 UTC (rev 20910)
@@ -1,6 +1,6 @@
<div id="f:panelMenuGroup" class="rf-pm-top-gr">
<input id="f:panelMenuGroup:expanded" name="f:panelMenuGroup:expanded" type="hidden" value="true"/>
- <div id="f:panelMenuGroup:hdr" class="rf-pm-top-gr-hdr rf-pm-top-gr-hdr-exp">
+ <div id="f:panelMenuGroup:hdr" class="rf-pm-top-gr-hdr rf-pm-hdr-exp">
<table class="rf-pm-top-gr-gr">
<tbody>
<tr>
Modified: trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenuGroup.xmlunit.xml
===================================================================
--- trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenuGroup.xmlunit.xml 2011-01-06 13:47:03 UTC (rev 20909)
+++ trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenuGroup.xmlunit.xml 2011-01-06 14:24:34 UTC (rev 20910)
@@ -1,6 +1,6 @@
<div id="f:panelMenuGroup" class="rf-pm-gr">
<input id="f:panelMenuGroup:expanded" name="f:panelMenuGroup:expanded" type="hidden" value="false"/>
- <div id="f:panelMenuGroup:hdr" class="rf-pm-gr-hdr rf-pm-gr-hdr-colps">
+ <div id="f:panelMenuGroup:hdr" class="rf-pm-gr-hdr rf-pm-hdr-colps">
<table class="rf-pm-gr-gr">
<tbody>
<tr>
13 years, 11 months
JBoss Rich Faces SVN: r20909 - modules/tests/metamer/trunk/application/src/main/webapp/resources/script.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2011-01-06 08:47:03 -0500 (Thu, 06 Jan 2011)
New Revision: 20909
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/resources/script/detect-browser.js
Log:
added improved detection for Firefox (RFPL-940)
Modified: modules/tests/metamer/trunk/application/src/main/webapp/resources/script/detect-browser.js
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/resources/script/detect-browser.js 2011-01-06 13:28:36 UTC (rev 20908)
+++ modules/tests/metamer/trunk/application/src/main/webapp/resources/script/detect-browser.js 2011-01-06 13:47:03 UTC (rev 20909)
@@ -12,6 +12,13 @@
version: typeof window.opera != "undefined" ? opera.version() : (userAgent.match( /.+(?:rv|it|ra|ie|me)[\/: ]([\d.]+)/ ) || [])[1],
os : navigator.platform
};
+
+ if (jQuery.browser.mozilla) {
+ var matcher = /firefox\/([\d.]+)/;
+ if (matcher.test(userAgent)) {
+ jQuery.browser.version = userAgent.match(matcher)[1];
+ }
+ }
if (jQuery.browser.chrome) {
jQuery.browser.name = "Chrome";
13 years, 11 months
JBoss Rich Faces SVN: r20908 - trunk/examples/richfaces-showcase/src/main/webapp/richfaces/panelMenu/samples.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2011-01-06 08:28:36 -0500 (Thu, 06 Jan 2011)
New Revision: 20908
Modified:
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/panelMenu/samples/panelMenu-sample.xhtml
Log:
https://issues.jboss.org/browse/RF-10069
Modified: trunk/examples/richfaces-showcase/src/main/webapp/richfaces/panelMenu/samples/panelMenu-sample.xhtml
===================================================================
--- trunk/examples/richfaces-showcase/src/main/webapp/richfaces/panelMenu/samples/panelMenu-sample.xhtml 2011-01-06 13:25:01 UTC (rev 20907)
+++ trunk/examples/richfaces-showcase/src/main/webapp/richfaces/panelMenu/samples/panelMenu-sample.xhtml 2011-01-06 13:28:36 UTC (rev 20908)
@@ -13,37 +13,39 @@
<h:form id="form">
<h:panelGrid columns="2" columnClasses="cols,cols" width="400">
<rich:panelMenu style="width:200px" mode="ajax" groupMode="ajax"
- iconExpandedGroup="disc" iconCollapsedGroup="disc"
- iconExpandedTopGroup="chevronUp" iconGroupTopPosition="right"
- iconCollapsedTopGroup="chevronDown"
+ groupExpandIconLeft="triangleUp"
+ groupCollapseIconLeft="triangleDown"
+ topGroupExpandIconRight="chevronUp"
+ topGroupCollapseIconRight="chevronUp" itemIconLeft="disc"
itemChangeListener="#{panelMenuBean.updateCurrent}">
<rich:panelMenuGroup label="Group 1">
- <rich:panelMenuItem label="Item 1.1" name="Item_1_1"/>
- <rich:panelMenuItem label="Item 1.2" name="Item_1_2"/>
- <rich:panelMenuItem label="Item 1.3" name="Item_1_3"/>
+ <rich:panelMenuItem label="Item 1.1" name="Item_1_1" />
+ <rich:panelMenuItem label="Item 1.2" name="Item_1_2" />
+ <rich:panelMenuItem label="Item 1.3" name="Item_1_3" />
</rich:panelMenuGroup>
<rich:panelMenuGroup label="Group 2">
- <rich:panelMenuItem label="Item 2.1" name="Item_2_1"/>
- <rich:panelMenuItem label="Item 2.2" name="Item_2_2"/>
- <rich:panelMenuItem label="Item 2.3" name="Item_2_3"/>
+ <rich:panelMenuItem label="Item 2.1" name="Item_2_1" />
+ <rich:panelMenuItem label="Item 2.2" name="Item_2_2" />
+ <rich:panelMenuItem label="Item 2.3" name="Item_2_3" />
<rich:panelMenuGroup label="Group 2.4">
- <rich:panelMenuItem label="Item 2.4.1" name="Item_2_4_1"/>
- <rich:panelMenuItem label="Item 2.4.2" name="Item_2_4_2"/>
- <rich:panelMenuItem label="Item 2.4.3" name="Item_2_4_3"/>
+ <rich:panelMenuItem label="Item 2.4.1" name="Item_2_4_1" />
+ <rich:panelMenuItem label="Item 2.4.2" name="Item_2_4_2" />
+ <rich:panelMenuItem label="Item 2.4.3" name="Item_2_4_3" />
</rich:panelMenuGroup>
- <rich:panelMenuItem label="Item 2.5" name="Item_2_5"/>
+ <rich:panelMenuItem label="Item 2.5" name="Item_2_5" />
</rich:panelMenuGroup>
<rich:panelMenuGroup label="Group 3">
- <rich:panelMenuItem label="Item 3.1" name="Item_3_1"/>
- <rich:panelMenuItem label="Item 3.2" name="Item_3_2"/>
- <rich:panelMenuItem label="Item 3.3" name="Item_3_3"/>
+ <rich:panelMenuItem label="Item 3.1" name="Item_3_1" />
+ <rich:panelMenuItem label="Item 3.2" name="Item_3_2" />
+ <rich:panelMenuItem label="Item 3.3" name="Item_3_3" />
</rich:panelMenuGroup>
</rich:panelMenu>
- <a4j:outputPanel ajaxRendered="true">
- <rich:panel rendered="#{not empty panelMenuBean.current}">
- <h:outputText value="#{panelMenuBean.current} selected" id="current" />
- </rich:panel>
- </a4j:outputPanel>
+ <a4j:outputPanel ajaxRendered="true">
+ <rich:panel rendered="#{not empty panelMenuBean.current}">
+ <h:outputText value="#{panelMenuBean.current} selected"
+ id="current" />
+ </rich:panel>
+ </a4j:outputPanel>
</h:panelGrid>
</h:form>
</ui:composition>
\ No newline at end of file
13 years, 11 months
JBoss Rich Faces SVN: r20907 - modules/tests/metamer/trunk/ftest/src/test/resources.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2011-01-06 08:25:01 -0500 (Thu, 06 Jan 2011)
New Revision: 20907
Added:
modules/tests/metamer/trunk/ftest/src/test/resources/testng-input.xml
modules/tests/metamer/trunk/ftest/src/test/resources/testng-iteration.xml
modules/tests/metamer/trunk/ftest/src/test/resources/testng-misc.xml
modules/tests/metamer/trunk/ftest/src/test/resources/testng-output.xml
Log:
* added TestNG descriptors for input, output, iteration and misc components
Added: modules/tests/metamer/trunk/ftest/src/test/resources/testng-input.xml
===================================================================
--- modules/tests/metamer/trunk/ftest/src/test/resources/testng-input.xml (rev 0)
+++ modules/tests/metamer/trunk/ftest/src/test/resources/testng-input.xml 2011-01-06 13:25:01 UTC (rev 20907)
@@ -0,0 +1,17 @@
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
+<suite name="seleniumTest">
+
+ <test name="Input Components">
+ <packages>
+ <package name="org.richfaces.tests.metamer.ftest.richAutocomplete" />
+ <package name="org.richfaces.tests.metamer.ftest.richCalendar" />
+ <package name="org.richfaces.tests.metamer.ftest.richInplaceInput" />
+ <package name="org.richfaces.tests.metamer.ftest.richInplaceSelect" />
+ <package name="org.richfaces.tests.metamer.ftest.richInputNumberSlider" />
+ <package name="org.richfaces.tests.metamer.ftest.richInputNumberSpinner" />
+ <package name="org.richfaces.tests.metamer.ftest.richSelect" />
+ </packages>
+ </test>
+
+</suite>
+
Added: modules/tests/metamer/trunk/ftest/src/test/resources/testng-iteration.xml
===================================================================
--- modules/tests/metamer/trunk/ftest/src/test/resources/testng-iteration.xml (rev 0)
+++ modules/tests/metamer/trunk/ftest/src/test/resources/testng-iteration.xml 2011-01-06 13:25:01 UTC (rev 20907)
@@ -0,0 +1,13 @@
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
+<suite name="seleniumTest">
+
+ <test name="Iteration Components">
+ <packages>
+ <package name="org.richfaces.tests.metamer.ftest.richDataGrid" />
+ <package name="org.richfaces.tests.metamer.ftest.richDataTable" />
+ <package name="org.richfaces.tests.metamer.ftest.richExtendedDataTable" />
+ </packages>
+ </test>
+
+</suite>
+
Added: modules/tests/metamer/trunk/ftest/src/test/resources/testng-misc.xml
===================================================================
--- modules/tests/metamer/trunk/ftest/src/test/resources/testng-misc.xml (rev 0)
+++ modules/tests/metamer/trunk/ftest/src/test/resources/testng-misc.xml 2011-01-06 13:25:01 UTC (rev 20907)
@@ -0,0 +1,15 @@
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
+<suite name="seleniumTest">
+
+ <test name="Miscellaneous Components">
+ <packages>
+ <package name="org.richfaces.tests.metamer.ftest.hCommandButton" />
+ <package name="org.richfaces.tests.metamer.ftest.richComponentControl" />
+ <package name="org.richfaces.tests.metamer.ftest.richDataScroller" />
+ <package name="org.richfaces.tests.metamer.ftest.richJQuery" />
+ <package name="org.richfaces.tests.metamer.ftest.richToggleControl" />
+ </packages>
+ </test>
+
+</suite>
+
Added: modules/tests/metamer/trunk/ftest/src/test/resources/testng-output.xml
===================================================================
--- modules/tests/metamer/trunk/ftest/src/test/resources/testng-output.xml (rev 0)
+++ modules/tests/metamer/trunk/ftest/src/test/resources/testng-output.xml 2011-01-06 13:25:01 UTC (rev 20907)
@@ -0,0 +1,17 @@
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
+<suite name="seleniumTest">
+
+ <test name="Output Components">
+ <packages>
+ <package name="org.richfaces.tests.metamer.ftest.richAccordion" />
+ <package name="org.richfaces.tests.metamer.ftest.richAccordionItem" />
+ <package name="org.richfaces.tests.metamer.ftest.richCollapsiblePanel" />
+ <package name="org.richfaces.tests.metamer.ftest.richTab" />
+ <package name="org.richfaces.tests.metamer.ftest.richTabPanel" />
+ <package name="org.richfaces.tests.metamer.ftest.richTogglePanel" />
+ <package name="org.richfaces.tests.metamer.ftest.richTogglePanelItem" />
+ </packages>
+ </test>
+
+</suite>
+
13 years, 11 months
JBoss Rich Faces SVN: r20906 - in trunk/examples/richfaces-showcase: src/main/java/org/richfaces/demo and 5 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2011-01-06 07:53:58 -0500 (Thu, 06 Jan 2011)
New Revision: 20906
Added:
trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/validation/
trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/validation/ValidationBean.java
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/clientValidation/
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/clientValidation/samples/
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/clientValidation/samples/simple-sample.xhtml
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/clientValidation/simple.xhtml
Modified:
trunk/examples/richfaces-showcase/pom.xml
trunk/examples/richfaces-showcase/src/main/resources/org/richfaces/demo/data/common/navigation.xml
Log:
CSV demo
Modified: trunk/examples/richfaces-showcase/pom.xml
===================================================================
--- trunk/examples/richfaces-showcase/pom.xml 2011-01-06 12:35:57 UTC (rev 20905)
+++ trunk/examples/richfaces-showcase/pom.xml 2011-01-06 12:53:58 UTC (rev 20906)
@@ -49,7 +49,21 @@
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
</dependency>
-
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-validator</artifactId>
+ <version>4.1.0.Final</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.validation</groupId>
+ <artifactId>validation-api</artifactId>
+ <version>1.0.0.GA</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <version>1.5.8</version>
+ </dependency>
<dependency>
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache</artifactId>
Added: trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/validation/ValidationBean.java
===================================================================
--- trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/validation/ValidationBean.java (rev 0)
+++ trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/validation/ValidationBean.java 2011-01-06 12:53:58 UTC (rev 20906)
@@ -0,0 +1,66 @@
+package org.richfaces.demo.validation;
+
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.RequestScoped;
+import javax.validation.constraints.Min;
+
+import org.hibernate.validator.constraints.Email;
+import org.hibernate.validator.constraints.Length;
+import org.hibernate.validator.constraints.NotBlank;
+
+@ManagedBean
+@RequestScoped
+public class ValidationBean {
+
+ @NotBlank
+ @Length(min = 3, max = 12)
+ private String name;
+ @Email
+ @NotBlank
+ private String email;
+ @Min(value = 18)
+ private Integer age;
+ private String country;
+ private String jobTitle;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getEmail() {
+ return email;
+ }
+
+ public void setEmail(String email) {
+ this.email = email;
+ }
+
+ public Integer getAge() {
+ return age;
+ }
+
+ public void setAge(Integer age) {
+ this.age = age;
+ }
+
+ public String getCountry() {
+ return country;
+ }
+
+ public void setCountry(String country) {
+ this.country = country;
+ }
+
+ public String getJobTitle() {
+ return jobTitle;
+ }
+
+ public void setJobTitle(String jobTitle) {
+ this.jobTitle = jobTitle;
+ }
+
+}
Modified: trunk/examples/richfaces-showcase/src/main/resources/org/richfaces/demo/data/common/navigation.xml
===================================================================
--- trunk/examples/richfaces-showcase/src/main/resources/org/richfaces/demo/data/common/navigation.xml 2011-01-06 12:35:57 UTC (rev 20905)
+++ trunk/examples/richfaces-showcase/src/main/resources/org/richfaces/demo/data/common/navigation.xml 2011-01-06 12:53:58 UTC (rev 20906)
@@ -172,7 +172,7 @@
</demo>
</demos>
</group>
- <!-- group>
+ <group>
<name>Validation</name>
<demos>
<demo new="true">
@@ -186,7 +186,7 @@
</samples>
</demo>
</demos>
- </group-->
+ </group>
<group>
<name>Data Iteration</name>
<demos>
Added: trunk/examples/richfaces-showcase/src/main/webapp/richfaces/clientValidation/samples/simple-sample.xhtml
===================================================================
--- trunk/examples/richfaces-showcase/src/main/webapp/richfaces/clientValidation/samples/simple-sample.xhtml (rev 0)
+++ trunk/examples/richfaces-showcase/src/main/webapp/richfaces/clientValidation/samples/simple-sample.xhtml 2011-01-06 12:53:58 UTC (rev 20906)
@@ -0,0 +1,30 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich">
+ <h:form>
+ <rich:panel header="User information">
+ <h:panelGrid columns="3">
+ <h:outputText value="Name:" />
+ <h:inputText value="#{validationBean.name}" id="name">
+ <f:validateLength minimum="1" maximum="3"/>
+ <rich:validator />
+ </h:inputText>
+ <rich:message for="name" />
+ <h:outputText value="Email" />
+ <h:inputText value="#{validationBean.email}" id="email">
+ <rich:validator />
+ </h:inputText>
+ <rich:message for="email" />
+ <h:outputText value="Age" />
+ <h:inputText value="#{validationBean.age}" id="age">
+ <rich:validator />
+ </h:inputText>
+ <rich:message for="age" />
+ </h:panelGrid>
+ </rich:panel>
+ </h:form>
+</ui:composition>
\ No newline at end of file
Added: trunk/examples/richfaces-showcase/src/main/webapp/richfaces/clientValidation/simple.xhtml
===================================================================
--- trunk/examples/richfaces-showcase/src/main/webapp/richfaces/clientValidation/simple.xhtml (rev 0)
+++ trunk/examples/richfaces-showcase/src/main/webapp/richfaces/clientValidation/simple.xhtml 2011-01-06 12:53:58 UTC (rev 20906)
@@ -0,0 +1,16 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets">
+
+<ui:composition>
+ <ui:include src="#{demoNavigator.sampleIncludeURI}" />
+ <ui:include src="/templates/includes/source-view.xhtml">
+ <ui:param name="src" value="#{demoNavigator.sampleIncludeURI}" />
+ <ui:param name="sourceType" value="xhtml" />
+ <ui:param name="openLabel" value="View Source" />
+ <ui:param name="hideLabel" value="Hide Source" />
+ </ui:include>
+</ui:composition>
+</html>
\ No newline at end of file
13 years, 11 months
JBoss Rich Faces SVN: r20905 - modules/tests/metamer/trunk/ftest/src/test/resources.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2011-01-06 07:35:57 -0500 (Thu, 06 Jan 2011)
New Revision: 20905
Added:
modules/tests/metamer/trunk/ftest/src/test/resources/testng-core.xml
Log:
* added a TestNG descriptor for core components
Added: modules/tests/metamer/trunk/ftest/src/test/resources/testng-core.xml
===================================================================
--- modules/tests/metamer/trunk/ftest/src/test/resources/testng-core.xml (rev 0)
+++ modules/tests/metamer/trunk/ftest/src/test/resources/testng-core.xml 2011-01-06 12:35:57 UTC (rev 20905)
@@ -0,0 +1,23 @@
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
+<suite name="seleniumTest">
+
+ <test name="Core Components">
+ <packages>
+ <package name="org.richfaces.tests.metamer.ftest.a4jActionListener" />
+ <package name="org.richfaces.tests.metamer.ftest.a4jAjax" />
+ <package name="org.richfaces.tests.metamer.ftest.a4jAttachQueue" />
+ <package name="org.richfaces.tests.metamer.ftest.a4jCommandButton" />
+ <package name="org.richfaces.tests.metamer.ftest.a4jCommandLink" />
+ <package name="org.richfaces.tests.metamer.ftest.a4jJSFunction" />
+ <package name="org.richfaces.tests.metamer.ftest.a4jLog" />
+ <package name="org.richfaces.tests.metamer.ftest.a4jOutputPanel" />
+ <package name="org.richfaces.tests.metamer.ftest.a4jPoll" />
+ <package name="org.richfaces.tests.metamer.ftest.a4jQueue" />
+ <package name="org.richfaces.tests.metamer.ftest.a4jRegion" />
+ <package name="org.richfaces.tests.metamer.ftest.a4jRepeat" />
+ <package name="org.richfaces.tests.metamer.ftest.a4jStatus" />
+ </packages>
+ </test>
+
+</suite>
+
13 years, 11 months
JBoss Rich Faces SVN: r20904 - in trunk/ui/input/ui/src/test: resources/org/richfaces/renderkit and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: amarkhel
Date: 2011-01-06 07:00:31 -0500 (Thu, 06 Jan 2011)
New Revision: 20904
Added:
trunk/ui/input/ui/src/test/java/org/richfaces/renderkit/AutoCompleteBean.java
trunk/ui/input/ui/src/test/java/org/richfaces/renderkit/AutocompleteRendererTest.java
trunk/ui/input/ui/src/test/java/org/richfaces/renderkit/CountriesBean.java
trunk/ui/input/ui/src/test/java/org/richfaces/renderkit/Country.java
trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/autocompleteDivLayoutClientMode.xmlunit.xml
trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/autocompleteDivLayoutTest.xhtml
trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/autocompleteListLayoutClientMode.xmlunit.xml
trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/autocompleteListLayoutTest.xhtml
trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/countries.xml
trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/countries.xsd
Modified:
trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/faces-config.xml
Log:
RF-9072 Unit tests development for autocomplete component
Added: trunk/ui/input/ui/src/test/java/org/richfaces/renderkit/AutoCompleteBean.java
===================================================================
--- trunk/ui/input/ui/src/test/java/org/richfaces/renderkit/AutoCompleteBean.java (rev 0)
+++ trunk/ui/input/ui/src/test/java/org/richfaces/renderkit/AutoCompleteBean.java 2011-01-06 12:00:31 UTC (rev 20904)
@@ -0,0 +1,105 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.renderkit;
+
+import java.io.Serializable;
+import java.util.Locale;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+
+import com.google.common.base.Predicate;
+import com.google.common.collect.Collections2;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public class AutoCompleteBean implements Serializable {
+
+ private static final long serialVersionUID = 3072125097847582809L;
+
+ private class CountryNamePredicate implements Predicate<Country> {
+
+ private String countryNamePrefix;
+
+ public CountryNamePredicate(String countryNamePrefix) {
+ super();
+ this.countryNamePrefix = countryNamePrefix;
+ }
+
+ public boolean apply(Country input) {
+ if (countryNamePrefix == null || countryNamePrefix.length() == 0) {
+ return true;
+ }
+
+ return input.getName().toLowerCase(Locale.US).startsWith(countryNamePrefix);
+ }
+ }
+
+ private String value;
+
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ private String mode = "client";
+
+ public String getMode() {
+ return mode;
+ }
+
+ public void setMode(String mode) {
+ this.mode = mode;
+ }
+
+ private String layout = "list";
+ public String getLayout() {
+ return layout;
+ }
+
+ public void setLayout(String layout) {
+ this.layout = layout;
+ }
+
+ private CountriesBean countriesBean;
+
+ public void setCountriesBean(CountriesBean countriesBean) {
+ this.countriesBean = countriesBean;
+ }
+
+ public Object autocomplete(FacesContext facesContext, UIComponent component, String value) {
+ // for tests when value does not starts with prefix
+ /*String str = value;
+ if (str.charAt(0)=='i') {
+ str = str.substring(1);
+ }*/
+ String v = mode.equals("lazyClient") || mode.equals("client") ? "" : value;
+ return Collections2.filter(countriesBean.getCountries(), new CountryNamePredicate(v.toLowerCase()));
+ }
+
+}
Added: trunk/ui/input/ui/src/test/java/org/richfaces/renderkit/AutocompleteRendererTest.java
===================================================================
--- trunk/ui/input/ui/src/test/java/org/richfaces/renderkit/AutocompleteRendererTest.java (rev 0)
+++ trunk/ui/input/ui/src/test/java/org/richfaces/renderkit/AutocompleteRendererTest.java 2011-01-06 12:00:31 UTC (rev 20904)
@@ -0,0 +1,131 @@
+package org.richfaces.renderkit;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.StringReader;
+import java.net.URISyntaxException;
+import java.util.List;
+
+import org.custommonkey.xmlunit.Diff;
+import org.custommonkey.xmlunit.Difference;
+import org.custommonkey.xmlunit.DifferenceListener;
+import org.custommonkey.xmlunit.IgnoreTextAndAttributeValuesDifferenceListener;
+import org.jboss.test.faces.htmlunit.HtmlUnitEnvironment;
+import org.junit.Assert;
+import org.junit.Test;
+import org.richfaces.renderkit.html.RendererTestBase;
+import org.xml.sax.SAXException;
+
+import com.gargoylesoftware.htmlunit.html.HtmlElement;
+import com.gargoylesoftware.htmlunit.html.HtmlInput;
+import com.gargoylesoftware.htmlunit.html.HtmlPage;
+
+public class AutocompleteRendererTest extends RendererTestBase {
+
+ @Override
+ public void setUp() throws URISyntaxException {
+ environment = new HtmlUnitEnvironment();
+ environment.withWebRoot(new File(this.getClass().getResource(".").toURI()));
+ environment.withResource("/WEB-INF/faces-config.xml", "org/richfaces/renderkit/faces-config.xml");
+ environment.start();
+ }
+
+ @Test
+ public void testListLayoutRender() throws Exception {
+ doTest("autocompleteListLayoutTest", "autocompleteListLayoutClientMode", "form:myAutocomplete");
+ }
+
+ @Test
+ public void testDivLayoutRender() throws Exception {
+ doTest("autocompleteDivLayoutTest", "autocompleteDivLayoutClientMode", "form:myAutocomplete");
+ }
+
+ @Test
+ public void testSetValueDivLayout() throws Exception {
+ HtmlPage page = environment.getPage("/autocompleteDivLayoutTest.jsf");
+ HtmlElement autocompleteList = page.getElementById("form:myAutocompleteList");
+ Assert.assertNotNull(autocompleteList);
+
+ List<?> coutnryList = autocompleteList.getByXPath("div/div/div/div/div");
+ Assert.assertEquals(30, coutnryList.size());
+
+ HtmlInput input = (HtmlInput) page.getElementById("form:myAutocompleteInput");
+ Assert.assertNotNull(input);
+ input.type("al");
+
+ //try 5 times to wait .5 second each for filling the page.
+ for (int i = 0; i < 5; i++) {
+ synchronized (page) {
+ page.wait(500);
+ }
+ }
+
+ autocompleteList = page.getElementById("form:myAutocompleteList");
+ Assert.assertNotNull(autocompleteList);
+
+ coutnryList = autocompleteList.getByXPath("div/div/div/div/div");
+ Assert.assertEquals(2, coutnryList.size());
+ }
+
+ @Test
+ public void testSetValueListLayout() throws Exception {
+ HtmlPage page = environment.getPage("/autocompleteListLayoutTest.jsf");
+ HtmlElement autocompleteList = page.getElementById("form:myAutocompleteList");
+ Assert.assertNotNull(autocompleteList);
+
+ List<?> coutnryList = autocompleteList.getByXPath("div/div/div/ul/li");
+ Assert.assertEquals(30, coutnryList.size());
+
+ HtmlInput input = (HtmlInput) page.getElementById("form:myAutocompleteInput");
+ Assert.assertNotNull(input);
+ input.type("be");
+
+ //try 5 times to wait .5 second each for filling the page.
+ for (int i = 0; i < 5; i++) {
+ synchronized (page) {
+ page.wait(500);
+ }
+ }
+
+ autocompleteList = page.getElementById("form:myAutocompleteList");
+ Assert.assertNotNull(autocompleteList);
+
+ coutnryList = autocompleteList.getByXPath("div/div/div/ul/li");
+ Assert.assertEquals(5, coutnryList.size());
+ }
+
+ @Override
+ protected void checkXmlStructure(String pageName, String xmlunitPageName, String pageCode) throws SAXException,
+ IOException {
+ if(xmlunitPageName == null) {
+ xmlunitPageName = pageName + ".xmlunit.xml";
+ }
+ InputStream expectedPageCode = this.getClass().getResourceAsStream(xmlunitPageName + ".xmlunit.xml");
+ if (expectedPageCode == null) {
+ return;
+ }
+
+ Diff xmlDiff = new Diff(new StringReader(pageCode), new InputStreamReader(expectedPageCode));
+ xmlDiff.overrideDifferenceListener(getDifferenceListener("jquery\\d*"));
+ Assert.assertTrue("XML was not similar:" + xmlDiff.toString(), xmlDiff.similar());
+ }
+
+ private DifferenceListener getDifferenceListener(final String skipAttribute) {
+ return new IgnoreTextAndAttributeValuesDifferenceListener() {
+ @Override
+ public int differenceFound(Difference difference) {
+ String controlNameAttribute = difference.getControlNodeDetail().getValue();
+ String testNameAttribute = difference.getTestNodeDetail().getValue();
+ if (controlNameAttribute.matches(skipAttribute) ||
+ testNameAttribute.matches(skipAttribute)) {
+ return RETURN_IGNORE_DIFFERENCE_NODES_SIMILAR;
+ }
+ else {
+ return super.differenceFound(difference);
+ }
+ }
+ };
+ }
+}
Added: trunk/ui/input/ui/src/test/java/org/richfaces/renderkit/CountriesBean.java
===================================================================
--- trunk/ui/input/ui/src/test/java/org/richfaces/renderkit/CountriesBean.java (rev 0)
+++ trunk/ui/input/ui/src/test/java/org/richfaces/renderkit/CountriesBean.java 2011-01-06 12:00:31 UTC (rev 20904)
@@ -0,0 +1,76 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.richfaces.renderkit;
+
+import java.net.URL;
+import java.util.List;
+
+import javax.annotation.PostConstruct;
+import javax.faces.FacesException;
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Unmarshaller;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+
+/**
+ * @author nick
+ *
+ */
+public class CountriesBean {
+
+ private List<Country> countries;
+
+ @XmlRootElement(name = "countries", namespace = Country.NAMESPACE)
+ private static class Countries {
+
+ @XmlElement(name = "country", namespace = Country.NAMESPACE)
+ private List<Country> countries;
+
+ public List<Country> getCountries() {
+ return countries;
+ }
+ }
+
+ public CountriesBean() {
+ }
+
+ @PostConstruct
+ public void initialize() {
+ try {
+ JAXBContext countryContext = JAXBContext.newInstance(Countries.class);
+ Unmarshaller unmarshaller = countryContext.createUnmarshaller();
+
+ ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
+ URL dataUrl = classLoader.getResource("org/richfaces/renderkit/countries.xml");
+ Countries cntr = (Countries) unmarshaller.unmarshal(dataUrl);
+ countries = cntr.getCountries();
+ } catch (JAXBException e) {
+ throw new FacesException(e.getMessage(), e);
+ }
+ }
+
+ public List<Country> getCountries() {
+ return countries;
+ }
+}
Added: trunk/ui/input/ui/src/test/java/org/richfaces/renderkit/Country.java
===================================================================
--- trunk/ui/input/ui/src/test/java/org/richfaces/renderkit/Country.java (rev 0)
+++ trunk/ui/input/ui/src/test/java/org/richfaces/renderkit/Country.java 2011-01-06 12:00:31 UTC (rev 20904)
@@ -0,0 +1,79 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.richfaces.renderkit;
+
+import javax.xml.bind.annotation.XmlElement;
+
+import com.google.common.base.Objects;
+import com.google.common.base.Objects.ToStringHelper;
+
+/**
+ * @author nick
+ *
+ */
+public class Country {
+
+ public static final String NAMESPACE = "http://richfaces.org/test/countries";
+
+ private String name;
+
+ private String iso;
+
+ private String domain;
+
+ @XmlElement(namespace = Country.NAMESPACE)
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public String getIso() {
+ return iso;
+ }
+
+ @XmlElement(namespace = Country.NAMESPACE)
+ public void setIso(String iso) {
+ this.iso = iso;
+ }
+
+ public String getDomain() {
+ return domain;
+ }
+
+ @XmlElement(namespace = Country.NAMESPACE)
+ public void setDomain(String domain) {
+ this.domain = domain;
+ }
+
+ @Override
+ public String toString() {
+ ToStringHelper helper = Objects.toStringHelper(this);
+
+ helper.add("name", name).add("iso", iso).add("domain", domain);
+
+ return helper.toString();
+ }
+}
Added: trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/autocompleteDivLayoutClientMode.xmlunit.xml
===================================================================
--- trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/autocompleteDivLayoutClientMode.xmlunit.xml (rev 0)
+++ trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/autocompleteDivLayoutClientMode.xmlunit.xml 2011-01-06 12:00:31 UTC (rev 20904)
@@ -0,0 +1,191 @@
+<?xml version="1.0" encoding="UTF-8"?>
+ <div class="rf-au-fld" id="form:myAutocomplete">
+ <input class="rf-au-fnt rf-au-inp" id="form:myAutocompleteValue" name="form:myAutocompleteValue" type="hidden"/>
+ <div style="position : relative; overflow : hidden; text-align : left; padding-right : 21px;">
+ <input autocomplete="off" class="rf-au-fnt rf-au-inp" id="form:myAutocompleteInput" name="form:myAutocomplete" type="text"/>
+ <div class="rf-au-btn" id="form:myAutocompleteButton">
+ <div class="rf-au-btn-arrow">
+ </div>
+ </div>
+ </div>
+ <div class="rf-au-lst-cord" id="form:myAutocompleteList">
+ <div class="rf-au-shdw">
+ <div class="rf-au-shdw-t">
+ </div>
+ <div class="rf-au-shdw-l">
+ </div>
+ <div class="rf-au-shdw-r">
+ </div>
+ <div class="rf-au-shdw-b">
+ </div>
+ <div class="rf-au-lst-dcrtn">
+ <div class="rf-au-lst-scrl">
+ <div id="" jquery1294309401675="" align="" accesskey="" tabindex="" children="" outerhtml="" lang="" scrollwidth="" scopename="" title="" scrollheight="" document="" innerhtml="" style="" clienttop="" dir="" scrolltop="" classname="" offsettop="" clientwidth="" all="" currentstyle="" runtimestyle="" uniqueid="" innertext="" parentelement="" offsetheight="" clientleft="" offsetparent="" tagname="" scrollleft="" attributes="" language="" offsetleft="" offsetwidth="" disabled="">
+ <div class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Afghanistan AF/AFG/4 .af
+
+ </div>
+ <div class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Albania AL/ALB/8 .al
+
+ </div>
+ <div class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Algeria DZ/DZA/12 .dz
+
+ </div>
+ <div class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ American Samoa AS/ASM/16 .as
+
+ </div>
+ <div class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Andorra AD/AND/20 .ad
+
+ </div>
+ <div class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Angola AO/AGO/24 .ao
+
+ </div>
+ <div class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Anguilla AI/AIA/660 .ai
+
+ </div>
+ <div class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Antarctica AQ/ATA/10 .aq
+
+ </div>
+ <div class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Antigua and Barbuda AG/ATG/28 .ag
+
+ </div>
+ <div class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Argentina AR/ARG/32 .ar
+
+ </div>
+ <div class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Armenia AM/ARM/51 .am
+
+ </div>
+ <div class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Aruba AW/ABW/533 .aw
+
+ </div>
+ <div class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Ashmore and Cartier Islands -/-/- -
+
+ </div>
+ <div class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Australia AU/AUS/36 .au
+
+ </div>
+ <div class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Austria AT/AUT/40 .at
+
+ </div>
+ <div class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Azerbaijan AZ/AZE/31 .az
+
+ </div>
+ <div class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Bahamas, The BS/BHS/44 .bs
+
+ </div>
+ <div class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Bahrain BH/BHR/48 .bh
+
+ </div>
+ <div class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Baker Island -/-/- -
+
+ </div>
+ <div class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Bangladesh BD/BGD/50 .bd
+
+ </div>
+ <div class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Barbados BB/BRB/52 .bb
+
+ </div>
+ <div class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Bassas da India -/-/- -
+
+ </div>
+ <div class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Belarus BY/BLR/112 .by
+
+ </div>
+ <div class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Belgium BE/BEL/56 .be
+
+ </div>
+ <div class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Belize BZ/BLZ/84 .bz
+
+ </div>
+ <div class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Benin BJ/BEN/204 .bj
+
+ </div>
+ <div class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Bermuda BM/BMU/60 .bm
+
+ </div>
+ <div class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Bhutan BT/BTN/64 .bt
+
+ </div>
+ <div class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Bolivia BO/BOL/68 .bo
+
+ </div>
+ <div class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Bosnia and Herzegovina BA/BIH/70 .ba
+
+ </div>
+ </div>
+ <script type="text/javascript">
+//<![CDATA[
+new RichFaces.ui.Autocomplete.setData("form:myAutocompleteItems",["Afghanistan","Albania","Algeria","American Samoa","Andorra","Angola","Anguilla","Antarctica","Antigua and Barbuda","Argentina","Armenia","Aruba","Ashmore and Cartier Islands","Australia","Austria","Azerbaijan","Bahamas, The","Bahrain","Baker Island","Bangladesh","Barbados","Bassas da India","Belarus","Belgium","Belize","Benin","Bermuda","Bhutan","Bolivia","Bosnia and Herzegovina"] )
+//]]>
+ </script>
+ </div>
+ </div>
+ </div>
+ </div>
+ <script type="text/javascript">
+//<![CDATA[
+new RichFaces.ui.Autocomplete("form:myAutocomplete",
+ "form:myAutocompleteInput", {"buttonId":"form:myAutocompleteButton","autofill":false,"minChars":2,"onchange":function(event){RichFaces.ajax(this,event,{"parameters":{"javax.faces.behavior.event":"change"} ,"sourceId":"form:myAutocomplete"} )},"ajaxMode":false}
+ );
+//]]>
+ </script>
+ </div>
Added: trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/autocompleteDivLayoutTest.xhtml
===================================================================
--- trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/autocompleteDivLayoutTest.xhtml (rev 0)
+++ trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/autocompleteDivLayoutTest.xhtml 2011-01-06 12:00:31 UTC (rev 20904)
@@ -0,0 +1,30 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:input="http://richfaces.org/input"
+ xmlns:rich="http://richfaces.org/iteration"
+ xmlns:a4j="http://richfaces.org/a4j">
+<f:view contentType="text/html" />
+<h:head>
+ <title>Richfaces Autocomplete</title>
+</h:head>
+<h:body>
+ <h:form id="form">
+ <input:autocomplete autofill="false" id="myAutocomplete"
+ mode="#{autoCompleteBean.mode}"
+ minChars="2"
+ autocompleteMethod="#{autoCompleteBean.autocomplete}"
+ var="country" fetchValue="#{country.name}"
+ showButton="true"
+ value = "#{autoCompleteBean.value}"
+ layout="div">
+ #{country.name} #{country.iso} #{country.domain}
+ <a4j:ajax event="change" render="output"/>
+ </input:autocomplete>
+ <br/><br/>
+ Your selection: <h:outputText id="output" value="#{autoCompleteBean.value}"/>
+ </h:form>
+</h:body>
+</html>
Added: trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/autocompleteListLayoutClientMode.xmlunit.xml
===================================================================
--- trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/autocompleteListLayoutClientMode.xmlunit.xml (rev 0)
+++ trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/autocompleteListLayoutClientMode.xmlunit.xml 2011-01-06 12:00:31 UTC (rev 20904)
@@ -0,0 +1,191 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<div class="rf-au-fld" id="form:myAutocomplete">
+ <input class="rf-au-fnt rf-au-inp" id="form:myAutocompleteValue" name="form:myAutocompleteValue" type="hidden"/>
+ <div style="position : relative; overflow : hidden; text-align : left; padding-right : 21px;">
+ <input autocomplete="off" class="rf-au-fnt rf-au-inp" id="form:myAutocompleteInput" name="form:myAutocomplete" type="text"/>
+ <div class="rf-au-btn" id="form:myAutocompleteButton">
+ <div class="rf-au-btn-arrow">
+ </div>
+ </div>
+ </div>
+ <div class="rf-au-lst-cord" id="form:myAutocompleteList">
+ <div class="rf-au-shdw">
+ <div class="rf-au-shdw-t">
+ </div>
+ <div class="rf-au-shdw-l">
+ </div>
+ <div class="rf-au-shdw-r">
+ </div>
+ <div class="rf-au-shdw-b">
+ </div>
+ <div class="rf-au-lst-dcrtn">
+ <div class="rf-au-lst-scrl">
+ <ul id="" class="rf-au-lst-ul" jquery1294233558255="" compact="" accesskey="" tabindex="" children="" outerhtml="" lang="" scrollwidth="" scopename="" title="" scrollheight="" document="" innerhtml="" style="" clienttop="" dir="" scrolltop="" classname="" offsettop="" clientwidth="" all="" currentstyle="" runtimestyle="" uniqueid="" innertext="" parentelement="" offsetheight="" clientleft="" offsetparent="" tagname="" scrollleft="" attributes="" language="" offsetleft="" offsetwidth="" disabled="">
+ <li class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Afghanistan AF/AFG/4 .af
+
+ </li>
+ <li class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Albania AL/ALB/8 .al
+
+ </li>
+ <li class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Algeria DZ/DZA/12 .dz
+
+ </li>
+ <li class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ American Samoa AS/ASM/16 .as
+
+ </li>
+ <li class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Andorra AD/AND/20 .ad
+
+ </li>
+ <li class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Angola AO/AGO/24 .ao
+
+ </li>
+ <li class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Anguilla AI/AIA/660 .ai
+
+ </li>
+ <li class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Antarctica AQ/ATA/10 .aq
+
+ </li>
+ <li class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Antigua and Barbuda AG/ATG/28 .ag
+
+ </li>
+ <li class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Argentina AR/ARG/32 .ar
+
+ </li>
+ <li class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Armenia AM/ARM/51 .am
+
+ </li>
+ <li class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Aruba AW/ABW/533 .aw
+
+ </li>
+ <li class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Ashmore and Cartier Islands -/-/- -
+
+ </li>
+ <li class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Australia AU/AUS/36 .au
+
+ </li>
+ <li class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Austria AT/AUT/40 .at
+
+ </li>
+ <li class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Azerbaijan AZ/AZE/31 .az
+
+ </li>
+ <li class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Bahamas, The BS/BHS/44 .bs
+
+ </li>
+ <li class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Bahrain BH/BHR/48 .bh
+
+ </li>
+ <li class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Baker Island -/-/- -
+
+ </li>
+ <li class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Bangladesh BD/BGD/50 .bd
+
+ </li>
+ <li class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Barbados BB/BRB/52 .bb
+
+ </li>
+ <li class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Bassas da India -/-/- -
+
+ </li>
+ <li class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Belarus BY/BLR/112 .by
+
+ </li>
+ <li class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Belgium BE/BEL/56 .be
+
+ </li>
+ <li class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Belize BZ/BLZ/84 .bz
+
+ </li>
+ <li class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Benin BJ/BEN/204 .bj
+
+ </li>
+ <li class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Bermuda BM/BMU/60 .bm
+
+ </li>
+ <li class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Bhutan BT/BTN/64 .bt
+
+ </li>
+ <li class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Bolivia BO/BOL/68 .bo
+
+ </li>
+ <li class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Bosnia and Herzegovina BA/BIH/70 .ba
+
+ </li>
+ </ul>
+ <script type="text/javascript">
+//<![CDATA[
+new RichFaces.ui.Autocomplete.setData("form:myAutocompleteItems",["Afghanistan","Albania","Algeria","American Samoa","Andorra","Angola","Anguilla","Antarctica","Antigua and Barbuda","Argentina","Armenia","Aruba","Ashmore and Cartier Islands","Australia","Austria","Azerbaijan","Bahamas, The","Bahrain","Baker Island","Bangladesh","Barbados","Bassas da India","Belarus","Belgium","Belize","Benin","Bermuda","Bhutan","Bolivia","Bosnia and Herzegovina","Botswana","Bouvet Island","Brazil","British Indian Ocean Territory","British Virgin Islands","Brunei","Bulgaria","Burkina Faso","Burma","Burundi","Cambodia","Cameroon","Canada","Cape Verde","Cayman Islands","Central African Republic","Chad","Chile","China","Christmas Island","Clipperton Island","Cocos (Keeling) Islands","Colombia","Comoros","Congo, Democratic Republic of the","Congo, Republic of the","Cook Islands","Coral Sea Islands","Costa Rica","Cote d'Ivoire","Croatia","Cuba","Cyprus","Czech Republic","Denmark","Djibouti","Domi!
nica","Dominican Republic","Ecuador","Egypt","El Salvador","Equatorial Guinea","Eritrea","Estonia","Ethiopia","Europa Island","Falkland Islands (Islas Malvinas)","Faroe Islands","Fiji","Finland","France","France, Metropolitan","French Guiana","French Polynesia","French Southern and Antarctic Lands","Gabon","Gambia, The","Gaza Strip","Georgia","Germany","Ghana","Gibraltar","Glorioso Islands","Greece","Greenland","Grenada","Guadeloupe","Guam","Guatemala","Guernsey","Guinea","Guinea\u002DBissau","Guyana","Haiti","Heard Island and McDonald Islands","Holy See (Vatican City)","Honduras","Hong Kong","Howland Island","Hungary","Iceland","India","Indonesia","Iran","Iraq","Ireland","Isle of Man","Israel","Italy","Jamaica","Jan Mayen","Japan","Jarvis Island","Jersey","Johnston Atoll","Jordan","Juan de Nova Island","Kazakhstan","Kenya","Kingman Reef","Kiribati","Korea, North","Korea, South","Kosovo","Kuwait","Kyrgyzstan","Laos","Latvia","Lebanon","Lesotho","Liberia","Libya","Liechtenst!
ein","Lithuania","Luxembourg","Macau","Macedonia","Madagascar"!
,"Malawi
","Malaysia","Maldives","Mali","Malta","Marshall Islands","Martinique","Mauritania","Mauritius","Mayotte","Mexico","Micronesia, Federated States of","Midway Islands","Moldova","Monaco","Mongolia","Montenegro","Montserrat","Morocco","Mozambique","Myanmar","Namibia","Nauru","Navassa Island","Nepal","Netherlands","Netherlands Antilles","New Caledonia","New Zealand","Nicaragua","Niger","Nigeria","Niue","Norfolk Island","Northern Mariana Islands","Norway","Oman","Pakistan","Palau","Palmyra Atoll","Panama","Papua New Guinea","Paracel Islands","Paraguay","Peru","Philippines","Pitcairn Islands","Poland","Portugal","Puerto Rico","Qatar","Reunion","Romania","Russia","Rwanda","Saint Barthelemy","Saint Helena","Saint Kitts and Nevis","Saint Lucia","Saint Martin","Saint Pierre and Miquelon","Saint Vincent and the Grenadines","Samoa","San Marino","Sao Tome and Principe","Saudi Arabia","Senegal","Serbia","Seychelles","Sierra Leone","Singapore","Slovakia","Slovenia","Solomon Islands","Somal!
ia","South Africa","South Georgia and the Islands","Spain","Spratly Islands","Sri Lanka","Sudan","Suriname","Svalbard","Swaziland","Sweden","Switzerland","Syria","Taiwan","Tajikistan","Tanzania","Thailand","Timor\u002DLeste","Togo","Tokelau","Tonga","Trinidad and Tobago","Tromelin Island","Tunisia","Turkey","Turkmenistan","Turks and Caicos Islands","Tuvalu","Uganda","Ukraine","United Arab Emirates","United Kingdom","United States","United States Minor Outlying Islands","Uruguay","Uzbekistan","Vanuatu","Venezuela","Vietnam","Virgin Islands","Virgin Islands (UK)","Virgin Islands (US)","Wake Island","Wallis and Futuna","West Bank","Western Sahara","Western Samoa","Yemen","Zaire","Zambia","Zimbabwe"] )
+//]]>
+ </script>
+ </div>
+ </div>
+ </div>
+ </div>
+ <script type="text/javascript">
+//<![CDATA[
+new RichFaces.ui.Autocomplete("form:myAutocomplete",
+ "form:myAutocompleteInput", {"buttonId":"form:myAutocompleteButton","autofill":false,"minChars":2,"onblur":function(event){return onEvent.call(this, event);},"onchange":function(event){return jsf.util.chain(this, event, 'return onEvent.call(this, event);','RichFaces.ajax(this,event,{"parameters":{"javax.faces.behavior.event":"change"} ,"sourceId":"form:myAutocomplete"} )')},"onfocus":function(event){return onEvent.call(this, event);},"onselectitem":function(event){return onEvent.call(this, event);},"ajaxMode":false}
+ );
+//]]>
+ </script>
+</div>
\ No newline at end of file
Added: trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/autocompleteListLayoutTest.xhtml
===================================================================
--- trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/autocompleteListLayoutTest.xhtml (rev 0)
+++ trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/autocompleteListLayoutTest.xhtml 2011-01-06 12:00:31 UTC (rev 20904)
@@ -0,0 +1,30 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:input="http://richfaces.org/input"
+ xmlns:rich="http://richfaces.org/iteration"
+ xmlns:a4j="http://richfaces.org/a4j">
+<f:view contentType="text/html" />
+<h:head>
+ <title>Richfaces Autocomplete</title>
+</h:head>
+<h:body>
+ <h:form id="form">
+ <input:autocomplete autofill="false" id="myAutocomplete"
+ mode="#{autoCompleteBean.mode}"
+ minChars="2"
+ autocompleteMethod="#{autoCompleteBean.autocomplete}"
+ var="country" fetchValue="#{country.name}"
+ showButton="true"
+ value = "#{autoCompleteBean.value}"
+ layout="list">
+ #{country.name} #{country.iso} #{country.domain}
+ <a4j:ajax event="change" render="output"/>
+ </input:autocomplete>
+ <br/><br/>
+ Your selection: <h:outputText id="output" value="#{autoCompleteBean.value}"/>
+ </h:form>
+</h:body>
+</html>
Added: trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/countries.xml
===================================================================
--- trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/countries.xml (rev 0)
+++ trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/countries.xml 2011-01-06 12:00:31 UTC (rev 20904)
@@ -0,0 +1,153 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<countries xmlns="http://richfaces.org/test/countries">
+ <country>
+ <name>Afghanistan</name>
+ <iso>AF/AFG/4</iso>
+ <domain>.af</domain>
+ </country>
+ <country>
+ <name>Albania</name>
+ <iso>AL/ALB/8</iso>
+ <domain>.al</domain>
+ </country>
+ <country>
+ <name>Algeria</name>
+ <iso>DZ/DZA/12</iso>
+ <domain>.dz</domain>
+ </country>
+ <country>
+ <name>American Samoa</name>
+ <iso>AS/ASM/16</iso>
+ <domain>.as</domain>
+ </country>
+ <country>
+ <name>Andorra</name>
+ <iso>AD/AND/20</iso>
+ <domain>.ad</domain>
+ </country>
+ <country>
+ <name>Angola</name>
+ <iso>AO/AGO/24</iso>
+ <domain>.ao</domain>
+ </country>
+ <country>
+ <name>Anguilla</name>
+ <iso>AI/AIA/660</iso>
+ <domain>.ai</domain>
+ </country>
+ <country>
+ <name>Antarctica</name>
+ <iso>AQ/ATA/10</iso>
+ <domain>.aq</domain>
+ </country>
+ <country>
+ <name>Antigua and Barbuda</name>
+ <iso>AG/ATG/28</iso>
+ <domain>.ag</domain>
+ </country>
+ <country>
+ <name>Argentina</name>
+ <iso>AR/ARG/32</iso>
+ <domain>.ar</domain>
+ </country>
+ <country>
+ <name>Armenia</name>
+ <iso>AM/ARM/51</iso>
+ <domain>.am</domain>
+ </country>
+ <country>
+ <name>Aruba</name>
+ <iso>AW/ABW/533</iso>
+ <domain>.aw</domain>
+ </country>
+ <country>
+ <name>Ashmore and Cartier Islands</name>
+ <iso>-/-/-</iso>
+ <domain>-</domain>
+ </country>
+ <country>
+ <name>Australia</name>
+ <iso>AU/AUS/36</iso>
+ <domain>.au</domain>
+ </country>
+ <country>
+ <name>Austria</name>
+ <iso>AT/AUT/40</iso>
+ <domain>.at</domain>
+ </country>
+ <country>
+ <name>Azerbaijan</name>
+ <iso>AZ/AZE/31</iso>
+ <domain>.az</domain>
+ </country>
+ <country>
+ <name>Bahamas, The</name>
+ <iso>BS/BHS/44</iso>
+ <domain>.bs</domain>
+ </country>
+ <country>
+ <name>Bahrain</name>
+ <iso>BH/BHR/48</iso>
+ <domain>.bh</domain>
+ </country>
+ <country>
+ <name>Baker Island</name>
+ <iso>-/-/-</iso>
+ <domain>-</domain>
+ </country>
+ <country>
+ <name>Bangladesh</name>
+ <iso>BD/BGD/50</iso>
+ <domain>.bd</domain>
+ </country>
+ <country>
+ <name>Barbados</name>
+ <iso>BB/BRB/52</iso>
+ <domain>.bb</domain>
+ </country>
+ <country>
+ <name>Bassas da India</name>
+ <iso>-/-/-</iso>
+ <domain>-</domain>
+ </country>
+ <country>
+ <name>Belarus</name>
+ <iso>BY/BLR/112</iso>
+ <domain>.by</domain>
+ </country>
+ <country>
+ <name>Belgium</name>
+ <iso>BE/BEL/56</iso>
+ <domain>.be</domain>
+ </country>
+ <country>
+ <name>Belize</name>
+ <iso>BZ/BLZ/84</iso>
+ <domain>.bz</domain>
+ </country>
+ <country>
+ <name>Benin</name>
+ <iso>BJ/BEN/204</iso>
+ <domain>.bj</domain>
+ </country>
+ <country>
+ <name>Bermuda</name>
+ <iso>BM/BMU/60</iso>
+ <domain>.bm</domain>
+ </country>
+ <country>
+ <name>Bhutan</name>
+ <iso>BT/BTN/64</iso>
+ <domain>.bt</domain>
+ </country>
+ <country>
+ <name>Bolivia</name>
+ <iso>BO/BOL/68</iso>
+ <domain>.bo</domain>
+ </country>
+ <country>
+ <name>Bosnia and Herzegovina</name>
+ <iso>BA/BIH/70</iso>
+ <domain>.ba</domain>
+ </country>
+</countries>
\ No newline at end of file
Added: trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/countries.xsd
===================================================================
--- trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/countries.xsd (rev 0)
+++ trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/countries.xsd 2011-01-06 12:00:31 UTC (rev 20904)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://richfaces.org/demos/countries"
+ xmlns:tns="http://richfaces.org/demos/countries" elementFormDefault="unqualified">
+
+ <element name="countries">
+ <complexType>
+ <sequence maxOccurs="unbounded">
+ <element name="country">
+ <complexType>
+ <sequence>
+ <element name="name" />
+ <element name="iso" />
+ <element name="domain" />
+ </sequence>
+ </complexType>
+ </element>
+ </sequence>
+ </complexType>
+ </element>
+
+</schema>
\ No newline at end of file
Modified: trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/faces-config.xml
===================================================================
--- trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/faces-config.xml 2011-01-06 11:50:02 UTC (rev 20903)
+++ trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/faces-config.xml 2011-01-06 12:00:31 UTC (rev 20904)
@@ -1,20 +1,29 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<faces-config xmlns="http://java.sun.com/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
- version="2.0">
-
- <managed-bean>
- <managed-bean-name>inputBean</managed-bean-name>
- <managed-bean-class>org.richfaces.renderkit.InputBean</managed-bean-class>
- <managed-bean-scope>request</managed-bean-scope>
- </managed-bean>
-
- <managed-bean>
- <managed-bean-name>selectBean</managed-bean-name>
- <managed-bean-class>org.richfaces.renderkit.SelectBean</managed-bean-class>
- <managed-bean-scope>request</managed-bean-scope>
- </managed-bean>
-
-</faces-config>
\ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
+<faces-config version="2.0" xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xi="http://www.w3.org/2001/XInclude"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd">
+ <managed-bean>
+ <managed-bean-name>inputBean</managed-bean-name>
+ <managed-bean-class>org.richfaces.renderkit.InputBean</managed-bean-class>
+ <managed-bean-scope>request</managed-bean-scope>
+ </managed-bean>
+ <managed-bean>
+ <managed-bean-name>selectBean</managed-bean-name>
+ <managed-bean-class>org.richfaces.renderkit.SelectBean</managed-bean-class>
+ <managed-bean-scope>request</managed-bean-scope>
+ </managed-bean>
+ <managed-bean>
+ <managed-bean-name>countriesBean</managed-bean-name>
+ <managed-bean-class>org.richfaces.renderkit.CountriesBean</managed-bean-class>
+ <managed-bean-scope>application</managed-bean-scope>
+ </managed-bean>
+ <managed-bean>
+ <managed-bean-name>autoCompleteBean</managed-bean-name>
+ <managed-bean-class>org.richfaces.renderkit.AutoCompleteBean</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ <managed-property>
+ <property-name>countriesBean</property-name>
+ <value>#{countriesBean}</value>
+ </managed-property>
+ </managed-bean>
+</faces-config>
13 years, 11 months