JBoss Rich Faces SVN: r21363 - in trunk/ui/core/ui/src/main/java/org: ajax4jsf/renderkit and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2011-02-01 10:49:12 -0500 (Tue, 01 Feb 2011)
New Revision: 21363
Added:
trunk/ui/core/ui/src/main/java/org/richfaces/event/BypassUpdatesAjaxBehaviorEvent.java
Modified:
trunk/ui/core/ui/src/main/java/org/ajax4jsf/component/behavior/AjaxBehavior.java
trunk/ui/core/ui/src/main/java/org/ajax4jsf/renderkit/AjaxBehaviorRenderer.java
Log:
https://issues.jboss.org/browse/RF-8697
Modified: trunk/ui/core/ui/src/main/java/org/ajax4jsf/component/behavior/AjaxBehavior.java
===================================================================
--- trunk/ui/core/ui/src/main/java/org/ajax4jsf/component/behavior/AjaxBehavior.java 2011-02-01 15:44:13 UTC (rev 21362)
+++ trunk/ui/core/ui/src/main/java/org/ajax4jsf/component/behavior/AjaxBehavior.java 2011-02-01 15:49:12 UTC (rev 21363)
@@ -46,6 +46,7 @@
import org.richfaces.cdk.annotations.Signature;
import org.richfaces.cdk.annotations.Tag;
import org.richfaces.cdk.annotations.TagType;
+import org.richfaces.event.BypassUpdatesAjaxBehaviorEvent;
import org.richfaces.renderkit.util.CoreAjaxRendererUtils;
/**
@@ -245,7 +246,7 @@
}
public void setImmediate(boolean immediate) {
- getStateHelper().put(PropertyKeys.limitRender, immediate);
+ getStateHelper().put(PropertyKeys.immediate, immediate);
}
@Attribute
@@ -277,7 +278,7 @@
@Override
public void broadcast(BehaviorEvent event) throws AbortProcessingException {
- if (this.equals(event.getBehavior()) && isBypassUpdates()) {
+ if (this.equals(event.getBehavior()) && event instanceof BypassUpdatesAjaxBehaviorEvent) {
FacesContext.getCurrentInstance().renderResponse();
}
Modified: trunk/ui/core/ui/src/main/java/org/ajax4jsf/renderkit/AjaxBehaviorRenderer.java
===================================================================
--- trunk/ui/core/ui/src/main/java/org/ajax4jsf/renderkit/AjaxBehaviorRenderer.java 2011-02-01 15:44:13 UTC (rev 21362)
+++ trunk/ui/core/ui/src/main/java/org/ajax4jsf/renderkit/AjaxBehaviorRenderer.java 2011-02-01 15:49:12 UTC (rev 21363)
@@ -36,6 +36,7 @@
import javax.faces.render.RenderKitFactory;
import org.ajax4jsf.component.behavior.AjaxBehavior;
+import org.richfaces.event.BypassUpdatesAjaxBehaviorEvent;
import org.richfaces.renderkit.util.AjaxRendererUtils;
import org.richfaces.renderkit.util.RendererUtils;
@@ -68,6 +69,10 @@
}
component.queueEvent(createEvent(component, ajaxBehavior));
+
+ if (isBypassUpdates(component, ajaxBehavior)) {
+ component.queueEvent(new BypassUpdatesAjaxBehaviorEvent(component, ajaxBehavior));
+ }
}
private AjaxBehaviorEvent createEvent(UIComponent component, AjaxBehavior ajaxBehavior) {
@@ -77,7 +82,6 @@
if (isImmediate(component, ajaxBehavior)) {
phaseId = PhaseId.APPLY_REQUEST_VALUES;
} else if (isBypassUpdates(component, ajaxBehavior)) {
- //TODO nick - what if behavior is immediate & bypassUpdates in the same time?
phaseId = PhaseId.PROCESS_VALIDATIONS;
} else {
phaseId = PhaseId.INVOKE_APPLICATION;
Added: trunk/ui/core/ui/src/main/java/org/richfaces/event/BypassUpdatesAjaxBehaviorEvent.java
===================================================================
--- trunk/ui/core/ui/src/main/java/org/richfaces/event/BypassUpdatesAjaxBehaviorEvent.java (rev 0)
+++ trunk/ui/core/ui/src/main/java/org/richfaces/event/BypassUpdatesAjaxBehaviorEvent.java 2011-02-01 15:49:12 UTC (rev 21363)
@@ -0,0 +1,54 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2011, 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.event;
+
+import javax.faces.component.UIComponent;
+import javax.faces.component.behavior.Behavior;
+import javax.faces.event.BehaviorEvent;
+import javax.faces.event.FacesListener;
+import javax.faces.event.PhaseId;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public class BypassUpdatesAjaxBehaviorEvent extends BehaviorEvent {
+
+ private static final long serialVersionUID = 154803120133655033L;
+
+ public BypassUpdatesAjaxBehaviorEvent(UIComponent component, Behavior behavior) {
+ super(component, behavior);
+
+ setPhaseId(PhaseId.PROCESS_VALIDATIONS);
+ }
+
+ @Override
+ public boolean isAppropriateListener(FacesListener listener) {
+ return false;
+ }
+
+ @Override
+ public void processListener(FacesListener listener) {
+ throw new UnsupportedOperationException();
+ }
+
+}
13 years, 11 months
JBoss Rich Faces SVN: r21362 - modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceSelect.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2011-02-01 10:44:13 -0500 (Tue, 01 Feb 2011)
New Revision: 21362
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceSelect/TestRichInplaceSelect.java
Log:
* fixed tests for inplace select
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceSelect/TestRichInplaceSelect.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceSelect/TestRichInplaceSelect.java 2011-02-01 15:23:29 UTC (rev 21361)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceSelect/TestRichInplaceSelect.java 2011-02-01 15:44:13 UTC (rev 21362)
@@ -415,7 +415,6 @@
selenium.click(options.format(10));
assertFalse(selenium.isDisplayed(popup), "Popup should not be displayed.");
- assertFalse(selenium.isDisplayed(label), "Label should not be displayed.");
assertEquals(selenium.getValue(input), "Hawaii", "Input should contain selected value.");
}
@@ -428,11 +427,9 @@
assertTrue(selenium.isDisplayed(popup), "Popup should be displayed.");
selenium.click(options.format(10));
- assertFalse(selenium.isDisplayed(label), "Label should not be displayed.");
assertFalse(selenium.isDisplayed(popup), "Popup should not be displayed.");
selenium.fireEvent(input, Event.BLUR);
- assertFalse(selenium.isDisplayed(label), "Label should not be displayed.");
assertFalse(selenium.isDisplayed(popup), "Popup should not be displayed.");
assertEquals(selenium.getValue(input), "Hawaii", "Input should contain selected value.");
}
@@ -447,7 +444,6 @@
selenium.click(options.format(10));
assertFalse(selenium.isDisplayed(popup), "Popup should not be displayed.");
- assertFalse(selenium.isDisplayed(label), "Label should not be displayed.");
assertEquals(selenium.getValue(input), "Hawaii", "Input should contain selected value.");
}
@@ -462,11 +458,9 @@
assertTrue(selenium.isDisplayed(popup), "Popup should be displayed.");
selenium.click(options.format(10));
- assertFalse(selenium.isDisplayed(label), "Label should not be displayed.");
assertFalse(selenium.isDisplayed(popup), "Popup should not be displayed.");
-
+
guardNoRequest(selenium).fireEvent(input, Event.BLUR);
- assertFalse(selenium.isDisplayed(label), "Label should not be displayed.");
assertFalse(selenium.isDisplayed(popup), "Popup should not be displayed.");
assertEquals(selenium.getValue(input), "Click here to edit", "Input should contain default label.");
}
@@ -506,7 +500,6 @@
selenium.click(select);
selenium.click(options.format(10));
- assertFalse(selenium.isDisplayed(label), "Label should not be displayed.");
assertFalse(selenium.isDisplayed(popup), "Popup should not be displayed.");
selenium.mouseDown(okButton);
@@ -526,7 +519,6 @@
selenium.click(select);
selenium.click(options.format(10));
- assertFalse(selenium.isDisplayed(label), "Label should not be displayed.");
assertFalse(selenium.isDisplayed(popup), "Popup should not be displayed.");
selenium.click(cancelButton);
13 years, 11 months
JBoss Rich Faces SVN: r21361 - in trunk: examples/output-demo/src/main/webapp/resources/tests and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: artdaw
Date: 2011-02-01 10:23:29 -0500 (Tue, 01 Feb 2011)
New Revision: 21361
Modified:
trunk/examples/output-demo/src/main/webapp/examples/panelMenu.xhtml
trunk/examples/output-demo/src/main/webapp/resources/tests/richfaces-panel-menu-group-qunit.js
trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractPanelMenuGroup.java
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuGroupRenderer.java
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuRenderer.java
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenu.js
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenuGroup.js
Log:
RF-10313: @bubbleSelection and @expandSingle are removed from PanelMenuGroup. These options are passed from PanelMenu.
Modified: trunk/examples/output-demo/src/main/webapp/examples/panelMenu.xhtml
===================================================================
--- trunk/examples/output-demo/src/main/webapp/examples/panelMenu.xhtml 2011-02-01 15:10:32 UTC (rev 21360)
+++ trunk/examples/output-demo/src/main/webapp/examples/panelMenu.xhtml 2011-02-01 15:23:29 UTC (rev 21361)
@@ -49,8 +49,10 @@
itemDisabledLeftIcon="triangleLeft"
topItemDisabledLeftIcon="triangleUp"
topItemLeftIcon="triangleDown"
- groupMode="client" activeItem="item41">
- <rich:panelMenuGroup id="group1" label="Group 1" disabled="true">
+ groupMode="client" activeItem="item41"
+ bubbleSelection="true"
+ expandSingle="true">
+ <rich:panelMenuGroup id="group1" label="Group 1">
<rich:panelMenuItem id="item11" label="Item 1.1" />
<rich:panelMenuItem id="item12" label="Item 1.2" />
</rich:panelMenuGroup>
Modified: trunk/examples/output-demo/src/main/webapp/resources/tests/richfaces-panel-menu-group-qunit.js
===================================================================
--- trunk/examples/output-demo/src/main/webapp/resources/tests/richfaces-panel-menu-group-qunit.js 2011-02-01 15:10:32 UTC (rev 21360)
+++ trunk/examples/output-demo/src/main/webapp/resources/tests/richfaces-panel-menu-group-qunit.js 2011-02-01 15:23:29 UTC (rev 21361)
@@ -35,8 +35,6 @@
// test default options
same(c.options.expandEvent, "click", "Expand Event");
same(c.options.collapseEvent, "click", "Collapse Event");
- same(c.options.expandSingle, false, "Expand Single");
- same(c.options.bubbleSelection, {}, "Bubble Selection");
});
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractPanelMenuGroup.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractPanelMenuGroup.java 2011-02-01 15:10:32 UTC (rev 21360)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractPanelMenuGroup.java 2011-02-01 15:23:29 UTC (rev 21361)
@@ -159,18 +159,12 @@
@Attribute(defaultValue = "getPanelMenu().getGroupMode()")
public abstract PanelMenuMode getMode();
- @Attribute(defaultValue = "getPanelMenu().isExpandSingle()")
- public abstract boolean isExpandSingle();
-
@Attribute
public abstract String getCollapseEvent();
@Attribute
public abstract String getExpandEvent();
- @Attribute(defaultValue = "getPanelMenu().isBubbleSelection()")
- public abstract boolean isBubbleSelection();
-
@Attribute
public abstract MethodExpression getChangeExpandListener();
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-02-01 15:10:32 UTC (rev 21360)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuGroupRenderer.java 2011-02-01 15:23:29 UTC (rev 21361)
@@ -23,25 +23,7 @@
package org.richfaces.renderkit.html;
-import static org.richfaces.renderkit.HtmlConstants.CLASS_ATTRIBUTE;
-import static org.richfaces.renderkit.HtmlConstants.DIV_ELEM;
-import static org.richfaces.renderkit.HtmlConstants.ID_ATTRIBUTE;
-import static org.richfaces.renderkit.HtmlConstants.INPUT_ELEM;
-import static org.richfaces.renderkit.HtmlConstants.INPUT_TYPE_HIDDEN;
-import static org.richfaces.renderkit.HtmlConstants.NAME_ATTRIBUTE;
-import static org.richfaces.renderkit.HtmlConstants.TYPE_ATTR;
-import static org.richfaces.renderkit.HtmlConstants.VALUE_ATTRIBUTE;
-import static org.richfaces.renderkit.html.TogglePanelRenderer.addEventOption;
-import static org.richfaces.renderkit.html.TogglePanelRenderer.getAjaxOptions;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-import javax.faces.context.ResponseWriter;
-
+import com.google.common.base.Strings;
import org.ajax4jsf.javascript.JSFunction;
import org.ajax4jsf.javascript.JSObject;
import org.ajax4jsf.javascript.ScriptUtils;
@@ -51,8 +33,17 @@
import org.richfaces.component.AbstractPanelMenuItem;
import org.richfaces.renderkit.HtmlConstants;
-import com.google.common.base.Strings;
+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;
+import static org.richfaces.renderkit.HtmlConstants.*;
+import static org.richfaces.renderkit.html.TogglePanelRenderer.addEventOption;
+import static org.richfaces.renderkit.html.TogglePanelRenderer.getAjaxOptions;
+
/**
* @author akolonitsky
* @since 2010-10-25
@@ -197,8 +188,6 @@
options.put("disabled", panelMenuGroup.isDisabled());
options.put("expandEvent", getExpandEvent(panelMenuGroup));
options.put("collapseEvent", getCollapseEvent(panelMenuGroup));
- options.put("expandSingle", panelMenuGroup.isExpandSingle());
- options.put("bubbleSelection", panelMenuGroup.isBubbleSelection());
options.put("expanded", panelMenuGroup.isExpanded());
options.put("selectable", panelMenuGroup.isSelectable());
options.put("unselectable", panelMenuGroup.isUnselectable());
@@ -240,11 +229,11 @@
if (component instanceof AbstractPanelMenuGroup) {
AbstractPanelMenuGroup group = (AbstractPanelMenuGroup) component;
- if (!group.isBubbleSelection()) {
+ if (!group.getPanelMenu().isBubbleSelection()) {
return false;
}
}
-
+
if (component.getChildCount() > 0) {
for (UIComponent child : component.getChildren()) {
if (!child.isRendered()) {
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuRenderer.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuRenderer.java 2011-02-01 15:10:32 UTC (rev 21360)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuRenderer.java 2011-02-01 15:23:29 UTC (rev 21361)
@@ -23,26 +23,25 @@
package org.richfaces.renderkit.html;
-import static org.richfaces.renderkit.html.TogglePanelRenderer.getAjaxOptions;
-import static org.richfaces.renderkit.html.TogglePanelRenderer.getValueRequestParamName;
+import org.ajax4jsf.javascript.JSObject;
+import org.richfaces.cdk.annotations.JsfRenderer;
+import org.richfaces.component.AbstractPanelMenu;
+import org.richfaces.component.AbstractPanelMenuItem;
+import org.richfaces.context.ExtendedPartialViewContext;
+import org.richfaces.renderkit.HtmlConstants;
-import java.io.IOException;
-import java.util.HashMap;
-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 javax.faces.event.ActionEvent;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
-import org.ajax4jsf.javascript.JSObject;
-import org.richfaces.cdk.annotations.JsfRenderer;
-import org.richfaces.component.AbstractPanelMenu;
-import org.richfaces.component.AbstractPanelMenuItem;
-import org.richfaces.context.ExtendedPartialViewContext;
-import org.richfaces.renderkit.HtmlConstants;
+import static org.richfaces.renderkit.html.TogglePanelRenderer.getAjaxOptions;
+import static org.richfaces.renderkit.html.TogglePanelRenderer.getValueRequestParamName;
/**
* @author akolonitsky
@@ -133,7 +132,7 @@
options.put("ajax", getAjaxOptions(context, panelMenu));
options.put("disabled", panelMenu.isDisabled());
options.put("expandSingle", panelMenu.isExpandSingle());
-
+ options.put("bubbleSelection", panelMenu.isBubbleSelection());
return options;
}
Modified: trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenu.js
===================================================================
--- trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenu.js 2011-02-01 15:10:32 UTC (rev 21360)
+++ trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenu.js 2011-02-01 15:23:29 UTC (rev 21361)
@@ -26,7 +26,8 @@
rf.ui = rf.ui || {};
var __DEFAULT_OPTIONS = {
- expandSingle : true
+ expandSingle : true,
+ bubbleSelection : true
};
rf.ui.PanelMenu = rf.BaseComponent.extendClass({
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-02-01 15:10:32 UTC (rev 21360)
+++ trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenuGroup.js 2011-02-01 15:23:29 UTC (rev 21361)
@@ -27,8 +27,6 @@
var __DEFAULT_OPTIONS = {
expanded : false,
- expandSingle : true,
- bubbleSelection : true,
stylePrefix : "rf-pm-gr",
expandEvent: "click",
collapseEvent: "click",
@@ -124,6 +122,9 @@
init : function (componentId, options) {
$super.constructor.call(this, componentId, $.extend({}, __DEFAULT_OPTIONS, options || {}));
+ this.options.bubbleSelection = this.__rfPanelMenu().options.bubbleSelection;
+ this.options.expandSingle = this.__rfPanelMenu().options.expandSingle;
+
if (!this.options.disabled) {
var menuGroup = this;
13 years, 11 months
JBoss Rich Faces SVN: r21360 - trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2011-02-01 10:10:32 -0500 (Tue, 01 Feb 2011)
New Revision: 21360
Modified:
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenu.ecss
Log:
RF-10153: rich:panelMenu Strange indention than using as links container
fix nowrap in chrome
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-02-01 14:55:26 UTC (rev 21359)
+++ trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenu.ecss 2011-02-01 15:10:32 UTC (rev 21360)
@@ -47,7 +47,6 @@
}
.rf-pm-itm-lbl {
- display: inline-block;
padding: 2px 0px 3px 0px;
font-size: '#{richSkin.generalSizeFont}';
font-family: '#{richSkin.generalFamilyFont}';
13 years, 11 months
JBoss Rich Faces SVN: r21359 - trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2011-02-01 09:55:26 -0500 (Tue, 01 Feb 2011)
New Revision: 21359
Modified:
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/Autocomplete.js
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/AutocompleteBase.js
Log:
https://issues.jboss.org/browse/RF-10348
Modified: trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/Autocomplete.js
===================================================================
--- trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/Autocomplete.js 2011-02-01 14:42:19 UTC (rev 21358)
+++ trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/Autocomplete.js 2011-02-01 14:55:26 UTC (rev 21359)
@@ -113,7 +113,7 @@
} else {
this.__onEnter(event);
rf.Selection.setCaretTo(rf.getDomElement(this.fieldId));
- this.hide(event);
+ this.__hide(event);
}
}
};
@@ -172,12 +172,12 @@
_this.isVisible && _this.options.selectFirst && selectItem.call(_this, _event, 0);
}
} else {
- _this.hide(_event);
+ _this.__hide(_event);
}
};
var ajaxError = function (event) {
- _this.hide(_event);
+ _this.__hide(_event);
clearItems.call(_this);
};
@@ -265,7 +265,7 @@
if (this.items.length!=0) {
callback && callback.call(this, event);
} else {
- this.hide(event);
+ this.__hide(event);
}
if (event.keyCode == rf.KEYS.RETURN || event.type == "click") {
this.__setInputValue(subValue);
@@ -283,7 +283,7 @@
} else {
if (this.options.ajaxMode) {
clearItems.call(this);
- this.hide(event);
+ this.__hide(event);
}
}
}
@@ -412,7 +412,7 @@
if (this.items.length==0 && this.isFirstAjax) {
if ((this.options.ajaxMode && subValue.length>=this.options.minChars) || this.options.lazyClientMode) {
this.value = subValue;
- callAjax.call(this, event, this.show);
+ callAjax.call(this, event, this.__show);
return true;
}
}
Modified: trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/AutocompleteBase.js
===================================================================
--- trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/AutocompleteBase.js 2011-02-01 14:42:19 UTC (rev 21358)
+++ trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/AutocompleteBase.js 2011-02-01 14:55:26 UTC (rev 21359)
@@ -66,7 +66,7 @@
rf.getDomElement(this.fieldId).focus();
if (this.isVisible) {
- this.hide(event);
+ this.__hide(event);
} else {
onShow.call(this, event);
}
@@ -87,7 +87,7 @@
} else if (!this.isMouseDown) {
if (this.isVisible) {
var _this = this;
- this.timeoutId = window.setTimeout(function(){_this.hide();}, 200);
+ this.timeoutId = window.setTimeout(function(){_this.__hide(event);}, 200);
}
if (this.focused) {
this.focused=false;
@@ -114,7 +114,7 @@
if (event.keyCode == rf.KEYS.LEFT || event.keyCode == rf.KEYS.RIGHT || flag) {
if (flag) {
this.currentValue = this.getValue();
- this.__onChangeValue(event, undefined, (!this.isVisible ? this.show : undefined));
+ this.__onChangeValue(event, undefined, (!this.isVisible ? this.__show : undefined));
} else if (this.isVisible) {
this.__onChangeValue(event);
}
@@ -126,7 +126,7 @@
this.isChanged = false;
onChange.call(this,{});
} else {
- !this.__updateState(event) && this.show(event);
+ !this.__updateState(event) && this.__show(event);
}
};
@@ -176,11 +176,11 @@
this.__onEnter(event);
//TODO: bind form submit event handler to cancel form submit under the opera
//cancelSubmit = true;
- this.hide();
+ this.__hide(event);
return false;
break;
case rf.KEYS.ESC:
- this.hide();
+ this.__hide(event);
break;
default:
if (!this.options.selectOnly) {
@@ -198,7 +198,7 @@
var show = function (event) {
if (!this.isVisible) {
if (this.__onBeforeShow(event)!=false) {
- this.scrollElements = rf.Event.bindScrollEventHandlers(this.selectId, this.hide, this, this.namespace);
+ this.scrollElements = rf.Event.bindScrollEventHandlers(this.selectId, this.__hide, this, this.namespace);
var element = rf.getDomElement(this.selectId);
if (this.options.attachToBody) {
this.parentElement = element.parentNode;
@@ -242,8 +242,15 @@
* public API functions
*/
name:"AutocompleteBase",
- show: show,
- hide: hide,
+ showPopup: function (event) {
+ if (!this.focused) {
+ rf.getDomElement(this.fieldId).focus();
+ }
+ onShow.call(this, event);
+ },
+ hidePopup: function (event) {
+ this.__hide(event)
+ },
getNamespace: function () {
return this.namespace;
},
@@ -259,6 +266,8 @@
* Protected methods
*/
__updateInputValue: updateInputValue,
+ __show: show,
+ __hide: hide,
/*
* abstract protected methods
*/
13 years, 11 months
JBoss Rich Faces SVN: r21358 - modules/tests/metamer/trunk/application/src/main/webapp/components/richTooltip.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2011-02-01 09:42:19 -0500 (Tue, 01 Feb 2011)
New Revision: 21358
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richTooltip/simple.xhtml
Log:
RF-10287 rich:tooltip - @limitRender doesn't work
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richTooltip/simple.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richTooltip/simple.xhtml 2011-02-01 14:38:18 UTC (rev 21357)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richTooltip/simple.xhtml 2011-02-01 14:42:19 UTC (rev 21358)
@@ -80,6 +80,7 @@
onmouseover="#{richTooltipBean.attributes['onmouseover'].value}"
onmouseup="#{richTooltipBean.attributes['onmouseup'].value}"
onshow="#{richTooltipBean.attributes['onshow'].value}"
+ render="#{richTooltipBean.attributes['render'].value}"
rendered="#{richTooltipBean.attributes['rendered'].value}"
showDelay="#{richTooltipBean.attributes['showDelay'].value}"
showEvent="#{richTooltipBean.attributes['showEvent'].value}"
13 years, 11 months
JBoss Rich Faces SVN: r21357 - in trunk/examples/output-demo/src/main/webapp: examples and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2011-02-01 09:38:18 -0500 (Tue, 01 Feb 2011)
New Revision: 21357
Added:
trunk/examples/output-demo/src/main/webapp/examples/panelMenu/
trunk/examples/output-demo/src/main/webapp/examples/panelMenu/RF-10153.xhtml
Modified:
trunk/examples/output-demo/src/main/webapp/WEB-INF/faces-config.xml
trunk/examples/output-demo/src/main/webapp/templates/template.xhtml
Log:
RF-10153: rich:panelMenu Strange indention than using as links container
Modified: trunk/examples/output-demo/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/examples/output-demo/src/main/webapp/WEB-INF/faces-config.xml 2011-02-01 14:25:11 UTC (rev 21356)
+++ trunk/examples/output-demo/src/main/webapp/WEB-INF/faces-config.xml 2011-02-01 14:38:18 UTC (rev 21357)
@@ -103,6 +103,10 @@
<from-outcome>qunit/panelMenu</from-outcome>
<to-view-id>/qunit/panelMenu.xhtml</to-view-id>
</navigation-case>
+ <navigation-case>
+ <from-outcome>RF-10153</from-outcome>
+ <to-view-id>/examples/panelMenu/RF-10153.xhtml</to-view-id>
+ </navigation-case>
<!-- Tooltip navigation -->
<navigation-case>
@@ -128,3 +132,5 @@
</navigation-rule>
</faces-config>
+
+
Added: trunk/examples/output-demo/src/main/webapp/examples/panelMenu/RF-10153.xhtml
===================================================================
--- trunk/examples/output-demo/src/main/webapp/examples/panelMenu/RF-10153.xhtml (rev 0)
+++ trunk/examples/output-demo/src/main/webapp/examples/panelMenu/RF-10153.xhtml 2011-02-01 14:38:18 UTC (rev 21357)
@@ -0,0 +1,84 @@
+<!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:rich="http://richfaces.org/output">
+
+<body>
+<ui:composition template="/templates/template.xhtml">
+
+ <ui:define name="title">Accordion Example</ui:define>
+ <ui:define name="body_head">Accordion Example</ui:define>
+
+ <ui:define name="body">
+ <p>Page</p>
+
+ <pre>
+ I try use RichFaces in my own project and panelMenu is looking as most convenient
+way to make admin panel for me. Now I can use panel menu just for switching between pages by links.
+But I've got some styling issues. I am new in RichFaces, so I decided to do my project on the basis
+of RichFaces showcase.
+ Please, see the code
+ </pre>
+
+ <h:form>
+ <rich:panel>
+ <f:facet name="header">
+ <h:outputText value="Административная панель"/>
+ </f:facet>
+
+ <h:panelGrid columns="2">
+ <rich:panelMenu style="width:200px" mode="ajax" groupMode="ajax"
+ iconExpandedGroup="disc" iconCollapsedGroup="disc"
+ iconExpandedTopGroup="chevronUp" iconGroupTopPosition="right"
+ iconCollapsedTopGroup="chevronDown"
+ >
+ <rich:panelMenuGroup label="Базы данных">
+ <rich:panelMenuItem name="Item_1_1">
+ <h:link outcome="admin" value="Загрузка абзацев с сервера"/>
+ </rich:panelMenuItem>
+ <rich:panelMenuItem name="Item_1_2">
+ <h:link outcome="admin" value="Тесты абзацев"/>
+ </rich:panelMenuItem>
+ <rich:panelMenuItem name="Item_1_3">
+ <h:link outcome="admin" value="Создать главы"/>
+ </rich:panelMenuItem>
+ </rich:panelMenuGroup>
+ <rich:panelMenuGroup label="Подсказки">
+ <rich:panelMenuItem name="Item_2_1">
+ <h:link outcome="admin" value="Загрузка подсказок с сервера"/>
+ </rich:panelMenuItem>
+ <rich:panelMenuItem name="Item_2_2">
+ <h:link outcome="admin" value="Тесты подсказок"/>
+ </rich:panelMenuItem>
+ <rich:panelMenuItem name="Item_2_3">
+ <h:link outcome="admin" value="Создать подсказки"/>
+ </rich:panelMenuItem>
+ </rich:panelMenuGroup>
+ <rich:panelMenuGroup label="Документы">
+ <rich:panelMenuItem name="Item_3_1">
+ <h:link outcome="admin" value="Загрузка документов с сервера"/>
+ </rich:panelMenuItem>
+ <rich:panelMenuItem name="Item_3_2">
+ <h:link outcome="admin" value="Тесты документов"/>
+ </rich:panelMenuItem>
+ <rich:panelMenuItem name="Item_3_3">
+ <h:link outcome="admin" value="Создать документы"/>
+ </rich:panelMenuItem>
+ </rich:panelMenuGroup>
+ </rich:panelMenu>
+ <rich:panel>
+ <f:facet name="header">
+ <h:outputText value="Загрузка глав с сервера"/>
+ </f:facet>
+ Здесь сегодня будет загрузка глав с локального сервера...
+ </rich:panel>
+ </h:panelGrid>
+ </rich:panel>
+ </h:form>
+ </ui:define>
+</ui:composition>
+</body>
+</html>
Modified: trunk/examples/output-demo/src/main/webapp/templates/template.xhtml
===================================================================
--- trunk/examples/output-demo/src/main/webapp/templates/template.xhtml 2011-02-01 14:25:11 UTC (rev 21356)
+++ trunk/examples/output-demo/src/main/webapp/templates/template.xhtml 2011-02-01 14:38:18 UTC (rev 21357)
@@ -139,6 +139,10 @@
<ul>
<li><h:link value="Panel Menu" outcome="qunit/panelMenu" /></li>
</ul>
+ <p>Bugs</p>
+ <ul>
+ <li><h:link value="RF-10153" outcome="RF-10153" /></li>
+ </ul>
</li>
</ul>
13 years, 11 months
JBoss Rich Faces SVN: r21356 - in trunk/ui/iteration/ui/src/main/java/org/richfaces: renderkit and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2011-02-01 09:25:11 -0500 (Tue, 01 Feb 2011)
New Revision: 21356
Modified:
trunk/ui/iteration/ui/src/main/java/org/richfaces/component/UIDataTableBase.java
trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/AbstractRowsRenderer.java
trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/AbstractTableBaseRenderer.java
trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/ExtendedDataTableRenderer.java
Log:
RF-8685 implement set of event handlers onrow* (onrowmouseover, onrowclick and so on..) for dataTAble and ExtendedDataTable
Modified: trunk/ui/iteration/ui/src/main/java/org/richfaces/component/UIDataTableBase.java
===================================================================
--- trunk/ui/iteration/ui/src/main/java/org/richfaces/component/UIDataTableBase.java 2011-02-01 14:21:26 UTC (rev 21355)
+++ trunk/ui/iteration/ui/src/main/java/org/richfaces/component/UIDataTableBase.java 2011-02-01 14:25:11 UTC (rev 21356)
@@ -45,6 +45,7 @@
import org.ajax4jsf.model.ExtendedDataModel;
import org.ajax4jsf.model.Range;
import org.richfaces.cdk.annotations.Attribute;
+import org.richfaces.cdk.annotations.EventName;
import org.richfaces.context.ExtendedVisitContext;
import org.richfaces.context.ExtendedVisitContextMode;
import org.richfaces.event.FilteringEvent;
@@ -141,6 +142,36 @@
@Attribute
public abstract SortMode getSortMode();
+ @Attribute(events = @EventName("rowclick"))
+ public abstract String getOnrowclick();
+
+ @Attribute(events = @EventName("rowdblclick"))
+ public abstract String getOnrowdblclick();
+
+ @Attribute(events = @EventName("rowmousedown"))
+ public abstract String getOnrowmousedown();
+
+ @Attribute(events = @EventName("rowmouseup"))
+ public abstract String getOnrowmouseup();
+
+ @Attribute(events = @EventName("rowmouseover"))
+ public abstract String getOnrowmouseover();
+
+ @Attribute(events = @EventName("rowmousemove"))
+ public abstract String getOnrowmousemove();
+
+ @Attribute(events = @EventName("rowmouseout"))
+ public abstract String getOnrowmouseout();
+
+ @Attribute(events = @EventName("rowkeypress"))
+ public abstract String getOnrowkeypress();
+
+ @Attribute(events = @EventName("rowkeydown"))
+ public abstract String getOnrowkeydown();
+
+ @Attribute(events = @EventName("rowkeyup"))
+ public abstract String getOnrowkeyup();
+
public Iterator<UIComponent> columns() {
return new DataTableColumnsIterator(this);
}
Modified: trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/AbstractRowsRenderer.java
===================================================================
--- trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/AbstractRowsRenderer.java 2011-02-01 14:21:26 UTC (rev 21355)
+++ trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/AbstractRowsRenderer.java 2011-02-01 14:25:11 UTC (rev 21356)
@@ -23,6 +23,8 @@
package org.richfaces.renderkit;
import java.io.IOException;
+import java.util.Collections;
+import java.util.Map;
import javax.faces.FacesException;
import javax.faces.application.ResourceDependencies;
@@ -48,6 +50,30 @@
})
public abstract class AbstractRowsRenderer extends RendererBase implements DataVisitor {
+ private static final Map<String, ComponentAttribute> ROW_HANDLER_ATTRIBUTES = Collections
+ .unmodifiableMap(ComponentAttribute.createMap(
+ new ComponentAttribute(HtmlConstants.ONCLICK_ATTRIBUTE).setEventNames("rowclick").
+ setComponentAttributeName("onrowclick"),
+ new ComponentAttribute(HtmlConstants.ONDBLCLICK_ATTRIBUTE).setEventNames("rowdblclick").
+ setComponentAttributeName("onrowdblclick"),
+ new ComponentAttribute(HtmlConstants.ONMOUSEDOWN_ATTRIBUTE).setEventNames("rowmousedown").
+ setComponentAttributeName("onrowmousedown"),
+ new ComponentAttribute(HtmlConstants.ONMOUSEUP_ATTRIBUTE).setEventNames("rowmouseup").
+ setComponentAttributeName("onrowmouseup"),
+ new ComponentAttribute(HtmlConstants.ONMOUSEOVER_ATTRIBUTE).setEventNames("rowmouseover").
+ setComponentAttributeName("onrowmouseover"),
+ new ComponentAttribute(HtmlConstants.ONMOUSEMOVE_ATTRIBUTE).setEventNames("rowmousemove").
+ setComponentAttributeName("onrowmousemove"),
+ new ComponentAttribute(HtmlConstants.ONMOUSEOUT_ATTRIBUTE).setEventNames("rowmouseout").
+ setComponentAttributeName("onrowmouseout"),
+ new ComponentAttribute(HtmlConstants.ONKEYPRESS_ATTRIBUTE).setEventNames("rowkeypress").
+ setComponentAttributeName("onrowkeypress"),
+ new ComponentAttribute(HtmlConstants.ONKEYDOWN_ATTRIBUTE).setEventNames("rowkeydown").
+ setComponentAttributeName("onrowkeydown"),
+ new ComponentAttribute(HtmlConstants.ONKEYUP_ATTRIBUTE).setEventNames("rowkeyup").
+ setComponentAttributeName("onrowkeyup")
+ ));
+
public abstract void encodeRow(ResponseWriter writer, FacesContext facesContext, RowHolderBase rowHolder) throws IOException;
public abstract RowHolderBase createRowHolder(FacesContext context, UIComponent component, Object [] options);
@@ -76,6 +102,10 @@
public void encodeFakeRow(FacesContext facesContext, RowHolderBase rowHolder) throws IOException {
}
+ protected void renderRowHandlers(FacesContext context, UIDataTableBase dataTable) throws IOException {
+ RenderKitUtils.renderPassThroughAttributesOptimized(context, dataTable, ROW_HANDLER_ATTRIBUTES);
+ }
+
public void processRows(ResponseWriter writer, FacesContext facesContext, UIComponent component, Object[] options) throws IOException {
RowHolderBase rowHolder = createRowHolder(facesContext, component, options);
encodeRows(facesContext, rowHolder);
Modified: trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/AbstractTableBaseRenderer.java
===================================================================
--- trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/AbstractTableBaseRenderer.java 2011-02-01 14:21:26 UTC (rev 21355)
+++ trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/AbstractTableBaseRenderer.java 2011-02-01 14:25:11 UTC (rev 21356)
@@ -32,6 +32,7 @@
import javax.faces.context.ResponseWriter;
import org.richfaces.component.Row;
+import org.richfaces.component.UIDataTableBase;
/**
@@ -79,7 +80,7 @@
} else {
encodeRowStart(writer, context, parentId, currentRow, component);
}
-
+ renderRowHandlers(context, (UIDataTableBase)rowHolder.getRow());
rowHolder.setRowStart(false);
}
Modified: trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/ExtendedDataTableRenderer.java
===================================================================
--- trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/ExtendedDataTableRenderer.java 2011-02-01 14:21:26 UTC (rev 21355)
+++ trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/ExtendedDataTableRenderer.java 2011-02-01 14:25:11 UTC (rev 21356)
@@ -764,7 +764,9 @@
RendererState state = (RendererState) rowHolder;
UIDataTableBase table = state.getRow();
writer.startElement(HtmlConstants.TR_ELEMENT, table);
-
+
+ renderRowHandlers(facesContext, (UIDataTableBase)rowHolder.getRow());
+
String rowClass = getRowClass(rowHolder);
if (!"".equals(rowClass)) {
writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, rowClass, null);
13 years, 11 months
JBoss Rich Faces SVN: r21355 - in trunk: ui/input/ui/src/main/resources/META-INF/resources/org.richfaces and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2011-02-01 09:21:26 -0500 (Tue, 01 Feb 2011)
New Revision: 21355
Modified:
trunk/examples/input-demo/src/main/webapp/examples/inplaceSelect.xhtml
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceSelect.js
Log:
RF-10163 inplaceSelect: showPopup js API works wrong with default label
Modified: trunk/examples/input-demo/src/main/webapp/examples/inplaceSelect.xhtml
===================================================================
--- trunk/examples/input-demo/src/main/webapp/examples/inplaceSelect.xhtml 2011-02-01 12:29:00 UTC (rev 21354)
+++ trunk/examples/input-demo/src/main/webapp/examples/inplaceSelect.xhtml 2011-02-01 14:21:26 UTC (rev 21355)
@@ -3,7 +3,8 @@
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:in="http://richfaces.org/input">
+ xmlns:in="http://richfaces.org/input"
+ xmlns:misc="http://richfaces.org/misc">
<f:view contentType="text/html" />
<h:head>
@@ -13,11 +14,11 @@
<h:body>
<h:form id="form">
- <div id="scroll" style="width: 400px; height:200px; overflow:auto;" >
+ <div id="scroll" style="width: 500px; height:400px; overflow:auto;" >
<fieldset>
<legend>InplaceSelect Test App</legend>
Fresh off his victory in the Florida primary, Sen. John McCain is poised to take another big prize. Former
- <in:inplaceSelect defaultLabel="Edit Text" value="#{inputBean.value}" openOnEdit="true" saveOnSelect="false">
+ <in:inplaceSelect id='ii' defaultLabel="Edit Text" value="#{inputBean.value}" openOnEdit="true" saveOnSelect="false">
<f:selectItem itemLabel="Label#1" itemValue="Value#1"/>
<f:selectItem itemLabel="Label#2" itemValue="Value#2"/>
<f:selectItem itemLabel="Label#3" itemValue="Value#3"/>
@@ -36,7 +37,12 @@
Mayor Rudy Giuliani plans to drop out and endorse McCain, two GOP sources said. That would give McCain added momentum heading into a debate Wednesday and next week's Super Tuesday contests
</fieldset>
- <h:commandButton value="submit"></h:commandButton>
+ <ul>
+ <li><h:commandButton value="submit"></h:commandButton></li>
+ <li> <h:commandButton value="ShowPopup" onclick="#{misc:component('ii')}.showPopup(); return false;"/></li>
+ </ul>
+
+
</div>
<h:panelGroup id="out">
<h:outputText value="Entered Value: #{inputBean.value}"/>
Modified: trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceSelect.js
===================================================================
--- trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceSelect.js 2011-02-01 12:29:00 UTC (rev 21354)
+++ trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceSelect.js 2011-02-01 14:21:26 UTC (rev 21355)
@@ -1,239 +1,215 @@
(function ($, rf) {
-
- rf.ui = rf.ui || {};
-
- rf.ui.InplaceSelect = function(id, options) {
- var mergedOptions = $.extend({}, defaultOptions, options);
- $super.constructor.call(this, id, mergedOptions)
- this.getInput().bind("click", $.proxy(this.__clickHandler, this));
- mergedOptions['attachTo'] = id;
- mergedOptions['scrollContainer'] = $(document.getElementById(id + "Items")).parent()[0];
- this.popupList = new rf.ui.PopupList(id+"List", this, mergedOptions);
- this.items = mergedOptions.items;
- this.selValueInput = $(document.getElementById(id+"selValue"));
- this.list = $(document.getElementById(id+"List"));
- this.list.bind("mousedown", $.proxy(this.__onListMouseDown, this));
- this.list.bind("mouseup", $.proxy(this.__onListMouseUp, this));
- this.openOnEdit = mergedOptions.openOnEdit;
- this.saveOnSelect = mergedOptions.saveOnSelect;
- this.savedIndex = -1;
+ rf.ui = rf.ui || {};
+
+ rf.ui.InplaceSelect = function(id, options) {
+ var mergedOptions = $.extend({}, defaultOptions, options);
+ $super.constructor.call(this, id, mergedOptions) ;
+ this.getInput().bind("click", $.proxy(this.__clickHandler, this));
+ mergedOptions['attachTo'] = id;
+ mergedOptions['scrollContainer'] = $(document.getElementById(id + "Items")).parent()[0];
+ this.popupList = new rf.ui.PopupList(id+"List", this, mergedOptions);
+ this.items = mergedOptions.items;
+ this.selValueInput = $(document.getElementById(id+"selValue"));
+ this.list = $(document.getElementById(id+"List"));
+ this.list.bind("mousedown", $.proxy(this.__onListMouseDown, this));
+ this.list.bind("mouseup", $.proxy(this.__onListMouseUp, this));
+ this.openOnEdit = mergedOptions.openOnEdit;
+ this.saveOnSelect = mergedOptions.saveOnSelect;
+ this.savedIndex = -1;
+
this.inputItem = $(document.getElementById(id + "Input"));
this.inputItemWidth = this.inputItem.width();
this.inputWidthDefined = options.inputWidth !== undefined;
- }
-
+ };
rf.ui.InplaceInput.extend(rf.ui.InplaceSelect);
- var $super = rf.ui.InplaceSelect.$super;
-
- var defaultOptions = {
- defaultLabel: "",
- saveOnSelect: true,
- openOnEdit: true,
- showControl: false,
- itemCss: "rf-is-opt",
- selectItemCss: "rf-is-sel",
- listCss: "rf-is-lst-cord",
- noneCss: "rf-is-none",
- editCss: "rf-is-edit",
- changedCss: "rf-is-c-s"
- };
+ var $super = rf.ui.InplaceSelect.$super;
-
- $.extend(rf.ui.InplaceSelect.prototype, ( function () {
-
- return{
- name : "inplaceSelect",
-
- getName: function() {
- return this.name;
- },
-
- geNamespace: function() {
- return this.namespace;
- },
-
- onshow: function() {
- $super.onshow.call(this);
- if(this.openOnEdit) {
- this.__showPopup();
- }
- },
-
- onhide: function() {
- this.__hidePopup();
- },
-
- showPopup: function() {
- this.editState = true;
- this.scrollElements = rf.Event.bindScrollEventHandlers(this.id, this.__scrollHandler, this);
- this.__setInputFocus();
- this.__setFocused(true);
- this.focusValue = this.__getValue();
- this.invokeEvent.call(this, "focus", document.getElementById(this.id + 'Input'));
- this.__showPopup();
-
-
- },
-
- __showPopup: function() {
- this.popupList.show();
- this.__hideLabel();
- },
-
- __hidePopup: function() {
- this.popupList.hide();
- this.__showLabel();
- },
-
- onsave: function() {
- var item = this.popupList.currentSelectItem();
- if(item) {
- this.savedIndex = this.popupList.getSelectedItemIndex();
- var value = this.getItemValue(item);
- this.saveItemValue(value);
- }
- },
-
- oncancel: function() {
- var prevItem = this.popupList.getItemByIndex(this.savedIndex);
- if(prevItem) {
- var value = this.getItemValue(prevItem);
- this.saveItemValue(value);
- }
- },
-
- onblur: function(e) {
- this.__hidePopup();
- $super.onblur.call(this);
- },
-
- onfocus: function(e) {
- if(!this.__isFocused()) {
- this.__setFocused(true);
- this.focusValue = this.selValueInput.val();
- this.invokeEvent.call(this, "focus", document.getElementById(this.id + 'Input'), e);
- }
- },
-
- processItem: function(item) {
- var label = this.getItemLabel(item);
- this.__setValue(label);
-
- this.__setInputFocus();
- this.__hidePopup();
-
- if(this.saveOnSelect) {
- this.save();
- }
+ var defaultOptions = {
+ defaultLabel: "",
+ saveOnSelect: true,
+ openOnEdit: true,
+ showControl: false,
+ itemCss: "rf-is-opt",
+ selectItemCss: "rf-is-sel",
+ listCss: "rf-is-lst-cord",
+ noneCss: "rf-is-none",
+ editCss: "rf-is-edit",
+ changedCss: "rf-is-c-s"
+ };
- this.invokeEvent.call(this,"selectitem", document.getElementById(this.id + 'Input'));
- },
-
- getItemValue: function(item) {
- var key = $(item).attr("id");
+ $.extend(rf.ui.InplaceSelect.prototype, (function () {
- var value;
- $.each(this.items, function(){
- if (this.id == key) {
- value = this.value;
- return false;
- }
- });
-
- return value;
- },
-
- saveItemValue: function(value) {
- this.selValueInput.val(value);
-
- },
-
- getItemLabel: function(item) {
- var key = $(item).attr("id");
- var label;
- $.each(this.items, function(){
- if (this.id == key) {
- label = this.label;
- return false;
- }
- });
-
- return label;
- },
-
- __isValueChanged: function() {
- return (this.focusValue != this.selValueInput.val());
- },
-
- __keydownHandler: function(e) {
-
- var code;
-
- if(e.keyCode) {
- code = e.keyCode;
- } else if(e.which) {
- code = e.which;
- }
-
- if(this.popupList.isVisible()) {
- switch(code) {
- case rf.KEYS.DOWN:
- e.preventDefault();
- this.popupList.__selectNext();
- this.__setInputFocus();
- break;
-
- case rf.KEYS.UP:
- e.preventDefault();
- this.popupList.__selectPrev();
- this.__setInputFocus();
- break;
-
- case rf.KEYS.RETURN:
- e.preventDefault();
- this.popupList.__selectCurrent();
- this.__setInputFocus();
- return false;
- break;
- }
- }
-
- $super.__keydownHandler.call(this,e);
- },
-
- __blurHandler: function(e) {
- if(this.saveOnSelect || !this.isMouseDown) {
- if(this.isEditState()) {
- this.timeoutId = window.setTimeout($.proxy(function(){
- this.onblur(e);
- }, this), 200);
- }
- } else {
- this.__setInputFocus();
- this.isMouseDown = false;
- }
- },
-
- __clickHandler: function(e) {
- this.__showPopup();
- },
+ return{
+ name : "inplaceSelect",
- __onListMouseDown: function(e) {
- this.isMouseDown = true;
- },
-
- __onListMouseUp: function(e) {
- this.isMouseDown = false;
- this.__setInputFocus();
- },
+ getName: function() {
+ return this.name;
+ },
+ geNamespace: function() {
+ return this.namespace;
+ },
+ onshow: function() {
+ $super.onshow.call(this);
+ if(this.openOnEdit) {
+ this.__showPopup();
+ }
+ },
+ onhide: function() {
+ this.__hidePopup();
+ },
+ showPopup: function() {
+ this.isSaved = false;
+ this.element.addClass(this.editCss);
+ this.editContainer.removeClass(this.noneCss);
+
+ this.editState = true;
+ this.scrollElements = rf.Event.bindScrollEventHandlers(this.id, this.__scrollHandler, this);
+ this.__setInputFocus();
+ this.onfocus();
+ this.__showPopup();
+
+ },
+ __showPopup: function() {
+ this.popupList.show();
+ this.__hideLabel();
+ },
+ __hidePopup: function() {
+ this.popupList.hide();
+ this.__showLabel();
+ },
+ onsave: function() {
+ var item = this.popupList.currentSelectItem();
+ if(item) {
+ this.savedIndex = this.popupList.getSelectedItemIndex();
+ var value = this.getItemValue(item);
+ this.saveItemValue(value);
+ }
+ },
+ oncancel: function() {
+ var prevItem = this.popupList.getItemByIndex(this.savedIndex);
+ if(prevItem) {
+ var value = this.getItemValue(prevItem);
+ this.saveItemValue(value);
+ }
+ },
+ onblur: function(e) {
+ this.__hidePopup();
+ $super.onblur.call(this);
+ },
+ onfocus: function(e) {
+ if(!this.__isFocused()) {
+ this.__setFocused(true);
+ this.focusValue = this.selValueInput.val();
+ this.invokeEvent.call(this, "focus", document.getElementById(this.id + 'Input'), e);
+ }
+ },
+ processItem: function(item) {
+ var label = this.getItemLabel(item);
+ this.__setValue(label);
+
+ this.__setInputFocus();
+ this.__hidePopup();
+
+ if(this.saveOnSelect) {
+ this.save();
+ }
+
+ this.invokeEvent.call(this,"selectitem", document.getElementById(this.id + 'Input'));
+ },
+ getItemValue: function(item) {
+ var key = $(item).attr("id");
+
+ var value;
+ $.each(this.items, function() {
+ if (this.id == key) {
+ value = this.value;
+ return false;
+ }
+ });
+ return value;
+ },
+ saveItemValue: function(value) {
+ this.selValueInput.val(value);
+
+ },
+ getItemLabel: function(item) {
+ var key = $(item).attr("id");
+ var label;
+ $.each(this.items, function() {
+ if (this.id == key) {
+ label = this.label;
+ return false;
+ }
+ });
+ return label;
+ },
+ __isValueChanged: function() {
+ return (this.focusValue != this.selValueInput.val());
+ },
+ __keydownHandler: function(e) {
+
+ var code;
+
+ if(e.keyCode) {
+ code = e.keyCode;
+ } else if(e.which) {
+ code = e.which;
+ }
+
+ if(this.popupList.isVisible()) {
+ switch(code) {
+ case rf.KEYS.DOWN:
+ e.preventDefault();
+ this.popupList.__selectNext();
+ this.__setInputFocus();
+ break;
+
+ case rf.KEYS.UP:
+ e.preventDefault();
+ this.popupList.__selectPrev();
+ this.__setInputFocus();
+ break;
+
+ case rf.KEYS.RETURN:
+ e.preventDefault();
+ this.popupList.__selectCurrent();
+ this.__setInputFocus();
+ return false;
+ break;
+ }
+ }
+
+ $super.__keydownHandler.call(this,e);
+ },
+ __blurHandler: function(e) {
+ if(this.saveOnSelect || !this.isMouseDown) {
+ if(this.isEditState()) {
+ this.timeoutId = window.setTimeout($.proxy( function() {
+ this.onblur(e);
+ }, this), 200);
+ }
+ } else {
+ this.__setInputFocus();
+ this.isMouseDown = false;
+ }
+ },
+ __clickHandler: function(e) {
+ this.__showPopup();
+ },
+ __onListMouseDown: function(e) {
+ this.isMouseDown = true;
+ },
+ __onListMouseUp: function(e) {
+ this.isMouseDown = false;
+ this.__setInputFocus();
+ },
__showLabel: function(e) {
this.label.show();
this.editContainer.css("position", "absolute");
this.inputItem.width(this.inputItemWidth);
},
-
__hideLabel: function(e) {
this.label.hide();
this.editContainer.css("position", "static");
@@ -241,24 +217,21 @@
this.inputItem.width(this.label.width());
}
},
-
- getValue: function() {
- return this.selValueInput.val();
- },
-
- setValue: function(value) {
- var item;
- for (var i=0; i<this.items.length; i++) {
- item = this.items[i];
- if (item.value == value) {
- this.__setValue(item.label);
- this.save();
- this.popupList.__selectByIndex(i);
- }
- }
- }
- }
-
- })());
+ getValue: function() {
+ return this.selValueInput.val();
+ },
+ setValue: function(value) {
+ var item;
+ for (var i=0; i<this.items.length; i++) {
+ item = this.items[i];
+ if (item.value == value) {
+ this.__setValue(item.label);
+ this.save();
+ this.popupList.__selectByIndex(i);
+ }
+ }
+ }
+ };
+ })());
})(jQuery, window.RichFaces);
13 years, 11 months
JBoss Rich Faces SVN: r21354 - in modules/tests/metamer/trunk: application/src/main/webapp/components/richCalendar and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2011-02-01 07:29:00 -0500 (Tue, 01 Feb 2011)
New Revision: 21354
Modified:
modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichCalendarBean.properties
modules/tests/metamer/trunk/application/src/main/webapp/components/richCalendar/simple.xhtml
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCalendar/TestRichCalendarAttributes.java
Log:
* test and sample for calendar fixed
Modified: modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichCalendarBean.properties
===================================================================
--- modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichCalendarBean.properties 2011-02-01 12:06:30 UTC (rev 21353)
+++ modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichCalendarBean.properties 2011-02-01 12:29:00 UTC (rev 21354)
@@ -3,14 +3,14 @@
attr.boundaryDatesMode.select=select
attr.boundaryDatesMode.null=
+attr.buttonDisabledIcon.star=/resources/images/star.png
+attr.buttonDisabledIcon.heart=/resources/images/heart.png
+attr.buttonDisabledIcon.null=
+
attr.buttonIcon.star=/resources/images/star.png
attr.buttonIcon.heart=/resources/images/heart.png
attr.buttonIcon.null=
-attr.buttonIconDisabled.star=/resources/images/star.png
-attr.buttonIconDisabled.heart=/resources/images/heart.png
-attr.buttonIconDisabled.null=
-
attr.dayClassFunction.yellowTuesdays=yellowTuesdays
attr.dayClassFunction.aquaWeekends=aquaWeekends
attr.dayClassFunction.null=
@@ -40,4 +40,4 @@
attr.todayControlMode.scroll=scroll
attr.todayControlMode.select=select
attr.todayControlMode.hidden=hidden
-attr.todayControlMode.null=
\ No newline at end of file
+attr.todayControlMode.null=
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richCalendar/simple.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richCalendar/simple.xhtml 2011-02-01 12:06:30 UTC (rev 21353)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richCalendar/simple.xhtml 2011-02-01 12:29:00 UTC (rev 21354)
@@ -86,8 +86,8 @@
<rich:calendar id="calendar"
boundaryDatesMode="#{richCalendarBean.attributes['boundaryDatesMode'].value}"
buttonClass="#{richCalendarBean.attributes['buttonClass'].value}"
+ buttonDisabledIcon="#{richCalendarBean.attributes['buttonDisabledIcon'].value}"
buttonIcon="#{richCalendarBean.attributes['buttonIcon'].value}"
- buttonIconDisabled="#{richCalendarBean.attributes['buttonIconDisabled'].value}"
buttonLabel="#{richCalendarBean.attributes['buttonLabel'].value}"
converterMessage="#{richCalendarBean.attributes['converterMessage'].value}"
currentDate="#{richCalendarBean.attributes['currentDate'].value}"
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-02-01 12:06:30 UTC (rev 21353)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCalendar/TestRichCalendarAttributes.java 2011-02-01 12:29:00 UTC (rev 21354)
@@ -191,18 +191,18 @@
@Test
@IssueTracking("https://issues.jboss.org/browse/RF-10255")
- public void testButtonIconDisabled() {
+ public void testButtonDisabledIcon() {
selenium.click(pjq("input[name$=disabledInput][value=true]"));
selenium.waitForPageToLoad();
- selenium.click(pjq("td:has(label:contains(heart)) > input[name$=buttonIconDisabledInput]"));
+ selenium.click(pjq("td:has(label:contains(heart)) > input[name$=buttonDisabledIconInput]"));
selenium.waitForPageToLoad();
AttributeLocator attr = image.getAttribute(Attribute.SRC);
String src = selenium.getAttribute(attr);
assertTrue(src.contains("heart.png"), "Calendar's icon was not updated.");
- selenium.click(pjq("td:has(label:contains(null)) > input[name$=buttonIconDisabledInput]"));
+ selenium.click(pjq("td:has(label:contains(null)) > input[name$=buttonDisabledIconInput]"));
selenium.waitForPageToLoad();
src = selenium.getAttribute(attr);
13 years, 11 months