JBoss Rich Faces SVN: r4349 - branches/3.1.x/ui/orderingList/src/main/templates/org/richfaces.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2007-11-29 10:08:58 -0500 (Thu, 29 Nov 2007)
New Revision: 4349
Modified:
branches/3.1.x/ui/orderingList/src/main/templates/org/richfaces/htmlOrderingList.jspx
Log:
cosmetic changes
Modified: branches/3.1.x/ui/orderingList/src/main/templates/org/richfaces/htmlOrderingList.jspx
===================================================================
--- branches/3.1.x/ui/orderingList/src/main/templates/org/richfaces/htmlOrderingList.jspx 2007-11-29 15:05:23 UTC (rev 4348)
+++ branches/3.1.x/ui/orderingList/src/main/templates/org/richfaces/htmlOrderingList.jspx 2007-11-29 15:08:58 UTC (rev 4349)
@@ -32,7 +32,7 @@
<table id="#{clientId}table" cellpadding="0" cellspacing="0" class="rich-ordering-list-body">
<tbody>
<tr>
- <td colspan="2" class="rich-ordering-list-caption">
+ <td align="left" colspan="2" class="rich-ordering-list-caption">
<f:call name="encodeCaption"/>
</td>
</tr>
17 years, 1 month
JBoss Rich Faces SVN: r4348 - in branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html: scripts and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2007-11-29 10:05:23 -0500 (Thu, 29 Nov 2007)
New Revision: 4348
Modified:
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/css/orderingList.xcss
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ListBase.js
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/OrderingList.js
Log:
cosmetic changes
Modified: branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/css/orderingList.xcss
===================================================================
--- branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/css/orderingList.xcss 2007-11-29 14:06:11 UTC (rev 4347)
+++ branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/css/orderingList.xcss 2007-11-29 15:05:23 UTC (rev 4348)
@@ -310,10 +310,6 @@
</u:selector>
<u:selector name=".rich-ordering-list-row-active">
- <u:style name="background-image">
- <f:resource f:key="org.richfaces.renderkit.html.gradientimages.OrderingListSelectGradient" />
- </u:style>
- <u:style name="background-color" skin="headerGradientColor" />
</u:selector>
<u:selector name=".rich-ordering-list-row-selected">
Modified: branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ListBase.js
===================================================================
--- branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ListBase.js 2007-11-29 14:06:11 UTC (rev 4347)
+++ branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ListBase.js 2007-11-29 15:05:23 UTC (rev 4348)
@@ -170,7 +170,6 @@
Richfaces.SelectItems.doActive(this.activeItem);
this.saveSate();
break;
- //case 32 : this.invertSelection(event); break; //blank
}
},
@@ -307,6 +306,8 @@
//this.getSelectItemByNode(shuttleItem)._selected = false; //FIXME
}
this.selectedItems.length = 0;
+
+ //need to reset active item
},
getSelectItemByNode : function(selectItemNode) {
Modified: branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/OrderingList.js
===================================================================
--- branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/OrderingList.js 2007-11-29 14:06:11 UTC (rev 4347)
+++ branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/OrderingList.js 2007-11-29 15:05:23 UTC (rev 4348)
@@ -147,7 +147,6 @@
Richfaces.SelectItems.doActive(this.activeItem);
this.saveState();
break;
- case 32 : this.invertSelection(event); this.saveState(); break; //blank
}
}
17 years, 1 month
JBoss Rich Faces SVN: r4347 - branches/3.1.x/ui/contextMenu/src/test/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: sergeyhalipov
Date: 2007-11-29 09:06:11 -0500 (Thu, 29 Nov 2007)
New Revision: 4347
Modified:
branches/3.1.x/ui/contextMenu/src/test/java/org/richfaces/component/ContextMenuComponentTest.java
Log:
http://jira.jboss.com/jira/browse/RF-1302
JUnit tests for context menu.
Modified: branches/3.1.x/ui/contextMenu/src/test/java/org/richfaces/component/ContextMenuComponentTest.java
===================================================================
--- branches/3.1.x/ui/contextMenu/src/test/java/org/richfaces/component/ContextMenuComponentTest.java 2007-11-29 13:25:23 UTC (rev 4346)
+++ branches/3.1.x/ui/contextMenu/src/test/java/org/richfaces/component/ContextMenuComponentTest.java 2007-11-29 14:06:11 UTC (rev 4347)
@@ -28,6 +28,7 @@
import javax.faces.FacesException;
import javax.faces.component.UIOutput;
+import javax.faces.component.UIParameter;
import javax.faces.component.html.HtmlForm;
import javax.faces.context.FacesContext;
import javax.faces.el.EvaluationException;
@@ -37,6 +38,8 @@
import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
import org.apache.commons.lang.StringUtils;
+import com.gargoylesoftware.htmlunit.html.DomNode;
+import com.gargoylesoftware.htmlunit.html.DomText;
import com.gargoylesoftware.htmlunit.html.HtmlElement;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
import com.gargoylesoftware.htmlunit.html.HtmlScript;
@@ -46,11 +49,14 @@
*/
public class ContextMenuComponentTest extends AbstractAjax4JsfTestCase {
private static Set javaScripts = new HashSet();
+ private static final String PARAM_SEQUENCE = "{'name':'value'}";
private UIContextMenu menu = null;
private HtmlForm form = null;
private UIOutput output = null;
private UIMenuItem menuItem = null;
+ private UIParameter param = null;
+ private UIMenuGroup menuGroup = null;
static {
javaScripts.add("org.ajax4jsf.javascript.PrototypeScript");
@@ -75,6 +81,7 @@
application.addComponent(UIContextMenu.COMPONENT_TYPE, "org.richfaces.component.html.ContextMenu");
application.addComponent(UIMenuItem.COMPONENT_TYPE, "org.richfaces.component.html.HtmlMenuItem");
+ application.addComponent(UIMenuGroup.COMPONENT_TYPE, "org.richfaces.component.html.HtmlMenuGroup");
form = new HtmlForm();
form.setId("form");
@@ -86,17 +93,29 @@
menu = (UIContextMenu)application.createComponent(UIContextMenu.COMPONENT_TYPE);
menu.setId("contextMenu");
+
+ param = new UIParameter();
+ param.setId("param");
+ param.setName("name");
+ param.setValue("value");
+ menu.getChildren().add(param);
+
+ menuGroup = (UIMenuGroup)application.createComponent(UIMenuGroup.COMPONENT_TYPE);
+
output.getChildren().add(menu);
menuItem = (UIMenuItem)application.createComponent(UIMenuItem.COMPONENT_TYPE);
menuItem.setId("menuItem");
menuItem.setValue("value");
- menu.getChildren().add(menuItem);
+ menuGroup.getChildren().add(menuItem);
form.getChildren().add(output);
}
public void tearDown() throws Exception {
+ param = null;
+ menuItem = null;
+ menuGroup = null;
menu = null;
form = null;
output = null;
@@ -112,7 +131,7 @@
public void testRenderScript() throws Exception {
HtmlPage page = renderView();
assertNotNull(page);
- System.out.println(page.asXml());
+
List scripts = page.getDocumentElement().getHtmlElementsByTagName("script");
int foundCount = 0;
for (Iterator it = scripts.iterator(); it.hasNext();) {
@@ -154,6 +173,16 @@
assertNotNull(script);
assertEquals("script", script.getNodeName());
+ DomNode scriptBody = (DomNode) script.getFirstChild();
+ assertNotNull(scriptBody);
+ assertTrue(scriptBody instanceof DomText);
+ String scriptText = scriptBody.asText();
+ assertNotNull(scriptText);
+ scriptText = scriptText.replaceAll("\\s", "");
+
+ assertTrue(scriptText.startsWith("newRichfaces.ContextMenu"));
+ assertTrue(scriptText.contains(PARAM_SEQUENCE));
+
assertNull(script.getNextSibling());
menu.setEvent(null);
17 years, 1 month
JBoss Rich Faces SVN: r4346 - in branches/3.1.x/test-applications/facelets/src/main: webapp/ContextMenu and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: ayanul
Date: 2007-11-29 08:25:23 -0500 (Thu, 29 Nov 2007)
New Revision: 4346
Modified:
branches/3.1.x/test-applications/facelets/src/main/java/contextMenu/ContextMenu.java
branches/3.1.x/test-applications/facelets/src/main/webapp/ContextMenu/ContextMenuProperty.xhtml
Log:
Modified: branches/3.1.x/test-applications/facelets/src/main/java/contextMenu/ContextMenu.java
===================================================================
--- branches/3.1.x/test-applications/facelets/src/main/java/contextMenu/ContextMenu.java 2007-11-29 13:20:00 UTC (rev 4345)
+++ branches/3.1.x/test-applications/facelets/src/main/java/contextMenu/ContextMenu.java 2007-11-29 13:25:23 UTC (rev 4346)
@@ -37,7 +37,7 @@
}
public ContextMenu() {
- submitMode = "client";
+ submitMode = "none";
event = "oncontextmenu";
popupWidth = "300px";
hideDelay = 3;
Modified: branches/3.1.x/test-applications/facelets/src/main/webapp/ContextMenu/ContextMenuProperty.xhtml
===================================================================
--- branches/3.1.x/test-applications/facelets/src/main/webapp/ContextMenu/ContextMenuProperty.xhtml 2007-11-29 13:20:00 UTC (rev 4345)
+++ branches/3.1.x/test-applications/facelets/src/main/webapp/ContextMenu/ContextMenuProperty.xhtml 2007-11-29 13:25:23 UTC (rev 4346)
@@ -27,8 +27,8 @@
<h:outputText value="submitMode:" onchange="submit();" />
<h:selectOneRadio value="#{contextMenu.submitMode}">
+ <f:selectItem itemLabel="none" itemValue="none" />
<f:selectItem itemLabel="server" itemValue="server" />
- <f:selectItem itemLabel="client" itemValue="client" />
<f:selectItem itemLabel="ajax" itemValue="ajax" />
</h:selectOneRadio>
17 years, 1 month
JBoss Rich Faces SVN: r4345 - in branches/3.1.x/test-applications/facelets/src/main: java/orderingList and 5 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: ayanul
Date: 2007-11-29 08:20:00 -0500 (Thu, 29 Nov 2007)
New Revision: 4345
Added:
branches/3.1.x/test-applications/facelets/src/main/webapp/ContextMenu/ContextMenuProperty.xhtml
Modified:
branches/3.1.x/test-applications/facelets/src/main/java/contextMenu/ContextMenu.java
branches/3.1.x/test-applications/facelets/src/main/java/orderingList/OrderingList.java
branches/3.1.x/test-applications/facelets/src/main/java/rich/RichBean.java
branches/3.1.x/test-applications/facelets/src/main/webapp/ContextMenu/ContextMenu.xhtml
branches/3.1.x/test-applications/facelets/src/main/webapp/OrderingList/OrderingList.xhtml
branches/3.1.x/test-applications/facelets/src/main/webapp/WEB-INF/faces-config.xml
branches/3.1.x/test-applications/facelets/src/main/webapp/pages/RichMenu/RichMenu.xhtml
Log:
update ContextMenu
Modified: branches/3.1.x/test-applications/facelets/src/main/java/contextMenu/ContextMenu.java
===================================================================
--- branches/3.1.x/test-applications/facelets/src/main/java/contextMenu/ContextMenu.java 2007-11-29 12:01:11 UTC (rev 4344)
+++ branches/3.1.x/test-applications/facelets/src/main/java/contextMenu/ContextMenu.java 2007-11-29 13:20:00 UTC (rev 4345)
@@ -1,23 +1,51 @@
package contextMenu;
+import java.util.Map;
+
+import javax.faces.context.FacesContext;
+
public class ContextMenu {
+ private String info;
+ private String submitMode;
+ private String event;
+ private String popupWidth;
+ private int hideDelay;
+ private int showDelay;
+ private boolean disableDefaultMenu;
+ private boolean rendered;
private boolean disamble;
- private String event;
- private String mode;
- private String param;
-
- public String getParam() {
- return param;
+ private boolean attached;
+
+ public boolean isAttached() {
+ return attached;
}
- public void setParam(String param) {
- this.param = param;
+ public void setAttached(boolean attached) {
+ this.attached = attached;
}
+ public String getInfo() {
+ FacesContext facesContext = FacesContext.getCurrentInstance();
+ Map params = facesContext.getExternalContext().getRequestParameterMap();
+ String cmdParam = (String) params.get("cmdParam");
+ if (cmdParam != null) info = cmdParam;
+ return info;
+ }
+
+ public void setInfo(String info) {
+ this.info = info;
+ }
+
public ContextMenu() {
+ submitMode = "client";
+ event = "oncontextmenu";
+ popupWidth = "300px";
+ hideDelay = 3;
+ showDelay = 3;
+ disableDefaultMenu = true;
+ rendered = true;
disamble = false;
- event = "";
- mode = "client";
+ attached = true;
}
public boolean isDisamble() {
@@ -36,12 +64,52 @@
this.event = event;
}
- public String getMode() {
- return mode;
+ public String getSubmitMode() {
+ return submitMode;
}
- public void setMode(String mode) {
- this.mode = mode;
+ public void setSubmitMode(String submitMode) {
+ this.submitMode = submitMode;
}
+
+ public boolean isDisableDefaultMenu() {
+ return disableDefaultMenu;
+ }
+
+ public void setDisableDefaultMenu(boolean disableDefaultMenu) {
+ this.disableDefaultMenu = disableDefaultMenu;
+ }
+
+ public boolean isRendered() {
+ return rendered;
+ }
+
+ public void setRendered(boolean rendered) {
+ this.rendered = rendered;
+ }
+
+ public String getPopupWidth() {
+ return popupWidth;
+ }
+
+ public void setPopupWidth(String popupWidth) {
+ this.popupWidth = popupWidth;
+ }
+
+ public int getHideDelay() {
+ return hideDelay;
+ }
+
+ public void setHideDelay(int hideDelay) {
+ this.hideDelay = hideDelay;
+ }
+
+ public int getShowDelay() {
+ return showDelay;
+ }
+
+ public void setShowDelay(int showDelay) {
+ this.showDelay = showDelay;
+ }
}
Modified: branches/3.1.x/test-applications/facelets/src/main/java/orderingList/OrderingList.java
===================================================================
--- branches/3.1.x/test-applications/facelets/src/main/java/orderingList/OrderingList.java 2007-11-29 12:01:11 UTC (rev 4344)
+++ branches/3.1.x/test-applications/facelets/src/main/java/orderingList/OrderingList.java 2007-11-29 13:20:00 UTC (rev 4345)
@@ -74,7 +74,7 @@
captionLabel = "captionLabel";
lenght = 10;
listHeight = "300";
- listWidth = "400";
+ listWidth = "800";
controlsType = "button";
controlsHorizontalAlign = "0";
controlsVerticalAlign = "0";
@@ -228,7 +228,7 @@
public void clAction() {
info.clear();
- info.add("commandLink immediate submit();");
+ info.add("commandLink submit();");
addSelection();
}
@@ -349,6 +349,7 @@
}
private void addSelection() {
+ if(selection == null) return;
Iterator<Data> inter = selection.iterator();
Data data = new Data();
while (inter.hasNext()) {
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-11-29 12:01:11 UTC (rev 4344)
+++ branches/3.1.x/test-applications/facelets/src/main/java/rich/RichBean.java 2007-11-29 13:20:00 UTC (rev 4345)
@@ -51,6 +51,7 @@
map.add("OrderingList", add("/OrderingList/OrderingList", new boolean [] {true, true}));
map.add("DataDefinitionList", add("/DataDefinitionList/DataDefinitionList", new boolean [] {true, false}));
map.add("DataOrderedList", add("/DataOrderedList/DataOrderedList", new boolean [] {true, false}));
+ map.add("ContextMenu", add("/ContextMenu/ContextMenu", new boolean [] {true, false}));
}
public String getSrc() {
Modified: branches/3.1.x/test-applications/facelets/src/main/webapp/ContextMenu/ContextMenu.xhtml
===================================================================
--- branches/3.1.x/test-applications/facelets/src/main/webapp/ContextMenu/ContextMenu.xhtml 2007-11-29 12:01:11 UTC (rev 4344)
+++ branches/3.1.x/test-applications/facelets/src/main/webapp/ContextMenu/ContextMenu.xhtml 2007-11-29 13:20:00 UTC (rev 4345)
@@ -1,65 +1,83 @@
<f:subview id="contextMenuSubviewID" 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:form>
- <!-- rich:contextMenu id="" attached="" event="" disableDefaultMenu="" rendered="" submitMode=""></rich:contextMenu-->
+ <h:panelGrid columns="2">
+ <rich:panel style="width: 130px; height: 50px; background-color: #98FB98;">
+ <h:outputText value="panel with contextMenu(DEFAULT)" />
+ <rich:contextMenu id="contextMenuDefaultID" submitMode="client">
+ <rich:menuItem icon="/pics/header.png" value="abc" reRender="cmInfoID">
+ <f:param name="cmdParam" value="abc" />
+ </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:menuItem icon="/pics/info.gif" value="d" reRender="cmInfoID">
+ <f:param name="cmdParam" value="d" />
+ </rich:menuItem>
+ <rich:menuGroup value="menuGroup">
+ <rich:menuItem icon="/pics/fatal.gif" value="a" reRender="cmInfoID">
+ <f:param name="cmdParam" value="a" />
+ </rich:menuItem>
+ <rich:menuItem icon="/pics/fatal.gif" value="{cmdParam} b" reRender="cmInfoID">
+ <f:param name="cmdParam" value="b" />
+ </rich:menuItem>
+ <rich:menuItem icon="/pics/fatal.gif" value="c" reRender="cmInfoID">
+ <f:param name="cmdParam" value="c" />
+ </rich:menuItem>
+ <rich:menuItem icon="/pics/fatal.gif" value="d" reRender="cmInfoID">
+ <f:param name="cmdParam" value="d" />
+ </rich:menuItem>
+ </rich:menuGroup>
+ </rich:contextMenu>
+ </rich:panel>
- <rich:panel style="width: 120px; height: 50px; background-color: #98FB98;">
- <h:outputText value="panel with contextMenu(default)" />
- <rich:contextMenu id="contextMenuDefaultID" submitMode="client">
- <rich:menuItem icon="/pics/header.png" value="abc">
- <f:param name="cmdParam" value="abc" />
- </rich:menuItem>
- <rich:menuSeparator />
- <rich:menuItem icon="/pics/info.gif" value="a">
- <f:param name="cmdParam" value="a" />
- </rich:menuItem>
- <rich:menuItem icon="/pics/info.gif" value="{cmdParam} b">
- <f:param name="cmdParam" value="b" />
- </rich:menuItem>
- <rich:menuItem icon="/pics/info.gif" value="c">
- <f:param name="cmdParam" value="c" />
- </rich:menuItem>
- <rich:menuItem icon="/pics/info.gif" value="d" data="cmdParam:aaaa">
- <f:param name="cmdParam" value="d" />
- </rich:menuItem>
- </rich:contextMenu>
- <a4j:outputPanel ajaxRendered="true">
- #{cmdParam}
- </a4j:outputPanel>
- <h:commandButton value="aaa" onclick="alert(event.parameters.cmdParam);" />
- </rich:panel>
-
- <h:panelGrid id="pgcmTestID" columns="3">
- <rich:panel id="pcmTestID" style="width: 80px; height: 45px; background-color: #F5F5DC;">
- <h:outputText value="rich:panel" />
+ <rich:panel style="width: 130px; height: 50px; background-color: #98FB98;">
+ <h:outputText value="panel with contextMenu(Test)" />
+ <rich:contextMenu id="contextMenuID" attached="#{contextMenu.attached}" submitMode="#{contextMenu.submitMode}" event="#{contextMenu.event}"
+ disableDefaultMenu="#{contextMenu.disableDefaultMenu}" rendered="#{contextMenu.rendered}"
+ hideDelay="#{contextMenu.hideDelay}" showDelay="#{contextMenu.showDelay}" popupWidth="#{contextMenu.popupWidth}">
+ <rich:menuItem icon="/pics/header.png" value="abc" reRender="cmInfoID">
+ <f:param name="cmdParam" value="abc" />
+ </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:menuItem icon="/pics/info.gif" value="d" reRender="cmInfoID">
+ <f:param name="cmdParam" value="d" />
+ </rich:menuItem>
+ <rich:menuGroup value="menuGroup">
+ <rich:menuItem icon="/pics/fatal.gif" value="a" reRender="cmInfoID">
+ <f:param name="cmdParam" value="a" />
+ </rich:menuItem>
+ <rich:menuItem icon="/pics/fatal.gif" value="{cmdParam} b" reRender="cmInfoID">
+ <f:param name="cmdParam" value="b" />
+ </rich:menuItem>
+ <rich:menuItem icon="/pics/fatal.gif" value="c" reRender="cmInfoID">
+ <f:param name="cmdParam" value="c" />
+ </rich:menuItem>
+ <rich:menuItem icon="/pics/fatal.gif" value="d" reRender="cmInfoID">
+ <f:param name="cmdParam" value="d" />
+ </rich:menuItem>
+ </rich:menuGroup>
+ </rich:contextMenu>
</rich:panel>
-
- <rich:tabPanel id="tpcmTestID" switchType="client">
- <rich:tab id="t1cmTestID" label="tab1">
- <h:outputText value="text1" />
- </rich:tab>
- <rich:tab id="t2cmTestID" label="tab2">
- <h:outputText value="text2" />
- </rich:tab>
- <rich:tab id="t3cmTestID" label="tab3">
- <h:outputText value="text3" />
- </rich:tab>
- </rich:tabPanel>
-
- <h:graphicImage id="gicmID" value="/pics/asus.jpg" height="125px" width="150px">
- </h:graphicImage>
-
- <h:inputText id="itcmTestID" value="inputText">
- </h:inputText>
-
- <f:verbatim>
- <div id="divcmTestID" style="width: 80px; height: 45px; background-color: #F5F5DC;"><span> div </span></div>
- </f:verbatim>
-
- <h:panelGrid id="pgTestID" columns="1" border="5" cellpadding="2" cellspacing="2">
- <h:outputText value="panelGrid" />
- <h:outputText value="" />
+ <h:panelGrid id="cmInfoID" columns="2">
+ <h:outputText value="Select items: " />
+ <h:outputText value="#{contextMenu.info}" style="color: red"/>
</h:panelGrid>
+
</h:panelGrid>
- </h:form>
</f:subview>
\ No newline at end of file
Added: branches/3.1.x/test-applications/facelets/src/main/webapp/ContextMenu/ContextMenuProperty.xhtml
===================================================================
--- branches/3.1.x/test-applications/facelets/src/main/webapp/ContextMenu/ContextMenuProperty.xhtml (rev 0)
+++ branches/3.1.x/test-applications/facelets/src/main/webapp/ContextMenu/ContextMenuProperty.xhtml 2007-11-29 13:20:00 UTC (rev 4345)
@@ -0,0 +1,47 @@
+<f:subview id="contextMenuPropertySubviewID" xmlns:f="http://java.sun.com/jsf/core" xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:h="http://java.sun.com/jsf/html" xmlns:rich="http://richfaces.org/rich" xmlns:ui="http://java.sun.com/jsf/facelets">
+ <h:panelGrid columns="2" style="top">
+
+ <h:outputText value="event:" />
+ <h:selectOneMenu value="#{contextMenu.event}" onchange="submit();">
+ <f:selectItem itemLabel="oncontextmenu" itemValue="oncontextmenu" />
+ <f:selectItem itemLabel="onclick" itemValue="onclick" />
+ <f:selectItem itemLabel="onmousemove" itemValue="onmousemove" />
+ <f:selectItem itemLabel="onblur" itemValue="onblur" />
+ </h:selectOneMenu>
+
+ <h:outputText value="popupWidth:" />
+ <h:inputText value="#{contextMenu.popupWidth}">
+ <a4j:support event="onchange" reRender="contextMenuID"></a4j:support>
+ </h:inputText>
+
+ <h:outputText value="hideDelay:" />
+ <h:inputText value="#{contextMenu.hideDelay}">
+ <a4j:support event="onchange" reRender="contextMenuID"></a4j:support>
+ </h:inputText>
+
+ <h:outputText value="showDelay" />
+ <h:inputText value="#{contextMenu.showDelay}">
+ <a4j:support event="onchange" reRender="contextMenuID"></a4j:support>
+ </h:inputText>
+
+ <h:outputText value="submitMode:" onchange="submit();" />
+ <h:selectOneRadio value="#{contextMenu.submitMode}">
+ <f:selectItem itemLabel="server" itemValue="server" />
+ <f:selectItem itemLabel="client" itemValue="client" />
+ <f:selectItem itemLabel="ajax" itemValue="ajax" />
+ </h:selectOneRadio>
+
+ <h:outputText value="attached" />
+ <h:selectBooleanCheckbox value="#{contextMenu.attached}" onchange="submit();" />
+
+ <h:outputText value="disableDefaultMenu:" />
+ <h:selectBooleanCheckbox value="#{contextMenu.disableDefaultMenu}" onchange="submit();">
+ <a4j:support event="onchange" reRender="contextMenuID"></a4j:support>
+ </h:selectBooleanCheckbox>
+
+ <h:outputText value="rendered" />
+ <h:selectBooleanCheckbox value="#{contextMenu.rendered}" onchange="submit();">
+ </h:selectBooleanCheckbox>
+ </h:panelGrid>
+</f:subview>
\ No newline at end of file
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-11-29 12:01:11 UTC (rev 4344)
+++ branches/3.1.x/test-applications/facelets/src/main/webapp/OrderingList/OrderingList.xhtml 2007-11-29 13:20:00 UTC (rev 4345)
@@ -41,9 +41,16 @@
<h:column>
<f:facet name="header">
+ <h:outputText value="Input" />
+ </f:facet>
+ <h:inputText value="#{item.str1}" />
+ </h:column>
+
+ <h:column>
+ <f:facet name="header">
<h:outputText value="Link" />
</f:facet>
- <a4j:commandLink action="#{orderingList.clAction}" value="#{item.str1} immediate submit()"></a4j:commandLink>
+ <a4j:commandLink action="#{orderingList.clAction}" value="#{item.str1} submit()"></a4j:commandLink>
</h:column>
<h:column>
Modified: branches/3.1.x/test-applications/facelets/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- branches/3.1.x/test-applications/facelets/src/main/webapp/WEB-INF/faces-config.xml 2007-11-29 12:01:11 UTC (rev 4344)
+++ branches/3.1.x/test-applications/facelets/src/main/webapp/WEB-INF/faces-config.xml 2007-11-29 13:20:00 UTC (rev 4345)
@@ -2,11 +2,6 @@
<!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>
- <application>
- <locale-config>
- <default-locale>en</default-locale>
- </locale-config>
- </application>
<navigation-rule>
<from-view-id>/pages/main.xhtml</from-view-id>
<navigation-case>
@@ -173,4 +168,9 @@
<lifecycle>
<phase-listener id="phaseTracker">util.phaseTracker.PhaseTracker</phase-listener>
</lifecycle>
+ <application>
+ <locale-config>
+ <default-locale>en</default-locale>
+ </locale-config>
+ </application>
</faces-config>
Modified: branches/3.1.x/test-applications/facelets/src/main/webapp/pages/RichMenu/RichMenu.xhtml
===================================================================
--- branches/3.1.x/test-applications/facelets/src/main/webapp/pages/RichMenu/RichMenu.xhtml 2007-11-29 12:01:11 UTC (rev 4344)
+++ branches/3.1.x/test-applications/facelets/src/main/webapp/pages/RichMenu/RichMenu.xhtml 2007-11-29 13:20:00 UTC (rev 4345)
@@ -31,6 +31,7 @@
<h:selectOneMenu value="#{richBean.src}" onchange="submit();">
<f:selectItem itemValue="Blank" itemLabel="Blank" />
<f:selectItem itemValue="OrderingList" itemLabel="OrderingList" />
+ <f:selectItem itemValue="ContextMenu" itemLabel="ContextMenu" />
<f:selectItem itemValue="Calendar" itemLabel="Calendar" />
<f:selectItem itemValue="DataFilterSlider" itemLabel="Data Filter Slider" />
<f:selectItem itemValue="DataScroller" itemLabel="Date Scroller" />
17 years, 1 month
JBoss Rich Faces SVN: r4344 - trunk/ui/calendar/src/main/templates/org/richfaces.
by richfaces-svn-commits@lists.jboss.org
Author: akushunin
Date: 2007-11-29 07:01:11 -0500 (Thu, 29 Nov 2007)
New Revision: 4344
Modified:
trunk/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx
Log:
RF-1450
Modified: trunk/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx
===================================================================
--- trunk/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx 2007-11-29 11:21:10 UTC (rev 4343)
+++ trunk/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx 2007-11-29 12:01:11 UTC (rev 4344)
@@ -24,9 +24,7 @@
} else {
boolean disabled = getUtils().isBooleanAttribute(component, "disabled");
boolean showInput = getUtils().isBooleanAttribute(component, "showInput");
- boolean manualInput = getUtils().isBooleanAttribute(component, "enableManualInput");
- variables.setVariable("manualInput",new Boolean(!manualInput));
- String onfieldclick =null;
+ String onfieldclick =null;
String type="text";
if (!showInput){
type="hidden";
@@ -43,7 +41,7 @@
var="disabledIcon" /> <input id="#{clientId}InputDate"
name="#{clientId}InputDate"
value="#{this:getInputValue(context,component)}" type="#{type}"
- readonly="#{manualInput}" disabled="#{disabled}"
+ disabled="#{disabled}"
accesskey="#{component.attributes['accesskey']}"
maxlength="#{component.attributes['maxlength']}"
onchange="#{component.attributes['oninputchange']}"
@@ -57,7 +55,17 @@
size="#{component.attributes['inputSize']}"
style="vertical-align: middle; #{component.attributes['inputStyle']}"
class="rich-calendar-input #{component.attributes['inputClass']}"
- tabindex="#{component.attributes['tabindex']}"> </input> <jsp:scriptlet>
+ tabindex="#{component.attributes['tabindex']}">
+ <jsp:scriptlet>
+ <![CDATA[
+ boolean manualInput = getUtils().isBooleanAttribute(component, "enableManualInput");
+ if(!manualInput){
+ getUtils().writeAttribute(writer, "readonly", "readonly");
+ }
+ ]]>
+ </jsp:scriptlet>
+
+ </input> <jsp:scriptlet>
<![CDATA[
String buttonIcon = org.richfaces.component.util.ViewUtil.getResourceURL((String) component.getAttributes().get("buttonIcon"),context);
String buttonIconDisabled = org.richfaces.component.util.ViewUtil.getResourceURL((String) component.getAttributes().get("buttonIconDisabled"),context);
17 years, 1 month
JBoss Rich Faces SVN: r4343 - branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2007-11-29 06:21:10 -0500 (Thu, 29 Nov 2007)
New Revision: 4343
Modified:
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ListBase.js
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/OrderingList.js
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/SelectItem.js
Log:
bug:RF-1429
Modified: branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ListBase.js
===================================================================
--- branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ListBase.js 2007-11-29 10:40:41 UTC (rev 4342)
+++ branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ListBase.js 2007-11-29 11:21:10 UTC (rev 4343)
@@ -170,22 +170,10 @@
Richfaces.SelectItems.doActive(this.activeItem);
this.saveSate();
break;
- case 32 : this.invertSelection(event); break; //blank
+ //case 32 : this.invertSelection(event); break; //blank
}
},
- invertSelection : function(event) {
- var eventItem = this.activeItem;
- var eventShuttleItem = this.getSelectItemByNode(eventItem);
- if (eventShuttleItem._selected) {
- eventShuttleItem._selected = false;
- this.selectedItems.remove(eventShuttleItem);
- } else {
- eventShuttleItem._selected = true;
- this.selectedItems.push(eventShuttleItem);
- }
- },
-
moveActiveItem : function(action, event) {
var item = this.activeItem;
var rows = this.shuttleTbody.rows;
@@ -202,13 +190,10 @@
},
changeActiveItems : function(newItem, item) {
- var shuttleItem = this.getSelectItemByNode(item);
- var newShuttleItem = this.getSelectItemByNode(newItem);
-
this.resetMarked();
+ Richfaces.SelectItems.doSelect(newItem);
Richfaces.SelectItems.doActive(newItem);
- newItem._selected = true;
this.activeItem = newItem;
this.selectedItems.push(newItem);
},
@@ -223,41 +208,61 @@
* Click handler
*/
selectionItem : function(activeItem) {
- var markedItem = this.getSelectItemByNode(activeItem);
+ //var markedItem = this.getSelectItemByNode(activeItem);
var markedShuttleItem = activeItem;
- if (markedItem != null) {
+ //if (markedItem != null) {
this.resetMarked();
- if (markedItem._selected) {
+ /*if (markedItem._selected) {
markedItem._selected = false;
} else {
markedItem._selected = true;
this.selectedItems[0] = markedShuttleItem;
+ }*/
+ if (Richfaces.SelectItems.isSelected(activeItem)) {
+ Richfaces.SelectItems.doNormal(activeItem);
+ } else {
+ Richfaces.SelectItems.doSelect(activeItem);
+ this.selectedItems[0] = markedShuttleItem; //TODO: delete
}
- }
+ //}
},
/**
* CTRL+Click handler
*/
addSelectedItem : function(activeItem) {
- var markedItem = this.getSelectItemByNode(activeItem);
+ //var markedItem = this.getSelectItemByNode(activeItem);
var markedShuttleItem = activeItem;
- if (markedItem._selected) {
+ /*if (markedItem._selected) {
this.selectedItems.remove(markedShuttleItem);
markedItem._selected = false;
} else {
markedItem._selected = true;
this.selectedItems.push(markedShuttleItem);
+ }*/
+
+ if (Richfaces.SelectItems.isSelected(activeItem)) {
+ this.selectedItems.remove(markedShuttleItem); //TODO :delete
+ Richfaces.SelectItems.doNormal(activeItem);
+ } else {
+ Richfaces.SelectItems.doSelect(activeItem);
+ this.selectedItems.push(markedShuttleItem); //TODO :delete
}
- Richfaces.SelectItems.doSelect(this.activeItem);
+ if (this.activeItem.rowIndex != activeItem.rowIndex) {
+ //reset activity of an element
+ if (Richfaces.SelectItems.isSelected(this.activeItem)) {
+ Richfaces.SelectItems.doSelect(this.activeItem);
+ } else {
+ Richfaces.SelectItems.doNormal(this.activeItem);
+ }
+ }
- if (this.activeItem && !this.getSelectItemByNode(this.activeItem)._selected) {
+ /*if (this.activeItem && !this.getSelectItemByNode(this.activeItem)._selected) {
Richfaces.SelectItems.doNormal(this.activeItem);
- }
-
+ }*/
this.saveState();
},
@@ -288,7 +293,7 @@
for (var i = startIndex; i <= endIndex; i++) {
Richfaces.SelectItems.doSelect(rows[i]);
this.selectedItems.push(rows[i]);
- this.getSelectItemByNode(rows[i])._selected = true;
+ //this.getSelectItemByNode(rows[i])._selected = true;
}
this.saveState();
@@ -299,7 +304,7 @@
for (var i = 0; i < rows.length; i++) {
var shuttleItem = rows[i];
Richfaces.SelectItems.doNormal(shuttleItem);
- this.getSelectItemByNode(shuttleItem)._selected = false; //FIXME
+ //this.getSelectItemByNode(shuttleItem)._selected = false; //FIXME
}
this.selectedItems.length = 0;
},
Modified: branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/OrderingList.js
===================================================================
--- branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/OrderingList.js 2007-11-29 10:40:41 UTC (rev 4342)
+++ branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/OrderingList.js 2007-11-29 11:21:10 UTC (rev 4343)
@@ -33,9 +33,9 @@
var control;
//FIXME
this.controlsProcessing(["first", "last", "down", "up"], "enable");
- if ((this.shuttleItems.length <= 1) || (this.selectedItems.length == 0))
+ if ((this.shuttleItems.length == 0) || (this.selectedItems.length == 0)) {
this.controlsProcessing(["first", "last", "down", "up"], "disable");
- else {
+ } else {
if (this.selectedItems[0].rowIndex == 0)
this.controlsProcessing(["first", "up"], "disable");
if (this.selectedItems[this.selectedItems.length - 1].rowIndex == (this.shuttleItems.length - 1))
Modified: branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/SelectItem.js
===================================================================
--- branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/SelectItem.js 2007-11-29 10:40:41 UTC (rev 4342)
+++ branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/SelectItem.js 2007-11-29 11:21:10 UTC (rev 4343)
@@ -6,22 +6,27 @@
ROW : {
ACTIVE : "rich-ordering-list-row-active",
SELECTED : "rich-ordering-list-row-selected",
+ ACTIVE_SELECTED : "rich-ordering-list-row-selected rich-ordering-list-row-active",
DISABLED : "rich-ordering-list-row-disabled",
NORMAL : "rich-ordering-list-row"
},
CELL : {
ACTIVE : "rich-ordering-list-cell-active",
SELECTED : "rich-ordering-list-cell-selected",
+ ACTIVE_SELECTED : "rich-ordering-list-cell-selected rich-ordering-list-cell-active",
DISABLED : "rich-ordering-list-cell-disabled",
NORMAL : "rich-ordering-list-cell"
}
},
doActive : function(row) {
- Richfaces.SelectItems
- .doChange(row,
- Richfaces.SelectItems.CLASSES.ROW.ACTIVE,
- Richfaces.SelectItems.CLASSES.CELL.ACTIVE);
+ var newRowStyle = Richfaces.SelectItems.CLASSES.ROW.ACTIVE;
+ var newCellStyle = Richfaces.SelectItems.CLASSES.CELL.ACTIVE;
+ if (Element.hasClassName(row, Richfaces.SelectItems.CLASSES.ROW.SELECTED)) {
+ newRowStyle = Richfaces.SelectItems.CLASSES.ROW.ACTIVE_SELECTED;
+ newCellStyle = Richfaces.SelectItems.CLASSES.CELL.ACTIVE_SELECTED;
+ }
+ Richfaces.SelectItems.doChange(row, newRowStyle, newCellStyle);
},
doSelect : function(row) {
17 years, 1 month
JBoss Rich Faces SVN: r4342 - trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2007-11-29 05:40:41 -0500 (Thu, 29 Nov 2007)
New Revision: 4342
Modified:
trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js
Log:
syntax error in IE fix
Modified: trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js
===================================================================
--- trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js 2007-11-29 08:09:23 UTC (rev 4341)
+++ trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js 2007-11-29 10:40:41 UTC (rev 4342)
@@ -1798,7 +1798,7 @@
[
new E('td',{'class': 'rich-calendar-toolfooter', 'style':function(context){return (this.isEmpty ? 'display:none;' : '');}},
[
- new ET(function (context) { return Richfaces.evalMacro("selectedDateControl", context)}),
+ new ET(function (context) { return Richfaces.evalMacro("selectedDateControl", context)})
]),
new E('td',{'class': 'rich-calendar-toolfooter', 'style':function(context){return (this.isEmpty ? 'display:none;' : '');}},
[
17 years, 1 month
JBoss Rich Faces SVN: r4341 - in branches/3.1.x/test-applications/facelets/src/main: java/orderingList and 7 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: ayanul
Date: 2007-11-29 03:09:23 -0500 (Thu, 29 Nov 2007)
New Revision: 4341
Modified:
branches/3.1.x/test-applications/facelets/src/main/java/contextMenu/ContextMenu.java
branches/3.1.x/test-applications/facelets/src/main/java/orderingList/OrderingList.java
branches/3.1.x/test-applications/facelets/src/main/java/util/componentInfo/ComponentInfo.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/ContextMenu/ContextMenu.xhtml
branches/3.1.x/test-applications/facelets/src/main/webapp/DataTable/DataTable.xhtml
branches/3.1.x/test-applications/facelets/src/main/webapp/OrderingList/OrderingList.xhtml
branches/3.1.x/test-applications/facelets/src/main/webapp/OrderingList/OrderingListStraightforward.xhtml
branches/3.1.x/test-applications/facelets/src/main/webapp/WEB-INF/faces-config-ContextMenu.xml
branches/3.1.x/test-applications/facelets/src/main/webapp/pages/RichMenu/RichMenu.xhtml
Log:
update OrderingList, ContextMenu
Modified: branches/3.1.x/test-applications/facelets/src/main/java/contextMenu/ContextMenu.java
===================================================================
--- branches/3.1.x/test-applications/facelets/src/main/java/contextMenu/ContextMenu.java 2007-11-29 03:52:22 UTC (rev 4340)
+++ branches/3.1.x/test-applications/facelets/src/main/java/contextMenu/ContextMenu.java 2007-11-29 08:09:23 UTC (rev 4341)
@@ -1,5 +1,47 @@
package contextMenu;
public class ContextMenu {
+ private boolean disamble;
+ private String event;
+ private String mode;
+ private String param;
+
+ public String getParam() {
+ return param;
+ }
+ public void setParam(String param) {
+ this.param = param;
+ }
+
+ public ContextMenu() {
+ disamble = false;
+ event = "";
+ mode = "client";
+ }
+
+ public boolean isDisamble() {
+ return disamble;
+ }
+
+ public void setDisamble(boolean disamble) {
+ this.disamble = disamble;
+ }
+
+ public String getEvent() {
+ return event;
+ }
+
+ public void setEvent(String event) {
+ this.event = event;
+ }
+
+ public String getMode() {
+ return mode;
+ }
+
+ public void setMode(String mode) {
+ this.mode = mode;
+ }
+
}
Modified: branches/3.1.x/test-applications/facelets/src/main/java/orderingList/OrderingList.java
===================================================================
--- branches/3.1.x/test-applications/facelets/src/main/java/orderingList/OrderingList.java 2007-11-29 03:52:22 UTC (rev 4340)
+++ branches/3.1.x/test-applications/facelets/src/main/java/orderingList/OrderingList.java 2007-11-29 08:09:23 UTC (rev 4341)
@@ -2,18 +2,19 @@
import java.util.ArrayList;
import java.util.Collection;
-import java.util.Random;
+import java.util.Iterator;
-import javax.faces.event.ValueChangeEvent;
+import javax.faces.component.html.HtmlDataTable;
-import dataScroller.Data;
+import util.data.Data;
public class OrderingList{
+ private ArrayList<String> info;
private ArrayList<Data> list;
- private Collection<Data> selection;
- private String [] status = {"error", "fatal", "info", "passed", "warn"};
private String [] statusIcon = {"/pics/error.gif", "/pics/fatal.gif", "/pics/info.gif", "/pics/passed.gif", "/pics/warn.gif"};
private String captionLabel;
+ private Collection<Data> selection;
+ private String select;
private String controlsType;
private String controlsVerticalAlign;
private String controlsHorizontalAlign;
@@ -22,19 +23,15 @@
private String upControlLabel;
private String topControlLabel;
private String downControlLabel;
+ private String listHeight;
+ private String listWidth;
private int lenght;
- private int listHeight;
- private int listWidth;
private boolean orderControlsVisible;
private boolean fastOrderControlsVisible;
private boolean rendered;
private boolean showButtonLabels;
private boolean facet;
- public void clSelect(ValueChangeEvent event) {
- System.out.println(event.getNewValue());
- }
-
public boolean isFacet() {
return facet;
}
@@ -49,6 +46,8 @@
public void setSelection(Collection<Data> selection) {
System.out.println("Selection.out: " + selection);
+ info.clear();
+ addSelection();
this.selection = selection;
}
@@ -67,14 +66,15 @@
list.remove(i);
else
for(int i = list.size() + 1; i <= lenght; i++)
- list.add(new Data("Bug " + new Random().nextInt(10 + i), i,status[new Random().nextInt(5)], statusIcon[new Random().nextInt(5)]));
+ list.add(new Data(i, "Button " + i, "Link " + i, "select" +(i % 5), statusIcon[i % 5]));
}
public OrderingList() {
+ info = new ArrayList<String>();
captionLabel = "captionLabel";
lenght = 10;
- listHeight = 300;
- listWidth = 400;
+ listHeight = "300";
+ listWidth = "400";
controlsType = "button";
controlsHorizontalAlign = "0";
controlsVerticalAlign = "0";
@@ -89,22 +89,22 @@
showButtonLabels = true;
list = new ArrayList<Data>();
for(int i = 1; i <= lenght; i++)
- list.add(new Data("Bug " + new Random().nextInt(10 + i), i,status[new Random().nextInt(5)], statusIcon[new Random().nextInt(5)]));
+ list.add(new Data(i, "Button " + i, "Link " + i, "select" +(i % 5), statusIcon[i % 5]));
}
- public int getListHeight() {
+ public String getListHeight() {
return listHeight;
}
- public void setListHeight(int listHeight) {
+ public void setListHeight(String listHeight) {
this.listHeight = listHeight;
}
- public int getListWidth() {
+ public String getListWidth() {
return listWidth;
}
- public void setListWidth(int listWidth) {
+ public void setListWidth(String listWidth) {
this.listWidth = listWidth;
}
@@ -220,6 +220,18 @@
this.lenght = lenght;
}
+ public void cbAction() {
+ info.clear();
+ info.add("commandButton submit();");
+ addSelection();
+ }
+
+ public void clAction() {
+ info.clear();
+ info.add("commandLink immediate submit();");
+ addSelection();
+ }
+
public void bTest1(){
setCaptionLabel("Caption Test1");
setControlsHorizontalAlign("0");
@@ -227,8 +239,8 @@
setControlsType("button");
setHeaderLabel("Header Test1");
setLenght(40);
- setListHeight(300);
- setListWidth(400);
+ setListHeight("300");
+ setListWidth("400");
setFastOrderControlsVisible(true);
setOrderControlsVisible(true);
setRendered(true);
@@ -247,8 +259,8 @@
setControlsType("button");
setHeaderLabel("Header Test2");
setLenght(40);
- setListHeight(600);
- setListWidth(400);
+ setListHeight("600");
+ setListWidth("400");
setFastOrderControlsVisible(false);
setOrderControlsVisible(true);
setRendered(true);
@@ -267,8 +279,8 @@
setControlsType("button");
setHeaderLabel("Header Test3");
setLenght(40);
- setListHeight(500);
- setListWidth(500);
+ setListHeight("500");
+ setListWidth("500");
setFastOrderControlsVisible(true);
setOrderControlsVisible(false);
setRendered(true);
@@ -287,8 +299,8 @@
setControlsType("button");
setHeaderLabel("Header Test4");
setLenght(10000);
- setListHeight(500);
- setListWidth(600);
+ setListHeight("500");
+ setListWidth("600");
setFastOrderControlsVisible(true);
setOrderControlsVisible(true);
setRendered(true);
@@ -307,8 +319,8 @@
setControlsType("none");
setHeaderLabel("Header Test5");
setLenght(100);
- setListHeight(400);
- setListWidth(500);
+ setListHeight("400");
+ setListWidth("500");
setFastOrderControlsVisible(true);
setOrderControlsVisible(true);
setRendered(true);
@@ -319,4 +331,29 @@
setDownControlLabel("down");
addNewItem();
}
+
+ public String getSelect() {
+ return select;
+ }
+
+ public void setSelect(String select) {
+ this.select = select;
+ }
+
+ public ArrayList<String> getInfo() {
+ return info;
+ }
+
+ public void setInfo(ArrayList<String> info) {
+ this.info = info;
+ }
+
+ private void addSelection() {
+ Iterator<Data> inter = selection.iterator();
+ Data data = new Data();
+ while (inter.hasNext()) {
+ data = inter.next();
+ info.add(data.getInt0() + "; " + data.getStr0() + "; " + data.getStr1() + "; " + data.getStr2() + "; " + data.getStr3());
+ }
+ }
}
Modified: branches/3.1.x/test-applications/facelets/src/main/java/util/componentInfo/ComponentInfo.java
===================================================================
--- branches/3.1.x/test-applications/facelets/src/main/java/util/componentInfo/ComponentInfo.java 2007-11-29 03:52:22 UTC (rev 4340)
+++ branches/3.1.x/test-applications/facelets/src/main/java/util/componentInfo/ComponentInfo.java 2007-11-29 08:09:23 UTC (rev 4341)
@@ -6,6 +6,7 @@
public class ComponentInfo {
private final String beanName;
+ private String description;
private String attribute;
private String property;
private boolean print;
@@ -20,9 +21,17 @@
public void setComponentInfo(String attribute, String property) {
this.attribute = attribute;
this.property = property;
+ this.description = "";
if(print) printInfo();
}
+ public void setComponentInfo(String attribute, String property, String description) {
+ this.attribute = attribute;
+ this.property = property;
+ this.description = description;
+ if(print) printInfo();
+ }
+
public static String toString(Object obj) {
Class cl = obj.getClass();
String r = cl.getName() + "[";
@@ -73,6 +82,14 @@
}
private void printInfo() {
- System.out.println("beanName: " + beanName + "[attribute:" + attribute + "; property:" + property + "];");
+ System.out.println("beanName: " + beanName + "[attribute: " + attribute + "; property: " + property + "; description: " + description + "];");
}
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
}
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-11-29 03:52:22 UTC (rev 4340)
+++ branches/3.1.x/test-applications/facelets/src/main/java/util/data/Data.java 2007-11-29 08:09:23 UTC (rev 4341)
@@ -25,6 +25,10 @@
private boolean bool2;
private boolean bool3;
+ public Data() {
+
+ }
+
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) {
@@ -50,6 +54,14 @@
this.str3 = str3;
}
+ public Data(int int0, String str0, String str1, String str2, String str3){
+ this.int0 = int0;
+ this.str0 = str0;
+ this.str1 = str1;
+ this.str2 = str2;
+ this.str3 = str3;
+ }
+
public Data(String str0){
this.str0 = str0;
}
Modified: branches/3.1.x/test-applications/facelets/src/main/webapp/ContextMenu/ContextMenu.xhtml
===================================================================
--- branches/3.1.x/test-applications/facelets/src/main/webapp/ContextMenu/ContextMenu.xhtml 2007-11-29 03:52:22 UTC (rev 4340)
+++ branches/3.1.x/test-applications/facelets/src/main/webapp/ContextMenu/ContextMenu.xhtml 2007-11-29 08:09:23 UTC (rev 4341)
@@ -1,16 +1,65 @@
-<f:subview id="calendarSubviewID" 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">
+<f:subview id="contextMenuSubviewID" 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:form>
<!-- rich:contextMenu id="" attached="" event="" disableDefaultMenu="" rendered="" submitMode=""></rich:contextMenu-->
- <rich:panel style="width:200px; hieght:100px;" >
- <h:outputText value="text" />
- <rich:contextMenu id="contextMenu" submitMode="client">
- <rich:menuItem value="a"></rich:menuItem>
- <rich:menuItem value="b"></rich:menuItem>
- <rich:menuItem value="c"></rich:menuItem>
- </rich:contextMenu>
+ <rich:panel style="width: 120px; height: 50px; background-color: #98FB98;">
+ <h:outputText value="panel with contextMenu(default)" />
+ <rich:contextMenu id="contextMenuDefaultID" submitMode="client">
+ <rich:menuItem icon="/pics/header.png" value="abc">
+ <f:param name="cmdParam" value="abc" />
+ </rich:menuItem>
+ <rich:menuSeparator />
+ <rich:menuItem icon="/pics/info.gif" value="a">
+ <f:param name="cmdParam" value="a" />
+ </rich:menuItem>
+ <rich:menuItem icon="/pics/info.gif" value="{cmdParam} b">
+ <f:param name="cmdParam" value="b" />
+ </rich:menuItem>
+ <rich:menuItem icon="/pics/info.gif" value="c">
+ <f:param name="cmdParam" value="c" />
+ </rich:menuItem>
+ <rich:menuItem icon="/pics/info.gif" value="d" data="cmdParam:aaaa">
+ <f:param name="cmdParam" value="d" />
+ </rich:menuItem>
+ </rich:contextMenu>
+ <a4j:outputPanel ajaxRendered="true">
+ #{cmdParam}
+ </a4j:outputPanel>
+ <h:commandButton value="aaa" onclick="alert(event.parameters.cmdParam);" />
</rich:panel>
+ <h:panelGrid id="pgcmTestID" columns="3">
+ <rich:panel id="pcmTestID" style="width: 80px; height: 45px; background-color: #F5F5DC;">
+ <h:outputText value="rich:panel" />
+ </rich:panel>
+
+ <rich:tabPanel id="tpcmTestID" switchType="client">
+ <rich:tab id="t1cmTestID" label="tab1">
+ <h:outputText value="text1" />
+ </rich:tab>
+ <rich:tab id="t2cmTestID" label="tab2">
+ <h:outputText value="text2" />
+ </rich:tab>
+ <rich:tab id="t3cmTestID" label="tab3">
+ <h:outputText value="text3" />
+ </rich:tab>
+ </rich:tabPanel>
+
+ <h:graphicImage id="gicmID" value="/pics/asus.jpg" height="125px" width="150px">
+ </h:graphicImage>
+
+ <h:inputText id="itcmTestID" value="inputText">
+ </h:inputText>
+
+ <f:verbatim>
+ <div id="divcmTestID" style="width: 80px; height: 45px; background-color: #F5F5DC;"><span> div </span></div>
+ </f:verbatim>
+
+ <h:panelGrid id="pgTestID" columns="1" border="5" cellpadding="2" cellspacing="2">
+ <h:outputText value="panelGrid" />
+ <h:outputText value="" />
+ </h:panelGrid>
+ </h:panelGrid>
</h:form>
</f:subview>
\ No newline at end of file
Modified: branches/3.1.x/test-applications/facelets/src/main/webapp/DataTable/DataTable.xhtml
===================================================================
--- branches/3.1.x/test-applications/facelets/src/main/webapp/DataTable/DataTable.xhtml 2007-11-29 03:52:22 UTC (rev 4340)
+++ branches/3.1.x/test-applications/facelets/src/main/webapp/DataTable/DataTable.xhtml 2007-11-29 08:09:23 UTC (rev 4341)
@@ -52,6 +52,12 @@
<h:outputText value="#{dataTableID.day}" />
</rich:column>
<rich:subTable id="detail" var="detail" value="#{dataTableID.detail}">
+ <f:facet name="header">
+ <h:outputText value="facet(header)" />
+ </f:facet>
+ <f:facet name="footer">
+ <h:outputText value="facet(footer)" />
+ </f:facet>
<rich:column id="name">
<h:outputText value="#{detail.name}" />
</rich:column>
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-11-29 03:52:22 UTC (rev 4340)
+++ branches/3.1.x/test-applications/facelets/src/main/webapp/OrderingList/OrderingList.xhtml 2007-11-29 08:09:23 UTC (rev 4341)
@@ -2,6 +2,7 @@
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" />
+
<rich:orderingList id="orderingListID" value="#{orderingList.list}" var="item" listHeight="#{orderingList.listHeight}"
listWidth="#{orderingList.listWidth}" controlsType="#{orderingList.controlsType}"
bottomControlLabel="#{orderingList.bottomControlLabel}" captionLabel="#{orderingList.captionLabel}"
@@ -9,42 +10,68 @@
controlsHorizontalAlign="#{orderingList.controlsHorizontalAlign}" controlsVerticalAlign="#{orderingList.controlsVerticalAlign}"
headerLabel="#{orderingList.headerLabel}" downControlLabel="#{orderingList.downControlLabel}"
orderControlsVisible="#{orderingList.orderControlsVisible}" fastOrderControlsVisible="#{orderingList.fastOrderControlsVisible}"
- rendered="#{orderingList.rendered}" showButtonLabels="#{orderingList.showButtonLabels}"
- selection="#{orderingList.selection}">
+ rendered="#{orderingList.rendered}" showButtonLabels="#{orderingList.showButtonLabels}" selection="#{orderingList.selection}">
+ <f:facet name="header">
+ <h:outputText value="header" />
+ </f:facet>
+ <f:facet name="footer">
+ <h:outputText value="footer" />
+ </f:facet>
<h:column width="100px">
<f:facet name="header">
<h:outputText value="Number" />
</f:facet>
- <h:outputText value="#{item.data1}" />
+ <h:outputText value="#{item.int0}" />
</h:column>
- <h:column width="100px">
+ <h:column>
<f:facet name="header">
- <h:outputText value="Name" />
+ <h:outputText value="Input" />
</f:facet>
- <h:outputText value="#{item.data0}" />
+ <h:inputText value="#{item.str0}" />
</h:column>
<h:column width="100px">
<f:facet name="header">
- <h:outputText value="Status" />
+ <h:outputText value="Button" />
</f:facet>
- <h:selectOneMenu valueChangeListener="#{orderingList.clSelect}">
- <f:selectItem itemLabel="error" itemValue="error" />
- <f:selectItem itemLabel="fatal" itemValue="fatal" />
- <f:selectItem itemLabel="info" itemValue="info" />
- <f:selectItem itemLabel="passed" itemValue="passed" />
- <f:selectItem itemLabel="warn" itemValue="warn" />
+ <h:commandButton onclick="submit();" action="#{orderingList.cbAction}" value="#{item.str0} submit();" />
+ </h:column>
+
+ <h:column>
+ <f:facet name="header">
+ <h:outputText value="Link" />
+ </f:facet>
+ <a4j:commandLink action="#{orderingList.clAction}" value="#{item.str1} immediate submit()"></a4j:commandLink>
+ </h:column>
+
+ <h:column>
+ <f:facet name="header">
+ <h:outputText value="select" />
+ </f:facet>
+ <h:selectOneMenu value="#{item.str2}">
+ <f:selectItem itemLabel="select0" itemValue="select5" />
+ <f:selectItem itemLabel="select1" itemValue="select1" />
+ <f:selectItem itemLabel="select2" itemValue="select2" />
+ <f:selectItem itemLabel="select3" itemValue="select3" />
+ <f:selectItem itemLabel="select4" itemValue="select4" />
<a4j:support event="onclick" action="submit();"></a4j:support>
</h:selectOneMenu>
</h:column>
- <h:column width="30px">
+ <h:column>
<f:facet name="header">
- <h:outputText value="Icon" />
+ <h:outputText value="Text" />
</f:facet>
- <h:graphicImage value="#{item.data3}" />
+ <h:outputText value="#{item.str3}" />
</h:column>
+
+ <h:column>
+ <f:facet name="header">
+ <h:outputText value="graphicImage" />
+ </f:facet>
+ <h:graphicImage value="#{item.str3}" />
+ </h:column>
</rich:orderingList>
</f:subview>
\ No newline at end of file
Modified: branches/3.1.x/test-applications/facelets/src/main/webapp/OrderingList/OrderingListStraightforward.xhtml
===================================================================
--- branches/3.1.x/test-applications/facelets/src/main/webapp/OrderingList/OrderingListStraightforward.xhtml 2007-11-29 03:52:22 UTC (rev 4340)
+++ branches/3.1.x/test-applications/facelets/src/main/webapp/OrderingList/OrderingListStraightforward.xhtml 2007-11-29 08:09:23 UTC (rev 4341)
@@ -4,28 +4,40 @@
<h:panelGrid columns="3">
<h:outputText value="Test1" />
<a4j:commandButton action="#{orderingList.bTest1}" value="run" reRender="orderingListPropertyID,orderingListID"></a4j:commandButton>
- <h:outputText value="#{msg.t1OrderingList}"/>
+ <h:outputText value="#{msg.t1OrderingList}" />
<h:outputText value="Test2" />
<a4j:commandButton action="#{orderingList.bTest2}" value="run" reRender="orderingListPropertyID,orderingListID"></a4j:commandButton>
- <h:outputText value="#{msg.t2OrderingList}"/>
+ <h:outputText value="#{msg.t2OrderingList}" />
<h:outputText value="Test3" />
<a4j:commandButton action="#{orderingList.bTest3}" value="run" reRender="orderingListPropertyID,orderingListID"></a4j:commandButton>
- <h:outputText value="#{msg.t3OrderingList}"/>
+ <h:outputText value="#{msg.t3OrderingList}" />
<h:outputText value="Test4" />
<a4j:commandButton action="#{orderingList.bTest4}" value="run" reRender="orderingListPropertyID,orderingListID"></a4j:commandButton>
- <h:outputText value="#{msg.t4OrderingList}"/>
+ <h:outputText value="#{msg.t4OrderingList}" />
<h:outputText value="Test5" />
<a4j:commandButton action="#{orderingList.bTest5}" value="run" reRender="orderingListPropertyID,orderingListID"></a4j:commandButton>
- <h:outputText value="#{msg.t5OrderingList}"/>
-
- <a4j:commandButton value="reRender" reRender="orderingListID"></a4j:commandButton>
- <a4j:commandButton action="submit();" value="a4j submit();"></a4j:commandButton>
- <h:commandButton action="submit();" value="submit();" />
- <h:commandButton action="submit();" immediate="true" value="immediate submit();" />
+ <h:outputText value="#{msg.t5OrderingList}" />
+
+ <a4j:commandButton value="Show selection" reRender="infoPanelID"></a4j:commandButton>
+ <h:column></h:column>
+ <h:column>
+ <h:dataTable id="infoPanelID" value="#{orderingList.info}" var="info" rendered="true">
+ <h:column>
+ <h:outputText value="#{info}" />
+ </h:column>
+ </h:dataTable>
+ </h:column>
+
+ <h:panelGroup>
+ <a4j:commandButton value="reRender" reRender="orderingListID"></a4j:commandButton>
+ <a4j:commandButton action="submit();" value="a4j submit();"></a4j:commandButton>
+ <h:commandButton action="submit();" value="submit();" />
+ <h:commandButton action="submit();" immediate="true" value="immediate submit();" />
+ </h:panelGroup>
</h:panelGrid>
</rich:simpleTogglePanel>
</f:subview>
\ No newline at end of file
Modified: branches/3.1.x/test-applications/facelets/src/main/webapp/WEB-INF/faces-config-ContextMenu.xml
===================================================================
--- branches/3.1.x/test-applications/facelets/src/main/webapp/WEB-INF/faces-config-ContextMenu.xml 2007-11-29 03:52:22 UTC (rev 4340)
+++ branches/3.1.x/test-applications/facelets/src/main/webapp/WEB-INF/faces-config-ContextMenu.xml 2007-11-29 08:09:23 UTC (rev 4341)
@@ -4,7 +4,7 @@
<faces-config>
<managed-bean>
<managed-bean-name>contextMenu</managed-bean-name>
- <managed-bean-class>ContextMenu.ContextMenu</managed-bean-class>
+ <managed-bean-class>contextMenu.ContextMenu</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/pages/RichMenu/RichMenu.xhtml
===================================================================
--- branches/3.1.x/test-applications/facelets/src/main/webapp/pages/RichMenu/RichMenu.xhtml 2007-11-29 03:52:22 UTC (rev 4340)
+++ branches/3.1.x/test-applications/facelets/src/main/webapp/pages/RichMenu/RichMenu.xhtml 2007-11-29 08:09:23 UTC (rev 4341)
@@ -1,6 +1,9 @@
<h:form id="forvDivOpthID" xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html" xmlns:rich="http://richfaces.org/rich" xmlns:a4j="http://richfaces.org/a4j">
- <h:panelGrid columns="3">
+ <h:panelGrid columns="4" border="1">
+ <h:column>
+ <a4j:status startText="WORK!" startStyle="color: red;" stopText="a4j:status"></a4j:status>
+ </h:column>
<h:panelGrid columns="1">
<h:panelGroup>
<h:outputText value="#{richBean.reComponent ? 'Component hide' : 'Component show'}" />
17 years, 1 month
JBoss Rich Faces SVN: r4340 - in branches/3.1.x/sandbox/ui/listShuttle/src/main: templates/org/richfaces and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-11-28 22:52:22 -0500 (Wed, 28 Nov 2007)
New Revision: 4340
Modified:
branches/3.1.x/sandbox/ui/listShuttle/src/main/java/org/richfaces/renderkit/ListShuttleRendererBase.java
branches/3.1.x/sandbox/ui/listShuttle/src/main/templates/org/richfaces/htmlListShuttle.jspx
Log:
latest changes for listShuttle
Modified: branches/3.1.x/sandbox/ui/listShuttle/src/main/java/org/richfaces/renderkit/ListShuttleRendererBase.java
===================================================================
--- branches/3.1.x/sandbox/ui/listShuttle/src/main/java/org/richfaces/renderkit/ListShuttleRendererBase.java 2007-11-29 03:45:55 UTC (rev 4339)
+++ branches/3.1.x/sandbox/ui/listShuttle/src/main/java/org/richfaces/renderkit/ListShuttleRendererBase.java 2007-11-29 03:52:22 UTC (rev 4340)
@@ -4,6 +4,7 @@
package org.richfaces.renderkit;
import java.io.IOException;
+import java.io.StringWriter;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
@@ -29,6 +30,8 @@
*/
public abstract class ListShuttleRendererBase extends OrderingComponentRendererBase {
+ protected static final String SELECTION_STATE_VAR_NAME = "selectionState";
+
public final static String FACET_SOURCE_CAPTION = "sourceCaption";
public final static String FACET_TARGET_CAPTION = "targetCaption";
@@ -58,29 +61,33 @@
super(MESSAGE_BUNDLE_NAME);
}
+ public void encodeSLCaption(FacesContext context, UIOrderingBaseComponent shuttle) throws IOException {
+ encodeCaption(context, shuttle, FACET_SOURCE_CAPTION, "ol_label ol_out_label rich-ordering-list-caption");
+ }
+
public void encodeTLCaption(FacesContext context, UIComponent shuttle) throws IOException {
encodeCaption(context, shuttle, FACET_TARGET_CAPTION, "ol_label ol_out_label rich-ordering-list-caption");
}
- public void encodeTLHeader(FacesContext context, UIOrderingBaseComponent shuttle) throws IOException {
+ public void encodeSLHeader(FacesContext context, UIOrderingBaseComponent shuttle) throws IOException {
encodeHeader(context, shuttle, "rich-table-header", "ol_col rich-table-header-cell", "sourceHeaderClass");
}
- public void encodeTLRows(FacesContext context, UIOrderingBaseComponent shuttle) throws IOException {
- encodeRows(context, shuttle, new ListShuttleRendererTableHolder(shuttle, false));
+ public void encodeTLHeader(FacesContext context, UIOrderingBaseComponent shuttle) throws IOException {
+ encodeHeader(context, shuttle, "rich-table-header", "ol_col rich-table-header-cell", "sourceHeaderClass");
}
- public void encodeSLCaption(FacesContext context, UIOrderingBaseComponent shuttle) throws IOException {
- encodeCaption(context, shuttle, FACET_SOURCE_CAPTION, "ol_label ol_out_label rich-ordering-list-caption");
+ protected String encodeRows(FacesContext context, UIOrderingBaseComponent shuttle, boolean source) throws IOException {
+ ResponseWriter writer = context.getResponseWriter();
+ StringWriter stringWriter = new StringWriter();
+ context.setResponseWriter(writer.cloneWithWriter(stringWriter));
+ encodeRows(context, shuttle, new ListShuttleRendererTableHolder(shuttle, source));
+ context.getResponseWriter().flush();
+ context.setResponseWriter(writer);
+
+ return stringWriter.getBuffer().toString();
}
- public void encodeSLHeader(FacesContext context, UIOrderingBaseComponent shuttle) throws IOException {
- encodeHeader(context, shuttle, "rich-table-header", "ol_col rich-table-header-cell", "sourceHeaderClass");
- }
- public void encodeSLRows(FacesContext context, UIOrderingBaseComponent shuttle) throws IOException {
- encodeRows(context, shuttle, new ListShuttleRendererTableHolder(shuttle, true));
- }
-
public void encodeOneRow(FacesContext context, TableHolder holder)
throws IOException {
UIListShuttle table = (UIListShuttle) holder.getTable();
@@ -98,14 +105,21 @@
StringBuffer cellClassName = new StringBuffer("ol_cell rich-ordering-list-cell");
ComponentVariables variables = ComponentsVariableResolver.getVariables(this, table);
+ SelectionState selectionState = (SelectionState) variables.getVariable(SELECTION_STATE_VAR_NAME);
ItemState itemState = getItemState(context, table, variables);
boolean active = itemState.isActive();
if (active) {
-
+ rowClassName.append(" rich-ordering-list-row-active");
+ cellClassName.append(" rich-ordering-list-cell-active");
}
boolean selected = itemState.isSelected();
+ selectionState.addState(selected);
+ if (selected) {
+ rowClassName.append(" rich-ordering-list-row-selected");
+ cellClassName.append(" rich-ordering-list-cell-selected");
+ }
writer.writeAttribute("class", rowClassName.toString(), null);
@@ -138,39 +152,56 @@
}
}
- public void encodeShuttleControlsFacets(FacesContext context, UIOrderingBaseComponent component)
+ public void encodeShuttleControlsFacets(FacesContext context, UIOrderingBaseComponent component,
+ SelectionState sourceSelectionState, SelectionState targetSelectionState)
throws IOException {
String clientId = component.getClientId(context);
- encodeControlsFacets(context, component, SHUTTLE_HELPERS, clientId);
+
+ ResponseWriter writer = context.getResponseWriter();
+
+ int divider = SHUTTLE_HELPERS.length / 2;
+
+ int metric;
+ for (int i = 0; i < SHUTTLE_HELPERS.length; i++) {
+ metric = Math.abs(i - divider) / 2;
+ SelectionState state = (i < divider ? sourceSelectionState : targetSelectionState);
+
+ boolean enabled;
+ if (metric <= 1) {
+ enabled = state.isSelected();
+ } else {
+ enabled = state.isItemExist();
+ }
+
+ if (i % 2 == 1) {
+ enabled = !enabled;
+ }
+
+ if (SHUTTLE_HELPERS[i].isRendered(context, component)) {
+ //proper assumption about helpers ordering
+ encodeControlFacet(context, component, SHUTTLE_HELPERS[i], clientId, writer, enabled);
+ }
+ }
}
- public void encodeTLControlsFacets(FacesContext context, UIOrderingBaseComponent component)
+ public void encodeTLControlsFacets(FacesContext context, UIOrderingBaseComponent component, SelectionState selectionState)
throws IOException {
String clientId = component.getClientId(context);
- encodeControlsFacets(context, component, TL_HELPERS, clientId);
- }
-
- protected void encodeControlsFacets(FacesContext context, UIOrderingBaseComponent component, OrderingComponentRendererBase.ControlsHelper[] helpers ,String clientId)
- throws IOException {
+
ResponseWriter writer = context.getResponseWriter();
- //proper assumption about helpers ordering
- int divider = helpers.length / 2;
+ int divider = TL_HELPERS.length / 2;
- ComponentVariables variables = ComponentsVariableResolver.getVariables(this, component);
- //OrderingListSelectionState selectionState = (OrderingListSelectionState) variables.getVariable(SELECTION_STATE_VAR_NAME);
-
- for (int i = 0; i < helpers.length; i++) {
- //boolean boundarySelection = i < divider ? selectionState.isFirstSelected() : selectionState.isLastSelected();
- //boolean enabled = selectionState.isSelected() && !boundarySelection;
- boolean enabled = true;
+ for (int i = 0; i < TL_HELPERS.length; i++) {
+ boolean boundarySelection = i < divider ? selectionState.isFirstSelected() : selectionState.isLastSelected();
+ boolean enabled = selectionState.isSelected() && !boundarySelection;
if (i % 2 == 1) {
enabled = !enabled;
}
- if (helpers[i].isRendered(context, component)) {
+ if (TL_HELPERS[i].isRendered(context, component)) {
//proper assumption about helpers ordering
- encodeControlFacet(context, component, helpers[i], clientId, writer, enabled);
+ encodeControlFacet(context, component, TL_HELPERS[i], clientId, writer, enabled);
}
}
}
Modified: branches/3.1.x/sandbox/ui/listShuttle/src/main/templates/org/richfaces/htmlListShuttle.jspx
===================================================================
--- branches/3.1.x/sandbox/ui/listShuttle/src/main/templates/org/richfaces/htmlListShuttle.jspx 2007-11-29 03:45:55 UTC (rev 4339)
+++ branches/3.1.x/sandbox/ui/listShuttle/src/main/templates/org/richfaces/htmlListShuttle.jspx 2007-11-29 03:52:22 UTC (rev 4340)
@@ -4,11 +4,15 @@
xmlns:c=" http://java.sun.com/jsf/core"
xmlns:ui=" http://ajax4jsf.org/cdk/ui"
xmlns:u=" http://ajax4jsf.org/cdk/u"
+ xmlns:jsp=" http://ajax4jsf.org/cdk/jsp"
xmlns:x=" http://ajax4jsf.org/cdk/x"
baseclass="org.richfaces.renderkit.ListShuttleRendererBase"
class="org.richfaces.renderkit.html.ListShuttleRenderer"
component="org.richfaces.component.UIListShuttle"
>
+
+ <jsp:directive.page import="org.richfaces.renderkit.OrderingComponentRendererBase" />
+
<h:styles>css/listShuttle.xcss</h:styles>
<h:scripts>
@@ -26,6 +30,17 @@
<f:clientId var="clientId"/>
<vcp:body>
<f:clientId var="clientId"/>
+ <jsp:scriptlet>
+ <![CDATA[
+ SelectionState sourceSelectionState = new SelectionState();
+ variables.setVariable(SELECTION_STATE_VAR_NAME, sourceSelectionState);
+ String encodedSourceRows = encodeRows(context, component, true);
+
+ SelectionState targetSelectionState = new SelectionState();
+ variables.setVariable(SELECTION_STATE_VAR_NAME, targetSelectionState);
+ String encodedTargetRows = encodeRows(context, component, false);
+ ]]>
+ </jsp:scriptlet>
<table id="#{clientId}">
<tr>
<td>
@@ -52,7 +67,10 @@
<div id="#{clientId}contentBox" class="ol_list_content" style="width: #{component.attributes['listWidth']}px; height:#{component.attributes['listHeight']}px;">
<table id="#{clientId}internal_tab" class="ol_internal_tab" cellpadding="0" cellspacing="0">
<tbody id="#{clientId}tbody">
- <f:call name="encodeSLRows" />
+ <jsp:scriptlet><![CDATA[
+ writer.write(encodedSourceRows);
+ encodedSourceRows = null;
+ ]]></jsp:scriptlet>
</tbody>
</table>
</div>
@@ -65,17 +83,11 @@
</td>
<td>
<div class="shuttle_button_layout">
- <f:call name="encodeShuttleControlsFacets" />
+ <jsp:scriptlet><![CDATA[
+ encodeShuttleControlsFacets(context, component, sourceSelectionState, targetSelectionState);
+ ]]></jsp:scriptlet>
</div>
- <!-- a id="#{clientId}copy" href="#">copy</a><br/>
- <a id="#{clientId}disCopy" href="#">dcopy</a><br/>
- <a id="#{clientId}copyAll" href="#">copyAll</a><br/>
- <a id="#{clientId}disCopyAll" href="#">dcopyAll</a><br/>
- <a id="#{clientId}remove" href="#">remove</a><br/>
- <a id="#{clientId}disRemove" href="#">dremove</a><br/>
- <a id="#{clientId}removeAll" href="#">removeAll</a><br/>
- <a id="#{clientId}disRemoveAll" href="#">dremoveAll</a-->
</td>
<td>
<div>
@@ -99,7 +111,10 @@
<div id="#{clientId}tlContentBox" class="ol_list_content" style="width: #{component.attributes['listWidth']}px; height:#{component.attributes['listHeight']}px;">
<table id="#{clientId}tlInternal_tab" class="ol_internal_tab" cellpadding="0" cellspacing="0">
<tbody id="#{clientId}tlTbody">
- <f:call name="encodeTLRows" />
+ <jsp:scriptlet><![CDATA[
+ writer.write(encodedTargetRows);
+ encodedTargetRows = null;
+ ]]></jsp:scriptlet>
</tbody>
</table>
</div>
@@ -107,7 +122,9 @@
</td>
<td class="ol_center_button_col_valign">
<div class="shuttle_button_layout rich-ordering-controls">
- <f:call name="encodeTLControlsFacets" />
+ <jsp:scriptlet><![CDATA[
+ encodeTLControlsFacets(context, component, targetSelectionState);
+ ]]></jsp:scriptlet>
</div>
</td>
</tr>
17 years, 1 month