JBoss Rich Faces SVN: r268 - trunk/richfaces/menu-components/src/main/templates/org/richfaces.
by richfaces-svn-commits@lists.jboss.org
Author: F.antonov
Date: 2007-04-04 09:24:46 -0400 (Wed, 04 Apr 2007)
New Revision: 268
Modified:
trunk/richfaces/menu-components/src/main/templates/org/richfaces/htmlMenuItem.jspx
Log:
MenuItem component development.
Modified: trunk/richfaces/menu-components/src/main/templates/org/richfaces/htmlMenuItem.jspx
===================================================================
--- trunk/richfaces/menu-components/src/main/templates/org/richfaces/htmlMenuItem.jspx 2007-04-04 13:24:20 UTC (rev 267)
+++ trunk/richfaces/menu-components/src/main/templates/org/richfaces/htmlMenuItem.jspx 2007-04-04 13:24:46 UTC (rev 268)
@@ -58,7 +58,7 @@
]]></jsp:scriptlet>
<span id="#{clientId}:disabled"
class="#{labelClass}">
- #{component.attributes['value']}
+ #{value}
<f:call name="renderChildren" />
</span>
<jsp:scriptlet><![CDATA[
@@ -67,7 +67,7 @@
<a id="#{clientId}:anchor"
href="#"
class="#{labelClass}">
- #{component.attributes['value']}
+ #{value}
<f:call name="renderChildren" />
</a>
<jsp:scriptlet><![CDATA[
17 years, 9 months
JBoss Rich Faces SVN: r267 - trunk/richfaces/menu-components/src/main/java/org/richfaces/renderkit/html.
by richfaces-svn-commits@lists.jboss.org
Author: F.antonov
Date: 2007-04-04 09:24:20 -0400 (Wed, 04 Apr 2007)
New Revision: 267
Modified:
trunk/richfaces/menu-components/src/main/java/org/richfaces/renderkit/html/MenuItemRendererBase.java
Log:
MenuItem component development.
Modified: trunk/richfaces/menu-components/src/main/java/org/richfaces/renderkit/html/MenuItemRendererBase.java
===================================================================
--- trunk/richfaces/menu-components/src/main/java/org/richfaces/renderkit/html/MenuItemRendererBase.java 2007-04-04 12:00:33 UTC (rev 266)
+++ trunk/richfaces/menu-components/src/main/java/org/richfaces/renderkit/html/MenuItemRendererBase.java 2007-04-04 13:24:20 UTC (rev 267)
@@ -142,12 +142,13 @@
resource = "dr-menu-label rich-menu-item-label";
variables.setVariable("labelClass", resource);
- resource = null;
+ scriptValue = new StringBuffer();
+ scriptValue.append(getStringAttributeOrEmptyString(menuItem, "onselect"));
String mode = resolveSubmitMode(menuItem);
if (mode.equalsIgnoreCase(UIMenuItem.MODE_AJAX)) {
- resource = AjaxRendererUtils.buildOnClick(menuItem, context).toString();
- //resource += "; Exadel.Menu.Layers.shutdown();return false;";
- } else if (mode.equalsIgnoreCase(UIMenuItem.MODE_SERVER)) {
+ scriptValue.append(AjaxRendererUtils.buildOnClick(menuItem, context).toString());
+ //scriptValue.append("; Exadel.Menu.Layers.shutdown();return false;");
+ } else if (mode.equalsIgnoreCase(UIMenuItem.MODE_SERVER)) {
CommandScriptBuilder builder = new CommandScriptBuilder(menuItem);
builder.setCheckActionAndListener(true);
Object target = menuItem.getAttributes().get("target");
@@ -159,11 +160,15 @@
//builder.addCodeAfter("Exadel.Menu.Layers.shutdown();return false;");
String id = menuItem.getClientId(context);
builder.addParameter(id + ":hidden", id);
- resource = builder.toString();
+ scriptValue.append(builder.toString());
+ } else {
+ scriptValue.append("; " + getStringAttributeOrEmptyString(menuItem, "onclick"));
}
- if (resource != null) {
- variables.setVariable("onclick", resource);
+ if (resource.length() > 0) {
+ variables.setVariable("onclick", scriptValue.toString());
}
+
+ variables.setVariable("value", getStringAttributeOrEmptyString(menuItem, "value"));
}
}
17 years, 9 months
JBoss Rich Faces SVN: r266 - trunk/richfaces/tree/src/test/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-04-04 08:00:33 -0400 (Wed, 04 Apr 2007)
New Revision: 266
Added:
trunk/richfaces/tree/src/test/java/org/richfaces/component/TreeComponentTest.java
Removed:
trunk/richfaces/tree/src/test/java/org/richfaces/component/JSFComponentTest.java
Log:
JSFComponentTest renamed to TreeComponentTest
Deleted: trunk/richfaces/tree/src/test/java/org/richfaces/component/JSFComponentTest.java
===================================================================
--- trunk/richfaces/tree/src/test/java/org/richfaces/component/JSFComponentTest.java 2007-04-04 11:57:57 UTC (rev 265)
+++ trunk/richfaces/tree/src/test/java/org/richfaces/component/JSFComponentTest.java 2007-04-04 12:00:33 UTC (rev 266)
@@ -1,150 +0,0 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces 3.0 - Ajax4jsf Component Library
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces.component;
-
-import java.io.IOException;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.faces.component.UICommand;
-import javax.faces.component.UIComponent;
-import javax.faces.component.UIForm;
-import javax.faces.component.UIInput;
-import javax.faces.component.UIViewRoot;
-import javax.faces.component.html.HtmlCommandLink;
-import javax.faces.component.html.HtmlForm;
-import javax.faces.context.FacesContext;
-
-import org.ajax4jsf.framework.ViewHandlerWrapper;
-import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
-import org.richfaces.component.xml.XmlTreeDataBuilder;
-import org.xml.sax.InputSource;
-
-import com.gargoylesoftware.htmlunit.KeyValuePair;
-import com.gargoylesoftware.htmlunit.html.HtmlAnchor;
-import com.gargoylesoftware.htmlunit.html.HtmlInput;
-import com.gargoylesoftware.htmlunit.html.HtmlPage;
-
-/**
- * Unit test for simple Component.
- */
-public class JSFComponentTest
- extends AbstractAjax4JsfTestCase
-{
- private UICommand command = null;
- private UIInput input = null;
- private UIForm form = null;
- private UIComponent tree = null;
-
- /**
- * Create the test case
- *
- * @param testName name of the test case
- */
- public JSFComponentTest( String testName )
- {
- super( testName );
- }
-
- public void setUp() throws Exception {
- super.setUp();
-
- form = new HtmlForm();
-
- facesContext.getViewRoot().getChildren().add(form);
-
- input = new UIInput() {
- public void decode(FacesContext context) {
- // TODO Auto-generated method stub
- super.decode(context);
- }
- };
- input.setId("input");
-
- form.getChildren().add(input);
-
- command = new HtmlCommandLink();
- command.setId("command");
-
- form.getChildren().add(command);
-
- tree = application.createComponent(UITree.COMPONENT_TYPE);
-
- ((UITree) tree).setValue(
- XmlTreeDataBuilder.build(
- new InputSource(
- this.getClass().
- getResourceAsStream("/org/richfaces/component/xml/XmlTreeDataBuilderTest.xml")
- )));
-
- form.getChildren().add(tree);
- ((UITree) tree).queueExpandAll();
- }
-
-
-
- public void tearDown() throws Exception {
- super.tearDown();
-
- this.input = null;
- this.form = null;
- this.command = null;
- this.tree = null;
- }
-
- /**
- * Rigourous Test :-)
- * @throws Exception
- */
- public void testComponent() throws Exception
- {
- HtmlPage renderedView = renderView();
- System.out.println(renderedView.getWebResponse().getContentAsString());
-
- HtmlInput htmlInput = (HtmlInput) renderedView.getHtmlElementById(input.getClientId(facesContext));
- htmlInput.setValueAttribute("testInput");
-
- HtmlAnchor htmlLink = (HtmlAnchor) renderedView.getHtmlElementById(command.getClientId(facesContext));
- htmlLink.click();
-
- List lastParameters = this.webConnection.getLastParameters();
- for (Iterator iterator = lastParameters.iterator(); iterator.hasNext();) {
- KeyValuePair keyValue = (KeyValuePair) iterator.next();
-
- externalContext.addRequestParameterMap((String) keyValue.getKey(), (String) keyValue.getValue());
- }
-
- System.out.println(this.webConnection.getLastParameters());
-
- UIViewRoot root = facesContext.getViewRoot();
- root.processDecodes(facesContext);
- root.processValidators(facesContext);
- root.processUpdates(facesContext);
- root.processApplication(facesContext);
-
- renderedView = renderView();
- System.out.println(renderedView.getWebResponse().getContentAsString());
- }
-
- public void testProcess() {
- }
-}
Copied: trunk/richfaces/tree/src/test/java/org/richfaces/component/TreeComponentTest.java (from rev 265, trunk/richfaces/tree/src/test/java/org/richfaces/component/JSFComponentTest.java)
===================================================================
--- trunk/richfaces/tree/src/test/java/org/richfaces/component/TreeComponentTest.java (rev 0)
+++ trunk/richfaces/tree/src/test/java/org/richfaces/component/TreeComponentTest.java 2007-04-04 12:00:33 UTC (rev 266)
@@ -0,0 +1,150 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces 3.0 - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.component;
+
+import java.io.IOException;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.faces.component.UICommand;
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIForm;
+import javax.faces.component.UIInput;
+import javax.faces.component.UIViewRoot;
+import javax.faces.component.html.HtmlCommandLink;
+import javax.faces.component.html.HtmlForm;
+import javax.faces.context.FacesContext;
+
+import org.ajax4jsf.framework.ViewHandlerWrapper;
+import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
+import org.richfaces.component.xml.XmlTreeDataBuilder;
+import org.xml.sax.InputSource;
+
+import com.gargoylesoftware.htmlunit.KeyValuePair;
+import com.gargoylesoftware.htmlunit.html.HtmlAnchor;
+import com.gargoylesoftware.htmlunit.html.HtmlInput;
+import com.gargoylesoftware.htmlunit.html.HtmlPage;
+
+/**
+ * Unit test for simple Component.
+ */
+public class TreeComponentTest
+ extends AbstractAjax4JsfTestCase
+{
+ private UICommand command = null;
+ private UIInput input = null;
+ private UIForm form = null;
+ private UIComponent tree = null;
+
+ /**
+ * Create the test case
+ *
+ * @param testName name of the test case
+ */
+ public TreeComponentTest( String testName )
+ {
+ super( testName );
+ }
+
+ public void setUp() throws Exception {
+ super.setUp();
+
+ form = new HtmlForm();
+
+ facesContext.getViewRoot().getChildren().add(form);
+
+ input = new UIInput() {
+ public void decode(FacesContext context) {
+ // TODO Auto-generated method stub
+ super.decode(context);
+ }
+ };
+ input.setId("input");
+
+ form.getChildren().add(input);
+
+ command = new HtmlCommandLink();
+ command.setId("command");
+
+ form.getChildren().add(command);
+
+ tree = application.createComponent(UITree.COMPONENT_TYPE);
+
+ ((UITree) tree).setValue(
+ XmlTreeDataBuilder.build(
+ new InputSource(
+ this.getClass().
+ getResourceAsStream("/org/richfaces/component/xml/XmlTreeDataBuilderTest.xml")
+ )));
+
+ form.getChildren().add(tree);
+ ((UITree) tree).queueExpandAll();
+ }
+
+
+
+ public void tearDown() throws Exception {
+ super.tearDown();
+
+ this.input = null;
+ this.form = null;
+ this.command = null;
+ this.tree = null;
+ }
+
+ /**
+ * Rigourous Test :-)
+ * @throws Exception
+ */
+ public void testComponent() throws Exception
+ {
+ HtmlPage renderedView = renderView();
+ System.out.println(renderedView.getWebResponse().getContentAsString());
+
+ HtmlInput htmlInput = (HtmlInput) renderedView.getHtmlElementById(input.getClientId(facesContext));
+ htmlInput.setValueAttribute("testInput");
+
+ HtmlAnchor htmlLink = (HtmlAnchor) renderedView.getHtmlElementById(command.getClientId(facesContext));
+ htmlLink.click();
+
+ List lastParameters = this.webConnection.getLastParameters();
+ for (Iterator iterator = lastParameters.iterator(); iterator.hasNext();) {
+ KeyValuePair keyValue = (KeyValuePair) iterator.next();
+
+ externalContext.addRequestParameterMap((String) keyValue.getKey(), (String) keyValue.getValue());
+ }
+
+ System.out.println(this.webConnection.getLastParameters());
+
+ UIViewRoot root = facesContext.getViewRoot();
+ root.processDecodes(facesContext);
+ root.processValidators(facesContext);
+ root.processUpdates(facesContext);
+ root.processApplication(facesContext);
+
+ renderedView = renderView();
+ System.out.println(renderedView.getWebResponse().getContentAsString());
+ }
+
+ public void testProcess() {
+ }
+}
17 years, 9 months
JBoss Rich Faces SVN: r265 - trunk/richfaces/tree/src/test/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-04-04 07:57:57 -0400 (Wed, 04 Apr 2007)
New Revision: 265
Modified:
trunk/richfaces/tree/src/test/java/org/richfaces/component/JSFComponentTest.java
Log:
MockViewHandler moved to superclass
Modified: trunk/richfaces/tree/src/test/java/org/richfaces/component/JSFComponentTest.java
===================================================================
--- trunk/richfaces/tree/src/test/java/org/richfaces/component/JSFComponentTest.java 2007-04-04 10:41:04 UTC (rev 264)
+++ trunk/richfaces/tree/src/test/java/org/richfaces/component/JSFComponentTest.java 2007-04-04 11:57:57 UTC (rev 265)
@@ -87,32 +87,6 @@
form.getChildren().add(command);
- application.setViewHandler(new ViewHandlerWrapper(application.getViewHandler()) {
- public void writeState(FacesContext context) throws IOException {
- //System.out.println(".writeState()");
- }
-
- public String getResourceURL(FacesContext context, String url) {
- // TODO Auto-generated method stub
- return url;
- }
-
- public String getActionURL(FacesContext context, String url) {
- // TODO Auto-generated method stub
- return url;
- }
-
- public UIViewRoot restoreView(FacesContext context, String viewId) {
- // TODO Auto-generated method stub
- return super.restoreView(context, viewId);
- }
-
- public UIViewRoot createView(FacesContext context, String viewId) {
- // TODO Auto-generated method stub
- return super.createView(context, viewId);
- }
- });
-
tree = application.createComponent(UITree.COMPONENT_TYPE);
((UITree) tree).setValue(
17 years, 9 months
JBoss Rich Faces SVN: r264 - trunk/richfaces/dropdown-menu/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: d.bulahov
Date: 2007-04-04 06:41:04 -0400 (Wed, 04 Apr 2007)
New Revision: 264
Modified:
trunk/richfaces/dropdown-menu/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js
Log:
add onitemselect event
Modified: trunk/richfaces/dropdown-menu/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js
===================================================================
--- trunk/richfaces/dropdown-menu/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js 2007-04-04 10:23:27 UTC (rev 263)
+++ trunk/richfaces/dropdown-menu/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js 2007-04-04 10:41:04 UTC (rev 264)
@@ -786,6 +786,15 @@
var onmouseclick =
function(e){
+
+ var menuLayer = item.menu;
+ //if (menuLayer.level>0) {
+ while (menuLayer.level > 0) {
+ menuLayer = Exadel.Menu.Layers.layers[(Exadel.Menu.Layers.father[menuLayer.id])];
+ }
+ if (menuLayer && menuLayer.eventOnItemSelect) menuLayer.eventOnItemSelect();
+ //}
+
Exadel.Menu.Layers.shutdown();
}.bindAsEventListener(item);
@@ -825,7 +834,9 @@
if (this.options.ongroupactivate != ""){
this.eventOnGroupActivate = new Function("event",this.options.ongroupactivate).bindAsEventListener(this);
}
-
+ if (this.options.onitemselect != ""){
+ this.eventOnItemSelect = new Function("event",options.onitemselect).bindAsEventListener(this);
+ }
if (this.options.oncollapse != ""){
this.eventOnCollapse = new Function("event",this.options.oncollapse).bindAsEventListener(this);
}
17 years, 9 months
JBoss Rich Faces SVN: r263 - trunk/richfaces/dropdown-menu/src/main/java/org/richfaces/renderkit/html.
by richfaces-svn-commits@lists.jboss.org
Author: a.izobov
Date: 2007-04-04 06:23:27 -0400 (Wed, 04 Apr 2007)
New Revision: 263
Modified:
trunk/richfaces/dropdown-menu/src/main/java/org/richfaces/renderkit/html/DropDownMenuRendererBase.java
Log:
passing attribute "direction" to script added
Modified: trunk/richfaces/dropdown-menu/src/main/java/org/richfaces/renderkit/html/DropDownMenuRendererBase.java
===================================================================
--- trunk/richfaces/dropdown-menu/src/main/java/org/richfaces/renderkit/html/DropDownMenuRendererBase.java 2007-04-04 09:42:21 UTC (rev 262)
+++ trunk/richfaces/dropdown-menu/src/main/java/org/richfaces/renderkit/html/DropDownMenuRendererBase.java 2007-04-04 10:23:27 UTC (rev 263)
@@ -153,6 +153,7 @@
ScriptOptions Optionssub = new ScriptOptions(component);
Optionssub.addOption("onopen", component.getAttributes().get("onopen"));
Optionssub.addOption("onclose", component.getAttributes().get("onclose"));
+ Optionssub.addOption("direction", component.getAttributes().get("direction"));
function.addParameter(Optionssub);
function.appendScript(buffer);
17 years, 9 months
JBoss Rich Faces SVN: r262 - trunk/richfaces/dropdown-menu/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: a.izobov
Date: 2007-04-04 05:42:21 -0400 (Wed, 04 Apr 2007)
New Revision: 262
Modified:
trunk/richfaces/dropdown-menu/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js
Log:
ongroupactivate event support for dropdownmenu added
Modified: trunk/richfaces/dropdown-menu/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js
===================================================================
--- trunk/richfaces/dropdown-menu/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js 2007-04-04 09:28:33 UTC (rev 261)
+++ trunk/richfaces/dropdown-menu/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js 2007-04-04 09:42:21 UTC (rev 262)
@@ -108,6 +108,13 @@
var menuLayer = this.layers[menu.id];
if (menuLayer && menuLayer.eventOnOpen) menuLayer.eventOnOpen();
if (menuLayer && menuLayer.eventOnExpand) menuLayer.eventOnExpand();
+
+ if (menuLayer.level>0) {
+ do {
+ menuLayer = this.layers[(this.father[menuLayer.id])];
+ } while (menuLayer.level > 0)
+ if (menuLayer && menuLayer.eventOnGroupActivate) menuLayer.eventOnGroupActivate();
+ }
}
},
@@ -815,7 +822,9 @@
},
asDropDown: function(topLevel, onEvt, offEvt, options){
this.options = options || {};
-
+ if (this.options.ongroupactivate != ""){
+ this.eventOnGroupActivate = new Function("event",this.options.ongroupactivate).bindAsEventListener(this);
+ }
if (this.options.oncollapse != ""){
this.eventOnCollapse = new Function("event",this.options.oncollapse).bindAsEventListener(this);
@@ -823,7 +832,7 @@
if (this.options.onexpand != ""){
this.eventOnExpand = new Function("event",this.options.onexpand).bindAsEventListener(this);
}
-
+
// if($(topLevel)){ CH-1518
var onmouseover = function(e){
if (!e) {
17 years, 9 months
JBoss Rich Faces SVN: r261 - trunk/richfaces/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: A.Skokov
Date: 2007-04-04 05:28:33 -0400 (Wed, 04 Apr 2007)
New Revision: 261
Modified:
trunk/richfaces/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/suggestionbox.js
Log:
https://jira.exadel.com/browse/RFA-337 fixed
Modified: trunk/richfaces/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/suggestionbox.js
===================================================================
--- trunk/richfaces/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/suggestionbox.js 2007-04-04 09:03:05 UTC (rev 260)
+++ trunk/richfaces/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/suggestionbox.js 2007-04-04 09:28:33 UTC (rev 261)
@@ -71,7 +71,7 @@
this.onKeyPressListener = this.onKeyPress.bindAsEventListener(this);
Event.observe(this.element, "keypress", this.onKeyPressListener);
-
+
if (this.isOpera) {
this.onKeyUpListener = this.onKeyUp.bindAsEventListener(this);
Event.observe(this.element, "keyup", this.onKeyUpListener);
@@ -94,7 +94,7 @@
cancelSubmit: function(event) {
Event.stop(event);
},
-
+
disableSubmit: function() {
if (this.isOpera) {
var el = this.element;
@@ -107,7 +107,7 @@
}
}
},
-
+
enableSubmit: function() {
if (this.isOpera) {
if (this.parentForm) {
@@ -192,7 +192,7 @@
this.upDown = 1;
this.prevOnKeyPress = this.element.onkeypress;
this.element.onkeypress = this.onBoxKeyPress.bindAsEventListener(this);
- }
+ }
return;
case Event.KEY_DOWN:
this.keyEvent = true;
@@ -203,7 +203,7 @@
this.upDown = 2;
this.prevOnKeyPress = this.element.onkeypress;
this.element.onkeypress = this.onBoxKeyPress.bindAsEventListener(this);
- }
+ }
return;
}
else
@@ -263,6 +263,7 @@
onBlur: function(event) {
if (this.isUnloaded()) return;
+ if (!this.active) return;
var offsets = Exadel.Position.calcOffsets(this.update);
if (RichFaces.navigatorType() != "MSIE") {
offsets["x"] = 0;
@@ -564,7 +565,7 @@
left += parent.offsetLeft;
top += parent.offsetTop;
}
-
+
ret["x"] = left;
ret["y"] = top + element.clientHeight;
17 years, 9 months
JBoss Rich Faces SVN: r260 - trunk/richfaces/dropdown-menu/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: d.bulahov
Date: 2007-04-04 05:03:05 -0400 (Wed, 04 Apr 2007)
New Revision: 260
Modified:
trunk/richfaces/dropdown-menu/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js
Log:
add onexpand and oncollapse on dropDownMenu
Modified: trunk/richfaces/dropdown-menu/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js
===================================================================
--- trunk/richfaces/dropdown-menu/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js 2007-04-04 08:00:46 UTC (rev 259)
+++ trunk/richfaces/dropdown-menu/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js 2007-04-04 09:03:05 UTC (rev 260)
@@ -103,9 +103,11 @@
if (visible && !visibleFlag) {
var menuLayer = this.layers[menu.id];
if (menuLayer && menuLayer.eventOnClose) menuLayer.eventOnClose();
+ if (menuLayer && menuLayer.eventOnCollapse) menuLayer.eventOnCollapse();
} else if (!visible && visibleFlag) {
var menuLayer = this.layers[menu.id];
if (menuLayer && menuLayer.eventOnOpen) menuLayer.eventOnOpen();
+ if (menuLayer && menuLayer.eventOnExpand) menuLayer.eventOnExpand();
}
},
@@ -813,6 +815,15 @@
},
asDropDown: function(topLevel, onEvt, offEvt, options){
this.options = options || {};
+
+
+ if (this.options.oncollapse != ""){
+ this.eventOnCollapse = new Function("event",this.options.oncollapse).bindAsEventListener(this);
+ }
+ if (this.options.onexpand != ""){
+ this.eventOnExpand = new Function("event",this.options.onexpand).bindAsEventListener(this);
+ }
+
// if($(topLevel)){ CH-1518
var onmouseover = function(e){
if (!e) {
17 years, 9 months
JBoss Rich Faces SVN: r259 - trunk/richfaces/dropdown-menu/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: a.izobov
Date: 2007-04-04 04:00:46 -0400 (Wed, 04 Apr 2007)
New Revision: 259
Modified:
trunk/richfaces/dropdown-menu/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js
Log:
event support(onclose, onopen) for menuGroup changed
Modified: trunk/richfaces/dropdown-menu/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js
===================================================================
--- trunk/richfaces/dropdown-menu/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js 2007-04-04 07:33:14 UTC (rev 258)
+++ trunk/richfaces/dropdown-menu/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js 2007-04-04 08:00:46 UTC (rev 259)
@@ -95,9 +95,18 @@
return;
}
this.detectWidth();
- Exadel.Menu.fitLayerToContent($(menuName));
+ var menu = $(menuName);
+ Exadel.Menu.fitLayerToContent(menu);
+ var visible = this.isVisible(menuName);
this.setVisibility(menuName, visibleFlag);
this.ieSelectWorkAround(menuName, visibleFlag);
+ if (visible && !visibleFlag) {
+ var menuLayer = this.layers[menu.id];
+ if (menuLayer && menuLayer.eventOnClose) menuLayer.eventOnClose();
+ } else if (!visible && visibleFlag) {
+ var menuLayer = this.layers[menu.id];
+ if (menuLayer && menuLayer.eventOnOpen) menuLayer.eventOnOpen();
+ }
},
ieSelectWorkAround: function(menuName, on){
@@ -710,7 +719,7 @@
//LOG.a4j_debug('show me ' + this.id +' ' +this.level);
Exadel.Menu.Layers.showMenuLayer(this.id, e, this.delay);
Exadel.Menu.Layers.levels[this.level] = this;
- if (this.eventOnOpen) this.eventOnOpen();
+// if (this.eventOnOpen) this.eventOnOpen();
},
closeSiblings: function(e){
@@ -800,7 +809,7 @@
Exadel.Menu.Layers.clearPopUpTO();
Exadel.Menu.Layers.levels[this.level] = null;
Exadel.Menu.Layers.LMPopUpL(this.id, false);
- if (this.eventOnClose) this.eventOnClose();
+// if (this.eventOnClose) this.eventOnClose();
},
asDropDown: function(topLevel, onEvt, offEvt, options){
this.options = options || {};
17 years, 9 months