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" />