JBoss Rich Faces SVN: r4454 - in branches/3.1.x/test-applications/facelets/src/main: java/rich and 8 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: ayanul
Date: 2007-12-04 11:32:27 -0500 (Tue, 04 Dec 2007)
New Revision: 4454
Added:
branches/3.1.x/test-applications/facelets/src/main/java/orderingList/OrderingListConverter.java
Modified:
branches/3.1.x/test-applications/facelets/src/main/java/rich/RichBean.java
branches/3.1.x/test-applications/facelets/src/main/java/util/data/Data.java
branches/3.1.x/test-applications/facelets/src/main/webapp/ComponentControl/ComponentControl.xhtml
branches/3.1.x/test-applications/facelets/src/main/webapp/ListShuttle/ListShuttle.xhtml
branches/3.1.x/test-applications/facelets/src/main/webapp/ListShuttle/ListShuttleStraightforward.xhtml
branches/3.1.x/test-applications/facelets/src/main/webapp/OrderingList/OrderingList.xhtml
branches/3.1.x/test-applications/facelets/src/main/webapp/PanelMenu/PanelMenu.xhtml
branches/3.1.x/test-applications/facelets/src/main/webapp/PanelMenu/PanelMenuProperty.xhtml
branches/3.1.x/test-applications/facelets/src/main/webapp/Tooltip/TooltipStraightforward.xhtml
branches/3.1.x/test-applications/facelets/src/main/webapp/WEB-INF/faces-config-DataOrderedList.xml
branches/3.1.x/test-applications/facelets/src/main/webapp/WEB-INF/faces-config-OrderingList.xml
branches/3.1.x/test-applications/facelets/src/main/webapp/pages/Rich/Rich.xhtml
Log:
Added: branches/3.1.x/test-applications/facelets/src/main/java/orderingList/OrderingListConverter.java
===================================================================
--- branches/3.1.x/test-applications/facelets/src/main/java/orderingList/OrderingListConverter.java (rev 0)
+++ branches/3.1.x/test-applications/facelets/src/main/java/orderingList/OrderingListConverter.java 2007-12-04 16:32:27 UTC (rev 4454)
@@ -0,0 +1,33 @@
+package orderingList;
+import java.util.ArrayList;
+import java.util.StringTokenizer;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.convert.Converter;
+
+import util.data.Data;
+
+public class OrderingListConverter implements Converter {
+
+ public Object getAsObject(FacesContext arg0, UIComponent arg1, String arg2) {
+ String [] str = arg2.split(":");
+ return new Data(Integer.parseInt(str[0]), str[1], str[2], str[3],str[4]);
+ }
+//list.add(new Data(i, "Button " + i, "Link " + i, "select" +(i % 5), statusIcon[i % 5]));
+ public String getAsString(FacesContext arg0, UIComponent arg1, Object arg2) {
+ Data data = (Data)arg2;
+ return data.getInt0() + ":" + data.getStr0() + ":" + data.getStr1() + ":" + data.getStr2() + ":" + data.getStr3();
+ }
+
+}
+// public Object getAsObject(FacesContext context, UIComponent component,
+// String value) {
+// int index = value.indexOf(':');
+// return new OptionItem(value.substring(0, index), Integer.valueOf(value.substring(index + 1)));
+// }
+// public String getAsString(FacesContext context, UIComponent component,
+// Object value) {
+// OptionItem optionItem = (OptionItem) value;
+// return optionItem.getName() + ":" + optionItem.getPrice();
+// }
Modified: branches/3.1.x/test-applications/facelets/src/main/java/rich/RichBean.java
===================================================================
--- branches/3.1.x/test-applications/facelets/src/main/java/rich/RichBean.java 2007-12-04 16:26:51 UTC (rev 4453)
+++ branches/3.1.x/test-applications/facelets/src/main/java/rich/RichBean.java 2007-12-04 16:32:27 UTC (rev 4454)
@@ -2,7 +2,10 @@
import java.util.ArrayList;
+import org.richfaces.VersionBean;
+
public class RichBean {
+ private String version = VersionBean.SCM_REVISION;
private String src;
private MapComponent map;
private boolean reComponent;
@@ -106,4 +109,12 @@
public void setReStraightforward(boolean reStraightforward) {
this.reStraightforward = reStraightforward;
}
+
+ public String getVersion() {
+ return version;
+ }
+
+ public void setVersion(String version) {
+ this.version = version;
+ }
}
Modified: branches/3.1.x/test-applications/facelets/src/main/java/util/data/Data.java
===================================================================
--- branches/3.1.x/test-applications/facelets/src/main/java/util/data/Data.java 2007-12-04 16:26:51 UTC (rev 4453)
+++ branches/3.1.x/test-applications/facelets/src/main/java/util/data/Data.java 2007-12-04 16:32:27 UTC (rev 4454)
@@ -32,7 +32,6 @@
public Data(String str0, String str1, String str2, String str3, int int0,
int int1, int int2, int int3, boolean bool0, boolean bool1,
boolean bool2, boolean bool3) {
- super();
this.str0 = str0;
this.str1 = str1;
this.str2 = str2;
Modified: branches/3.1.x/test-applications/facelets/src/main/webapp/ComponentControl/ComponentControl.xhtml
===================================================================
--- branches/3.1.x/test-applications/facelets/src/main/webapp/ComponentControl/ComponentControl.xhtml 2007-12-04 16:26:51 UTC (rev 4453)
+++ branches/3.1.x/test-applications/facelets/src/main/webapp/ComponentControl/ComponentControl.xhtml 2007-12-04 16:32:27 UTC (rev 4454)
@@ -1,23 +1,62 @@
<f:subview id="componentControlSubviewID" xmlns:a4j="http://richfaces.org/a4j" xmlns:f="http://java.sun.com/jsf/core"
- xmlns:h="http://java.sun.com/jsf/html" xmlns:rich="http://richfaces.org/rich">
+ xmlns:h="http://java.sun.com/jsf/html" xmlns:rich="http://richfaces.org/rich" xmlns:ui="http://java.sun.com/jsf/facelets">
+ <h:form>
+ <rich:modalPanel id="ccModalPanelID" onshow="alert(event.parameters.show)" onhide="alert(event.parameters.hide)">
+ <h:outputLink id="hideButton1ID" onclick="return false;" value="Close" ><f:verbatim>Close 1</f:verbatim></h:outputLink>
+ <f:verbatim><br/></f:verbatim>
+ <h:outputLink id="hideButton2ID" onclick="return false;" value="Close" ><f:verbatim>Close 2</f:verbatim></h:outputLink>
+ </rich:modalPanel>
- <rich:modalPanel id="ccModalPanelID" onshow="alert(event.parameters.show)" onhide="alert(event.parameters.hide)">
- <h:outputLink id="hideButtonID" onclick="Richfaces.hideModalPanel('ccModalPanelID');return false;" value="Close"/>
- </rich:modalPanel>
+ <h:commandButton id="showButtonID" value="show" >
+ <rich:componentControl for="ccModalPanelID" event="onclick" operation="show" params="show:'componentControl work(show)'" />
+ </h:commandButton>
+ <rich:componentControl attachTo="hideButton1ID, hideButton2ID" event="onclick" for="ccModalPanelID" operation="hide" params="hide:'componentControl work(hide)'" />
+
+ <f:verbatim><br/><br/></f:verbatim>
+
+ <rich:panelMenu id="ccPanelMenuID" mode="client">
+ <rich:panelMenuGroup label="group1">
+ <rich:panelMenuGroup label="group1 1">
+ <rich:panelMenuItem label="Item 1 1"></rich:panelMenuItem>
+ <rich:panelMenuItem label="Item 1 2"></rich:panelMenuItem>
+ </rich:panelMenuGroup>
+ <rich:panelMenuItem label="Item 1"></rich:panelMenuItem>
+ <rich:panelMenuItem label="Item 2"></rich:panelMenuItem>
+ </rich:panelMenuGroup>
+ </rich:panelMenu>
+
+ <rich:componentControl attachTo="testPMID" for="ccPanelMenuID" event="onclick" operation="doCollapse"/>
- <h:commandButton id="showButtonID" onclick="Richfaces.showModalPanel('ccModalPanelID');" value="show" ></h:commandButton>
+ <a href="#" id="testPMID" onclick="return false;">Click text</a>
+ <f:verbatim><br/><br/></f:verbatim>
+
+ <rich:componentControl attachTo="testCID" for="cc" event="onclick" operation="doExpand" params="show:'componentControl work(show)'"/>
+ <rich:calendar popup="true" id="cc"/>
- <rich:componentControl attachTo="showButtonID" for="ccModalPanelID" operation="show" params="show:'componentControl work(show)'">
- <f:param name="mPanelParam" value="show"/>
- </rich:componentControl>
- <rich:componentControl attachTo="hideButtonID" for="ccModalPanelID" operation="hide" params="hide:'componentControl work(hide)'">
- <f:param name="mPanelParam" value="hide" />
- </rich:componentControl>
- <rich:contextMenu submitMode="server" id="ccContextMenuID">
- <rich:menuItem value="Item 1"></rich:menuItem>
- <rich:menuItem value="Item 2"></rich:menuItem>
- <rich:menuItem value="Item 3"></rich:menuItem>
- </rich:contextMenu>
-
+ <a href="#" id="testCID">Click text</a>
+ <f:verbatim><br/><br/></f:verbatim>
+ <a onclick="$('componentControlSubviewID:_id0:cc').component.doExpand()" href="#">Show</a>
+
+ <rich:panelMenu id="ccPanelMenu">
+ <h:outputText value="click text" />
+ </rich:panelMenu>
+
+ <rich:contextMenu id="ccContextMenu" submitMode="ajax">
+ <rich:menuItem icon="/pics/header.png" value="tab1" reRender="cmInfoID">
+ <f:param name="cmdParam" value="menu" />
+ </rich:menuItem>
+ <rich:menuSeparator />
+ <rich:menuItem icon="/pics/info.gif" value="a" reRender="cmInfoID">
+ <f:param name="cmdParam" value="a" />
+ </rich:menuItem>
+ <rich:menuItem icon="/pics/info.gif" value=" b" reRender="cmInfoID">
+ <f:param name="cmdParam" value="b" />
+ </rich:menuItem>
+ <rich:menuItem icon="/pics/info.gif" value="c" reRender="cmInfoID">
+ <f:param name="cmdParam" value="c" />
+ </rich:menuItem>
+ </rich:contextMenu>
+ <rich:componentControl event="oncontextmenu" attachTo="ccPanelMenu" for="ccContextMenu" operation="doShow"/>
+ </h:form>
</f:subview>
\ No newline at end of file
Modified: branches/3.1.x/test-applications/facelets/src/main/webapp/ListShuttle/ListShuttle.xhtml
===================================================================
--- branches/3.1.x/test-applications/facelets/src/main/webapp/ListShuttle/ListShuttle.xhtml 2007-12-04 16:26:51 UTC (rev 4453)
+++ branches/3.1.x/test-applications/facelets/src/main/webapp/ListShuttle/ListShuttle.xhtml 2007-12-04 16:32:27 UTC (rev 4454)
@@ -3,7 +3,7 @@
<rich:listShuttle id="listShuttleID" var="item" sourceValue="#{listShuttle.sourceValue}" targetValue="#{listShuttle.targetValue}"
bottomControlLabel="#{listShuttle.bottomControlLabel}" copyAllControlLabel="#{listShuttle.copyAllControlLabel}"
copyControlLabel="#{listShuttle.copyControlLabel}" downControlLabel="#{listShuttle.downControlLabel}"
- fastMoveControlsVisible="#{listShuttle.fastMoveControlsVisible}"
+ fastMoveControlsVisible="#{listShuttle.fastMoveControlsVisible}" converter="orderingListConverter"
fastOrderControlsVisible="#{listShuttle.fastOrderControlsVisible}" first="#{listShuttle.first}"
moveControlsVisible="#{listShuttle.moveControlsVisible}" orderControlsVisible="#{listShuttle.orderControlsVisible}"
removeAllControlLabel="#{listShuttle.removeAllControlLabel}" removeControlLabel="#{listShuttle.removeControlLabel}"
Modified: branches/3.1.x/test-applications/facelets/src/main/webapp/ListShuttle/ListShuttleStraightforward.xhtml
===================================================================
--- branches/3.1.x/test-applications/facelets/src/main/webapp/ListShuttle/ListShuttleStraightforward.xhtml 2007-12-04 16:26:51 UTC (rev 4453)
+++ branches/3.1.x/test-applications/facelets/src/main/webapp/ListShuttle/ListShuttleStraightforward.xhtml 2007-12-04 16:32:27 UTC (rev 4454)
@@ -33,7 +33,7 @@
<h:outputText value="#{allInfo.str0}" />
</h:column>
- <h:column width="100px">
+ <h:column>
<f:facet name="header">
<h:outputText value="Button" />
</f:facet>
@@ -83,7 +83,7 @@
</h:column>
<h:column>
<h:dataTable id="allInfoLSTargetID" value="#{listShuttle.targetValue}" var="allInfo" rendered="#{listShuttle.showAllTargetData}" border="1">
- <h:column width="100px">
+ <h:column>
<f:facet name="header">
<h:outputText value="Number" />
</f:facet>
Modified: branches/3.1.x/test-applications/facelets/src/main/webapp/OrderingList/OrderingList.xhtml
===================================================================
--- branches/3.1.x/test-applications/facelets/src/main/webapp/OrderingList/OrderingList.xhtml 2007-12-04 16:26:51 UTC (rev 4453)
+++ branches/3.1.x/test-applications/facelets/src/main/webapp/OrderingList/OrderingList.xhtml 2007-12-04 16:32:27 UTC (rev 4454)
@@ -1,10 +1,14 @@
<f:subview id="orderingListSubviewID" xmlns:a4j="http://richfaces.org/a4j" xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html" xmlns:rich="http://richfaces.org/rich" xmlns:ui="http://java.sun.com/jsf/facelets">
- <h:messages showDetail="true" />
+ <a4j:log popup="false"/>
+ <a4j:outputPanel ajaxRendered="true">
+ <h:messages />
+ </a4j:outputPanel>
+
<rich:orderingList id="orderingListID" value="#{orderingList.list}" var="item" listHeight="#{orderingList.listHeight}"
- listWidth="#{orderingList.listWidth}" controlsType="#{orderingList.controlsType}"
+ listWidth="#{orderingList.listWidth}" controlsType="#{orderingList.controlsType}" converter="orderingListConverter"
bottomControlLabel="#{orderingList.bottomControlLabel}" captionLabel="#{orderingList.captionLabel}"
topControlLabel="#{orderingList.topControlLabel}" upControlLabel="#{orderingList.upControlLabel}"
controlsHorizontalAlign="#{orderingList.controlsHorizontalAlign}" controlsVerticalAlign="#{orderingList.controlsVerticalAlign}"
Modified: branches/3.1.x/test-applications/facelets/src/main/webapp/PanelMenu/PanelMenu.xhtml
===================================================================
--- branches/3.1.x/test-applications/facelets/src/main/webapp/PanelMenu/PanelMenu.xhtml 2007-12-04 16:26:51 UTC (rev 4453)
+++ branches/3.1.x/test-applications/facelets/src/main/webapp/PanelMenu/PanelMenu.xhtml 2007-12-04 16:32:27 UTC (rev 4454)
@@ -36,7 +36,7 @@
</rich:panelMenuItem>
<rich:panelMenuItem label="Action" onmousedown="alert('OnMouseDown');"></rich:panelMenuItem>
- <rich:panelMenuGroup label="Group 1 (align)" align="#{panelMenu.align}">
+ <rich:panelMenuGroup label="Group 1">
<rich:panelMenuItem label="Item 1" disabled="true"></rich:panelMenuItem>
<rich:panelMenuItem label="Item 1 (action)" onmousedown="alert('OnMouseDown');"></rich:panelMenuItem>
<rich:panelMenuItem label="Item 2"></rich:panelMenuItem>
@@ -48,7 +48,7 @@
<rich:panelMenuItem label="Item 1_2"></rich:panelMenuItem>
- <rich:panelMenuGroup label="Group 1_1_1 (align)" align="#{panelMenu.align}">
+ <rich:panelMenuGroup label="Group 1_1_1">
<rich:panelMenuItem label="Item 1 (action)" onmousedown="alert('OnMouseDown');"></rich:panelMenuItem>
<rich:panelMenuItem label="Item 2"></rich:panelMenuItem>
</rich:panelMenuGroup>
Modified: branches/3.1.x/test-applications/facelets/src/main/webapp/PanelMenu/PanelMenuProperty.xhtml
===================================================================
--- branches/3.1.x/test-applications/facelets/src/main/webapp/PanelMenu/PanelMenuProperty.xhtml 2007-12-04 16:26:51 UTC (rev 4453)
+++ branches/3.1.x/test-applications/facelets/src/main/webapp/PanelMenu/PanelMenuProperty.xhtml 2007-12-04 16:32:27 UTC (rev 4454)
@@ -35,16 +35,6 @@
<f:selectItem itemLabel="server" itemValue="server" />
</h:selectOneRadio>
- <h:outputText value="Align:"></h:outputText>
- <h:selectOneMenu value="#{panelMenu.align}">
- <f:selectItem itemLabel="left" itemValue="left" />
- <f:selectItem itemLabel="middle" itemValue="middle" />
- <f:selectItem itemLabel="right" itemValue="right" />
- <f:selectItem itemLabel="bottom" itemValue="bottom" />
- <f:selectItem itemLabel="top" itemValue="top" />
- <a4j:support event="onclick" reRender="panelMenuID,panelMenuID2,info"></a4j:support>
- </h:selectOneMenu>
-
<h:outputText value="Disabled"></h:outputText>
<h:selectBooleanCheckbox value="#{panelMenu.disabled}">
<a4j:support event="onchange" reRender="panelMenuID,panelMenuID2,info"></a4j:support>
Modified: branches/3.1.x/test-applications/facelets/src/main/webapp/Tooltip/TooltipStraightforward.xhtml
===================================================================
--- branches/3.1.x/test-applications/facelets/src/main/webapp/Tooltip/TooltipStraightforward.xhtml 2007-12-04 16:26:51 UTC (rev 4453)
+++ branches/3.1.x/test-applications/facelets/src/main/webapp/Tooltip/TooltipStraightforward.xhtml 2007-12-04 16:32:27 UTC (rev 4454)
@@ -5,7 +5,7 @@
xmlns:rich="http://richfaces.org/rich"
xmlns:ui="http://java.sun.com/jsf/facelets">
<rich:simpleTogglePanel id="toolTipStraightforwardID" switchType="client" opened="true" label="toolTip straightforward">
- <h:panelGrid columns="2">
+ <h:panelGrid columns="3">
<h:outputText value="Test1" />
<a4j:commandButton action="#{tooltip.bTest1}" value="run" reRender="tooltipID,toolTipPropertyID"></a4j:commandButton>
<h:outputText value="#{msg.t1Tooltip}"/>
Modified: branches/3.1.x/test-applications/facelets/src/main/webapp/WEB-INF/faces-config-DataOrderedList.xml
===================================================================
--- branches/3.1.x/test-applications/facelets/src/main/webapp/WEB-INF/faces-config-DataOrderedList.xml 2007-12-04 16:26:51 UTC (rev 4453)
+++ branches/3.1.x/test-applications/facelets/src/main/webapp/WEB-INF/faces-config-DataOrderedList.xml 2007-12-04 16:32:27 UTC (rev 4454)
@@ -2,9 +2,9 @@
<!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
"http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
<faces-config>
- <managed-bean>
- <managed-bean-name>dataOrderedList</managed-bean-name>
- <managed-bean-class>dataOrderedList.DataOrderedList</managed-bean-class>
- <managed-bean-scope>session</managed-bean-scope>
- </managed-bean>
+ <managed-bean>
+ <managed-bean-name>dataOrderedList</managed-bean-name>
+ <managed-bean-class>dataOrderedList.DataOrderedList</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
</faces-config>
Modified: branches/3.1.x/test-applications/facelets/src/main/webapp/WEB-INF/faces-config-OrderingList.xml
===================================================================
--- branches/3.1.x/test-applications/facelets/src/main/webapp/WEB-INF/faces-config-OrderingList.xml 2007-12-04 16:26:51 UTC (rev 4453)
+++ branches/3.1.x/test-applications/facelets/src/main/webapp/WEB-INF/faces-config-OrderingList.xml 2007-12-04 16:32:27 UTC (rev 4454)
@@ -2,6 +2,10 @@
<!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"
"http://java.sun.com/dtd/web-facesconfig_1_0.dtd">
<faces-config>
+ <converter>
+ <converter-id>orderingListConverter</converter-id>
+ <converter-class>orderingList.OrderingListConverter</converter-class>
+ </converter>
<managed-bean>
<managed-bean-name>orderingList</managed-bean-name>
<managed-bean-class>orderingList.OrderingList</managed-bean-class>
Modified: branches/3.1.x/test-applications/facelets/src/main/webapp/pages/Rich/Rich.xhtml
===================================================================
--- branches/3.1.x/test-applications/facelets/src/main/webapp/pages/Rich/Rich.xhtml 2007-12-04 16:26:51 UTC (rev 4453)
+++ branches/3.1.x/test-applications/facelets/src/main/webapp/pages/Rich/Rich.xhtml 2007-12-04 16:32:27 UTC (rev 4454)
@@ -11,15 +11,10 @@
var oldObject = window.document.getElementById(elementID);
if(oldObject == null || oldObject.type == "text") return;
var newObject = window.document.createElement('input');
- newObject.type = "text";
- newObject.size = oldObject.size;
- newObject.value = value;
- newObject.id = oldObject.id;
- //if(oldObject.size) newObject.size = oldObject.size;
- //if(oldObject.value) newObject.value = value;
- //if(oldObject.id) newObject.id = oldObject.id;
- //if(oldObject.name) newObject.name = oldObject.name;
- //if(oldObject.className) newObject.className = oldObject.className;
+ if(oldObject.type) newObject.type = "text";
+ if(oldObject.size) newObject.size = oldObject.size;
+ if(oldObject.value) newObject.value = value;
+ if(oldObject.id) newObject.id = oldObject.id;
oldObject.parentNode.replaceChild(newObject,oldObject);
}
</script>
16 years, 6 months
JBoss Rich Faces SVN: r4453 - in branches/3.1.x/samples/richfaces-demo/src/main/webapp/richfaces/contextMenu: example and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2007-12-04 11:26:51 -0500 (Tue, 04 Dec 2007)
New Revision: 4453
Added:
branches/3.1.x/samples/richfaces-demo/src/main/webapp/richfaces/contextMenu/example/
branches/3.1.x/samples/richfaces-demo/src/main/webapp/richfaces/contextMenu/example/menu.xhtml
branches/3.1.x/samples/richfaces-demo/src/main/webapp/richfaces/contextMenu/usage.xhtml
Log:
http://jira.jboss.com/jira/browse/RF-1496
Added: branches/3.1.x/samples/richfaces-demo/src/main/webapp/richfaces/contextMenu/example/menu.xhtml
===================================================================
--- branches/3.1.x/samples/richfaces-demo/src/main/webapp/richfaces/contextMenu/example/menu.xhtml (rev 0)
+++ branches/3.1.x/samples/richfaces-demo/src/main/webapp/richfaces/contextMenu/example/menu.xhtml 2007-12-04 16:26:51 UTC (rev 4453)
@@ -0,0 +1,59 @@
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich">
+
+ <h:form id="form">
+ <rich:contextMenu attached="false" id="menu" submitMode="ajax">
+ <rich:menuItem value="Show Details">
+ <a4j:actionparam name="current" value="Show Details" assignTo="#{ddmenu.current}"/>
+ </rich:menuItem>
+ <rich:menuGroup value="Actions">
+ <rich:menuItem value="Put To Basket">
+ <a4j:actionparam name="current" value="Put To Basket" assignTo="#{ddmenu.current}"/>
+ </rich:menuItem>
+ <rich:menuItem value="Read Comments">
+ <a4j:actionparam name="current" value="Read Comments" assignTo="#{ddmenu.current}"/>
+ </rich:menuItem>
+ <rich:menuItem value="Go to {car} {model} site">
+ <a4j:actionparam name="current" value="Go to #{car.make} #{car.model} site" assignTo="#{ddmenu.current}"/>
+ </rich:menuItem>
+ </rich:menuGroup>
+ </rich:contextMenu>
+ <rich:dataGrid value="#{dataTableScrollerBean.allCars}" var="car" columns="4" elements="12">
+ <rich:panel id="panel">
+ <rich:componentControl attachTo="panel" event="oncontextmenu" for=":form:menu" operation="doShow">
+ <f:param value="#{car.model}" name="model"/>
+ <f:param value="#{car.make}" name="car"/>
+ </rich:componentControl>
+ <f:facet name="header">
+ <h:outputText value="#{car.make} #{car.model}"></h:outputText>
+ </f:facet>
+ <h:panelGrid columns="2">
+ <h:outputText value="Price:" styleClass="label"></h:outputText>
+ <h:outputText value="#{car.price}" />
+ <h:outputText value="Mileage:" styleClass="label"></h:outputText>
+ <h:outputText value="#{car.mileage}" />
+ <h:outputText value="VIN:" styleClass="label"></h:outputText>
+ <h:outputText value="#{car.vin}" />
+ <h:outputText value="Stock:" styleClass="label"></h:outputText>
+ <h:outputText value="#{car.stock}" />
+ </h:panelGrid>
+ </rich:panel>
+ <f:facet name="footer">
+ <rich:datascroller></rich:datascroller>
+ </f:facet>
+ </rich:dataGrid>
+ <rich:spacer height="30px"/>
+ <a4j:outputPanel ajaxRendered="true">
+ <rich:panel>
+ <f:facet name="header">
+ <h:outputText value="Last actions fired:"/>
+ </f:facet>
+ <h:outputText value="#{ddmenu.current}"></h:outputText>
+ </rich:panel>
+ </a4j:outputPanel>
+ </h:form>
+</ui:composition>
\ No newline at end of file
Added: branches/3.1.x/samples/richfaces-demo/src/main/webapp/richfaces/contextMenu/usage.xhtml
===================================================================
--- branches/3.1.x/samples/richfaces-demo/src/main/webapp/richfaces/contextMenu/usage.xhtml (rev 0)
+++ branches/3.1.x/samples/richfaces-demo/src/main/webapp/richfaces/contextMenu/usage.xhtml 2007-12-04 16:26:51 UTC (rev 4453)
@@ -0,0 +1,43 @@
+<!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:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich">
+ <ui:composition template="/templates/component-sample.xhtml">
+ <ui:define name="sample">
+
+
+
+ <p>RichFaces Context menu is a component that allows to organize the hierarchical popup menus
+ similar to one that almost every desktop application has.
+ </p>
+
+ <p>
+ To call the menu - perform right click inside any car info panel. After you click some item - panel above the grid will be updated.
+ </p>
+ <div class="sample-container">
+
+ <ui:include src="/richfaces/contextMenu/example/menu.xhtml"/>
+ <ui:include src="/templates/include/sourceview.xhtml">
+ <ui:param name="sourcepath" value="/richfaces/contextMenu/example/menu.xhtml"/>
+ </ui:include>
+
+ </div>
+ <p>The context menu is an invisible panel
+ that appears after a particular client side event (onmouseover, onclick etc) occured on parent component.
+ The event is defined with an 'event' attribute.</p>
+
+ <p>Drop Down Menu can contains a set of Menu Items, Menu Groups and Menu Separators.
+ Group plays a role of label for secondary levels on the menu. Separator is represented with
+ horizontal lines between the items or groups. An item is an active element that might produce
+ Ajax or non-Ajax requests. The submittion mode is defined with 'submitMode' attribute that has
+ three possible options - "server", "ajax" or "none". Mode "none" does not produce any request, but
+ allows you to provide your own functionality inside the menu item with an inline content.
+ </p>
+
+ </ui:define>
+
+ </ui:composition>
+</html>
16 years, 6 months
JBoss Rich Faces SVN: r4452 - in branches/3.1.x/samples/richfaces-demo/src/main: webapp/richfaces and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2007-12-04 11:26:27 -0500 (Tue, 04 Dec 2007)
New Revision: 4452
Added:
branches/3.1.x/samples/richfaces-demo/src/main/webapp/richfaces/contextMenu.xhtml
branches/3.1.x/samples/richfaces-demo/src/main/webapp/richfaces/contextMenu/
Modified:
branches/3.1.x/samples/richfaces-demo/src/main/resources/org/richfaces/demo/common/components.properties
Log:
http://jira.jboss.com/jira/browse/RF-1496
Modified: branches/3.1.x/samples/richfaces-demo/src/main/resources/org/richfaces/demo/common/components.properties
===================================================================
--- branches/3.1.x/samples/richfaces-demo/src/main/resources/org/richfaces/demo/common/components.properties 2007-12-04 15:46:30 UTC (rev 4451)
+++ branches/3.1.x/samples/richfaces-demo/src/main/resources/org/richfaces/demo/common/components.properties 2007-12-04 16:26:27 UTC (rev 4452)
@@ -68,3 +68,4 @@
page= ajaxMisc, Ajax Page, /images/ico_common.gif, /images/cn_AjaxPage.gif, RichFacesComponentsLibrary.html#page, jbossajax4jsf/freezone/docs/tlddoc/a4j/page.html, jbossajax4jsf/freezone/docs/apidoc/org/ajax4jsf/ajax/UIAjaxRegion.html, /richfaces/page.jsf
portlet= ajaxMisc, Ajax Portlet, /images/ico_common.gif, /images/cn_AjaxPortlet.gif, RichFacesComponentsLibrary.html#portlet, jbossajax4jsf/freezone/docs/tlddoc/a4j/portlet.html, jbossajax4jsf/freezone/docs/apidoc/org/ajax4jsf/ajax/UIPortlet.html, /richfaces/portlet.jsf
effect= richMisc, Effect, /images/ico_common.gif, /images/cn_Effect.gif, RichFacesComponentsLibrary.html#effect, jbossrichfaces/freezone/docs/tlddoc/rich/effect.html, jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIEffect.html, /richfaces/effect.jsf
+contextMenu= richMenu, Context Menu, /images/ico_dropDownMenu.gif, /images/cn_DropDownMenu.gif, RichFacesComponentsLibrary.html#contextMenu, jbossrichfaces/freezone/docs/tlddoc/rich/contextMenu.html, jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIContextMenu.html, /richfaces/contextMenu.jsf
\ No newline at end of file
Added: branches/3.1.x/samples/richfaces-demo/src/main/webapp/richfaces/contextMenu.xhtml
===================================================================
--- branches/3.1.x/samples/richfaces-demo/src/main/webapp/richfaces/contextMenu.xhtml (rev 0)
+++ branches/3.1.x/samples/richfaces-demo/src/main/webapp/richfaces/contextMenu.xhtml 2007-12-04 16:26:27 UTC (rev 4452)
@@ -0,0 +1,20 @@
+<!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:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:rich="http://richfaces.org/rich">
+<ui:composition template="/templates/main.xhtml">
+ <ui:define name="title">RichFaces - Open Source Rich JSF Components - Context Menu Component</ui:define>
+ <ui:define name="body">
+ <rich:tabPanel switchType="server" styleClass="top_tab" contentClass="content_tab" headerClass="header_tabs_class" inactiveTabClass="inactive_tab" activeTabClass="active_tab">
+ <rich:tab label="Usage">
+ <ui:include src="/richfaces/contextMenu/usage.xhtml"/>
+ </rich:tab>
+ <ui:include src="/templates/include/tagInfo.xhtml">
+ <ui:param name="path" value="rich/contextMenu"/>
+ </ui:include>
+ </rich:tabPanel>
+ </ui:define>
+</ui:composition>
+</html>
16 years, 6 months
JBoss Rich Faces SVN: r4451 - branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-12-04 10:46:30 -0500 (Tue, 04 Dec 2007)
New Revision: 4451
Modified:
branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/component/UIOrderingBaseComponent.java
branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/component/UIOrderingList.java
Log:
validation error message added
Modified: branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/component/UIOrderingBaseComponent.java
===================================================================
--- branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/component/UIOrderingBaseComponent.java 2007-12-04 15:46:25 UTC (rev 4450)
+++ branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/component/UIOrderingBaseComponent.java 2007-12-04 15:46:30 UTC (rev 4451)
@@ -7,6 +7,7 @@
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
@@ -59,7 +60,27 @@
}
};
+ protected boolean isSuitableValue(Object value, Object restoredObject) {
+ if (value instanceof Object[]) {
+ Object[] objects = (Object[]) value;
+ for (int i = 0; i < objects.length; i++) {
+ Object object = objects[i];
+
+ if (object != null && object.equals(restoredObject)) {
+ return true;
+ }
+ }
+ return false;
+ } else {
+ if (value != null) {
+ return ((Collection) value).contains(restoredObject);
+ } else {
+ return false;
+ }
+ }
+ }
+
private static class EditableState implements Serializable {
/**
*
Modified: branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/component/UIOrderingList.java
===================================================================
--- branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/component/UIOrderingList.java 2007-12-04 15:46:25 UTC (rev 4450)
+++ branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/component/UIOrderingList.java 2007-12-04 15:46:30 UTC (rev 4451)
@@ -6,8 +6,10 @@
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
+import java.util.Iterator;
import java.util.Map;
import java.util.Set;
+import java.util.Map.Entry;
import javax.faces.FacesException;
import javax.faces.application.FacesMessage;
@@ -28,37 +30,48 @@
import javax.faces.validator.Validator;
import javax.faces.validator.ValidatorException;
+import org.ajax4jsf.Messages;
import org.ajax4jsf.model.DataVisitor;
import org.ajax4jsf.model.ExtendedDataModel;
import org.ajax4jsf.model.SequenceDataModel;
+import org.richfaces.component.util.MessageUtil;
import org.richfaces.model.OrderingListDataModel;
public abstract class UIOrderingList extends UIOrderingBaseComponent {
- public UIOrderingList() {
- super();
+ protected void processDecodes(FacesContext faces, Object argument) {
+ if (!this.isRendered())
+ return;
+ this.decode(faces);
- final ComponentVisitor decodeVisitor = this.decodeVisitor;
-
- this.decodeVisitor = new ComponentVisitor() {
+ SubmittedValue submittedValue = UIOrderingList.this.submittedValueHolder;
+ if (submittedValue != null) {
+ Object modelValue = getValue();
+ Iterator iterator = submittedValue.dataMap.entrySet().iterator();
+ while (iterator.hasNext()) {
+ Entry entry = (Entry) iterator.next();
+ Object value = entry.getValue();
+
+ if (!isSuitableValue(modelValue, value)) {
+ String messageText = Messages.getMessage(
+ Messages.INVALID_VALUE, MessageUtil.getLabel(faces, this), value);
+
+ FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_ERROR, messageText, null);
+ faces.addMessage(this.getClientId(faces), message);
- public void processComponent(FacesContext context, UIComponent c,
- Object argument) throws IOException {
-
- if (UIOrderingList.this.submittedValueHolder != null) {
- //TODO check for item existence
+ setValid(false);
+
+ iterator.remove();
+
+ submittedValue.selection.remove(value);
+
+ if (submittedValue.activeItem != null && submittedValue.activeItem.equals(value)) {
+ submittedValue.activeItem = null;
+ }
}
+ }
+ }
- decodeVisitor.processComponent(context, c, argument);
- }
-
- };
- }
-
- protected void processDecodes(FacesContext faces, Object argument) {
- if (!this.isRendered())
- return;
- this.decode(faces);
this.iterate(faces, decodeVisitor, argument);
}
16 years, 6 months
JBoss Rich Faces SVN: r4450 - branches/3.1.x/samples/orderingListDemo/src/main/webapp/WEB-INF.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-12-04 10:46:25 -0500 (Tue, 04 Dec 2007)
New Revision: 4450
Modified:
branches/3.1.x/samples/orderingListDemo/src/main/webapp/WEB-INF/faces-config.xml
Log:
validation error message added
Modified: branches/3.1.x/samples/orderingListDemo/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- branches/3.1.x/samples/orderingListDemo/src/main/webapp/WEB-INF/faces-config.xml 2007-12-04 15:46:21 UTC (rev 4449)
+++ branches/3.1.x/samples/orderingListDemo/src/main/webapp/WEB-INF/faces-config.xml 2007-12-04 15:46:25 UTC (rev 4450)
@@ -5,7 +5,7 @@
<managed-bean>
<managed-bean-name>bean</managed-bean-name>
<managed-bean-class>org.richfaces.Bean</managed-bean-class>
- <managed-bean-scope>request</managed-bean-scope>
+ <managed-bean-scope>session</managed-bean-scope>
</managed-bean>
<managed-bean>
16 years, 6 months
JBoss Rich Faces SVN: r4449 - branches/3.1.x/ui/listShuttle/src/main/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-12-04 10:46:21 -0500 (Tue, 04 Dec 2007)
New Revision: 4449
Modified:
branches/3.1.x/ui/listShuttle/src/main/java/org/richfaces/component/UIListShuttle.java
Log:
validation error message added
Modified: branches/3.1.x/ui/listShuttle/src/main/java/org/richfaces/component/UIListShuttle.java
===================================================================
--- branches/3.1.x/ui/listShuttle/src/main/java/org/richfaces/component/UIListShuttle.java 2007-12-04 15:32:55 UTC (rev 4448)
+++ branches/3.1.x/ui/listShuttle/src/main/java/org/richfaces/component/UIListShuttle.java 2007-12-04 15:46:21 UTC (rev 4449)
@@ -9,11 +9,13 @@
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
+import java.util.Iterator;
import java.util.Map;
import java.util.Set;
+import java.util.Map.Entry;
import javax.faces.FacesException;
-import javax.faces.component.UIComponent;
+import javax.faces.application.FacesMessage;
import javax.faces.component.UIInput;
import javax.faces.context.FacesContext;
import javax.faces.convert.ConverterException;
@@ -23,8 +25,9 @@
import javax.faces.event.ValueChangeListener;
import javax.faces.model.DataModel;
+import org.ajax4jsf.Messages;
import org.ajax4jsf.model.DataVisitor;
-import org.richfaces.component.UIOrderingBaseComponent.UpdateModelCommand;
+import org.richfaces.component.util.MessageUtil;
import org.richfaces.model.ListShuttleDataModel;
import org.richfaces.model.ListShuttleRowKey;
@@ -44,30 +47,44 @@
private Collection targetSelection;
private boolean targetSelectionSet;
- public UIListShuttle() {
- super();
+ protected void processDecodes(FacesContext faces, Object argument) {
+ if (!this.isRendered())
+ return;
+ this.decode(faces);
- final ComponentVisitor decodeVisitor = this.decodeVisitor;
-
- this.decodeVisitor = new ComponentVisitor() {
+ SubmittedValue submittedValue = UIListShuttle.this.submittedValueHolder;
+ if (submittedValue != null) {
+ if (submittedValue != null) {
+ Object modelSourceValue = getSourceValue();
+ Object modelTargetValue = getTargetValue();
+
+ Iterator iterator = submittedValue.map.entrySet().iterator();
+ while (iterator.hasNext()) {
+ Entry entry = (Entry) iterator.next();
+ Object value = entry.getValue();
+
+ if (!isSuitableValue(modelSourceValue, value) && !isSuitableValue(modelTargetValue, value)) {
+ String messageText = Messages.getMessage(
+ Messages.INVALID_VALUE, MessageUtil.getLabel(faces, this), value);
+
+ FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_ERROR, messageText, null);
+ faces.addMessage(this.getClientId(faces), message);
- public void processComponent(FacesContext context, UIComponent c,
- Object argument) throws IOException {
-
- if (UIListShuttle.this.submittedValueHolder != null) {
- //TODO check for item existence
+ setValid(false);
+
+ iterator.remove();
+
+ submittedValue.sourceSelection.remove(value);
+ submittedValue.targetSelection.remove(value);
+
+ if (submittedValue.activeItem != null && submittedValue.activeItem.equals(value)) {
+ submittedValue.activeItem = null;
+ }
+ }
}
-
- decodeVisitor.processComponent(context, c, argument);
}
+ }
- };
- }
-
- protected void processDecodes(FacesContext faces, Object argument) {
- if (!this.isRendered())
- return;
- this.decode(faces);
this.iterate(faces, decodeVisitor, argument);
}
16 years, 6 months
JBoss Rich Faces SVN: r4448 - in branches/3.1.x/ui/listShuttle/src/main: templates/org/richfaces and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2007-12-04 10:32:55 -0500 (Tue, 04 Dec 2007)
New Revision: 4448
Modified:
branches/3.1.x/ui/listShuttle/src/main/resources/org/richfaces/renderkit/html/css/listShuttle.xcss
branches/3.1.x/ui/listShuttle/src/main/templates/org/richfaces/htmlListShuttle.jspx
Log:
cosmetic changes
Modified: branches/3.1.x/ui/listShuttle/src/main/resources/org/richfaces/renderkit/html/css/listShuttle.xcss
===================================================================
--- branches/3.1.x/ui/listShuttle/src/main/resources/org/richfaces/renderkit/html/css/listShuttle.xcss 2007-12-04 15:19:15 UTC (rev 4447)
+++ branches/3.1.x/ui/listShuttle/src/main/resources/org/richfaces/renderkit/html/css/listShuttle.xcss 2007-12-04 15:32:55 UTC (rev 4448)
@@ -20,7 +20,6 @@
.shuttle_right_button_col_valign{vertical-align : middle}
.ol_caption {
- padding : 1px;
height: 8px;
}
@@ -45,6 +44,7 @@
.ol_internal_header_tab {
background : repeat scroll left top;
+ width: 100%;
}
.ol_internal_header_tab th{background : url(ol_images/bg_header.png) top left repeat-x #C6D6EA; color : #000000; font-family : Arial; font-size :11px; font-weight : normal; border-bottom : 1px solid #bfbfc0;border-right : 1px solid #bfbfc0;border-left : 1px solid #EAF0F8;border-top : 1px solid #FFFFFF; padding : 2px}
@@ -55,7 +55,8 @@
}
.ol_internal_tab {
- width : 100%;
+ background : repeat scroll left top;
+ width: 100%;
}
.ol_internal_tab .ol_endcol{border-right : 0px;}
Modified: branches/3.1.x/ui/listShuttle/src/main/templates/org/richfaces/htmlListShuttle.jspx
===================================================================
--- branches/3.1.x/ui/listShuttle/src/main/templates/org/richfaces/htmlListShuttle.jspx 2007-12-04 15:19:15 UTC (rev 4447)
+++ branches/3.1.x/ui/listShuttle/src/main/templates/org/richfaces/htmlListShuttle.jspx 2007-12-04 15:32:55 UTC (rev 4448)
@@ -54,7 +54,7 @@
<table id="#{clientId}table" cellpadding="0" cellspacing="0" class="ol_body">
<tbody>
<tr>
- <td class="ol_caption">
+ <td align="left" class="ol_caption">
<f:call name="encodeSLCaption"/>
</td>
</tr>
@@ -72,7 +72,7 @@
]]>
</jsp:scriptlet>
<div class="ol_list_header" style="#{contentContainerStyle}">
- <table id="#{clientId}internal_header_tab" class="ol_internal_header_tab rich-ordering-list-items" cellpadding="0" cellspacing="0">
+ <table id="#{clientId}internal_header_tab" class="ol_internal_header_tab" cellpadding="0" cellspacing="0">
<f:call name="encodeSLHeader"/>
</table>
</div>
@@ -137,7 +137,7 @@
]]>
</jsp:scriptlet>
<div class="ol_list_header" style="#{contentContainerStyle}">
- <table id="#{clientId}tlInternal_header_tab" class="ol_internal_header_tab rich-ordering-list-items" cellpadding="0" cellspacing="0">
+ <table id="#{clientId}tlInternal_header_tab" class="ol_internal_header_tab" cellpadding="0" cellspacing="0">
<f:call name="encodeTLHeader"/>
</table>
</div>
16 years, 6 months
JBoss Rich Faces SVN: r4447 - branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/renderkit.
by richfaces-svn-commits@lists.jboss.org
Author: sergeyhalipov
Date: 2007-12-04 10:19:15 -0500 (Tue, 04 Dec 2007)
New Revision: 4447
Modified:
branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingComponentRendererBase.java
Log:
Prevent NullPointerException in function.
Modified: branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingComponentRendererBase.java
===================================================================
--- branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingComponentRendererBase.java 2007-12-04 15:10:23 UTC (rev 4446)
+++ branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingComponentRendererBase.java 2007-12-04 15:19:15 UTC (rev 4447)
@@ -428,6 +428,12 @@
if (object instanceof String) {
return (String) object;
}
+ if (null == object) {
+ return "null";
+ }
+ if (null == component.getConverter()) {
+ return object.toString();
+ }
return component.getConverter().getAsString(context, component, object);
}
16 years, 6 months
JBoss Rich Faces SVN: r4446 - branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/renderkit.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2007-12-04 10:10:23 -0500 (Tue, 04 Dec 2007)
New Revision: 4446
Modified:
branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingListRendererBase.java
Log:
rendering border for empty cells was changed
Modified: branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingListRendererBase.java
===================================================================
--- branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingListRendererBase.java 2007-12-04 15:08:48 UTC (rev 4445)
+++ branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingListRendererBase.java 2007-12-04 15:10:23 UTC (rev 4446)
@@ -127,6 +127,14 @@
cellClassName.append(" rich-ordering-list-cell-end");
}
writer.writeAttribute("class", cellClassName.toString(), null);
+
+ //writer.write(" ");
+
+ writer.startElement(HTML.IMG_ELEMENT, table);
+ writer.writeAttribute(HTML.src_ATTRIBUTE, getResource("/org/richfaces/renderkit/html/images/spacer.gif").getUri(context, null), null);
+ writer.writeAttribute(HTML.style_ATTRIBUTE, "width:1px;height:1px;", null);
+ writer.endElement(HTML.IMG_ELEMENT);
+
renderChildren(context, column);
if (!columnRendered) {
16 years, 6 months
JBoss Rich Faces SVN: r4445 - trunk/ui/scrollableDataTable/src/main/javascript/ClientUI/controls/grid.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2007-12-04 10:08:48 -0500 (Tue, 04 Dec 2007)
New Revision: 4445
Modified:
trunk/ui/scrollableDataTable/src/main/javascript/ClientUI/controls/grid/Selection.js
Log:
PS-124
Modified: trunk/ui/scrollableDataTable/src/main/javascript/ClientUI/controls/grid/Selection.js
===================================================================
--- trunk/ui/scrollableDataTable/src/main/javascript/ClientUI/controls/grid/Selection.js 2007-12-04 14:47:57 UTC (rev 4444)
+++ trunk/ui/scrollableDataTable/src/main/javascript/ClientUI/controls/grid/Selection.js 2007-12-04 15:08:48 UTC (rev 4445)
@@ -339,81 +339,83 @@
},
processKeyDown: function(event) {
- if(!event.shiftKey) {
- this.shiftRow = null;
- }
- var range, rowIndex;
- var activeRow = this.activeRow;
- var noDefault = false;
- this.firstIndex = Number($(this.prefix + ":n").rows[0].id.split(this.prefix)[1].split(":")[2]);;
- switch (event.keyCode || event.charCode) {
- case Event.KEY_UP:
- if (this.inFocus && activeRow != null) {
- if(this.firstIndex != activeRow) {
- rowIndex = (this.rowCount + activeRow - 1) % this.rowCount;
- if (!event.ctrlKey && !event.shiftKey) {
- this.selectionFlag = "x";
- range = [rowIndex, rowIndex];
- this.setSelection(range);
- } else if (!event.ctrlKey && event.shiftKey) {
- if(!this.shiftRow) {
- this.shiftRow = this.activeRow;
+ if ($(this.prefix + ":n").rows.length > 0) {
+ if(!event.shiftKey) {
+ this.shiftRow = null;
+ }
+ var range, rowIndex;
+ var activeRow = this.activeRow;
+ var noDefault = false;
+ this.firstIndex = Number($(this.prefix + ":n").rows[0].id.split(this.prefix)[1].split(":")[2]);;
+ switch (event.keyCode || event.charCode) {
+ case Event.KEY_UP:
+ if (this.inFocus && activeRow != null) {
+ if(this.firstIndex != activeRow) {
+ rowIndex = (this.rowCount + activeRow - 1) % this.rowCount;
+ if (!event.ctrlKey && !event.shiftKey) {
+ this.selectionFlag = "x";
+ range = [rowIndex, rowIndex];
+ this.setSelection(range);
+ } else if (!event.ctrlKey && event.shiftKey) {
+ if(!this.shiftRow) {
+ this.shiftRow = this.activeRow;
+ }
+ if(this.shiftRow >= this.activeRow) {
+ this.addRowToSelection(rowIndex);
+ } else {
+ this.removeRowFromSelection(activeRow);
+ }
}
- if(this.shiftRow >= this.activeRow) {
- this.addRowToSelection(rowIndex);
- } else {
- this.removeRowFromSelection(activeRow);
- }
+ noDefault = true;
+ this.setActiveRow(rowIndex);
+ } else {
+ this.grid.getBody().showRow("up");
}
- noDefault = true;
- this.setActiveRow(rowIndex);
- } else {
- this.grid.getBody().showRow("up");
}
- }
- break;
- case Event.KEY_DOWN:
- if (this.inFocus && activeRow != null) {
- rowIndex = (activeRow + 1) % this.rowCount;
- if(this.firstIndex != rowIndex) {
- if (!event.ctrlKey && !event.shiftKey) {
- this.selectionFlag = "x";
- range = [rowIndex, rowIndex];
- this.setSelection(range);
- } else if (!event.ctrlKey && event.shiftKey) {
- if(!this.shiftRow) {
- this.shiftRow = this.activeRow;
+ break;
+ case Event.KEY_DOWN:
+ if (this.inFocus && activeRow != null) {
+ rowIndex = (activeRow + 1) % this.rowCount;
+ if(this.firstIndex != rowIndex) {
+ if (!event.ctrlKey && !event.shiftKey) {
+ this.selectionFlag = "x";
+ range = [rowIndex, rowIndex];
+ this.setSelection(range);
+ } else if (!event.ctrlKey && event.shiftKey) {
+ if(!this.shiftRow) {
+ this.shiftRow = this.activeRow;
+ }
+ if(this.shiftRow <= this.activeRow) {
+ this.addRowToSelection(rowIndex);
+ } else {
+ this.removeRowFromSelection(activeRow);
+ }
}
- if(this.shiftRow <= this.activeRow) {
- this.addRowToSelection(rowIndex);
- } else {
- this.removeRowFromSelection(activeRow);
- }
+ noDefault = true;
+ this.setActiveRow(rowIndex);
+ } else {
+ this.grid.getBody().showRow("down");
}
+ }
+ break;
+ case 65: case 97: // Ctrl-A
+ if (this.inFocus && event.ctrlKey) {
+ this.selectionFlag = "a";
+ range = [0, this.rowCount];
+ this.setSelection(range);
noDefault = true;
- this.setActiveRow(rowIndex);
- } else {
- this.grid.getBody().showRow("down");
}
- }
- break;
- case 65: case 97: // Ctrl-A
- if (this.inFocus && event.ctrlKey) {
- this.selectionFlag = "a";
- range = [0, this.rowCount];
- this.setSelection(range);
- noDefault = true;
- }
- break;
- case Event.KEY_TAB:
- this.lostFocus();
+ break;
+ case Event.KEY_TAB:
+ this.lostFocus();
+ }
+ if (noDefault) {
+ this.grid.getBody().showRow(this.activeRow);
+ this.selectionChanged(event);
+ if (event.preventBubble) event.preventBubble();
+ Event.stop(event);
+ }
}
- if (noDefault) {
- this.grid.getBody().showRow(this.activeRow);
- this.selectionChanged(event);
- if (event.preventBubble) event.preventBubble();
- Event.stop(event);
- }
},
processClick: function(event, rowIndex) {
16 years, 6 months