[richfaces-svn-commits] JBoss Rich Faces SVN: r4454 - in branches/3.1.x/test-applications/facelets/src/main: java/rich and 8 other directories.
richfaces-svn-commits at lists.jboss.org
richfaces-svn-commits at lists.jboss.org
Tue Dec 4 11:32:27 EST 2007
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>
More information about the richfaces-svn-commits
mailing list