Author: maksimkaszynski
Date: 2007-11-28 15:15:21 -0500 (Wed, 28 Nov 2007)
New Revision: 4332
Added:
branches/3.1.x/samples/contextMenuDemo/src/main/webapp/icons/
branches/3.1.x/samples/contextMenuDemo/src/main/webapp/icons/ico1.gif
branches/3.1.x/samples/contextMenuDemo/src/main/webapp/icons/ico2.gif
Modified:
branches/3.1.x/samples/contextMenuDemo/pom.xml
branches/3.1.x/samples/contextMenuDemo/src/main/java/org/richfaces/Bean.java
branches/3.1.x/samples/contextMenuDemo/src/main/webapp/pages/index.jsp
Log:
Extended demo and added several attributes
Modified: branches/3.1.x/samples/contextMenuDemo/pom.xml
===================================================================
--- branches/3.1.x/samples/contextMenuDemo/pom.xml 2007-11-28 19:58:07 UTC (rev 4331)
+++ branches/3.1.x/samples/contextMenuDemo/pom.xml 2007-11-28 20:15:21 UTC (rev 4332)
@@ -27,7 +27,7 @@
<version>3.1.3-SNAPSHOT</version>
</dependency>
<dependency>
- <groupId>org.richfaces.sandbox.ui</groupId>
+ <groupId>org.richfaces.ui</groupId>
<artifactId>contextMenu</artifactId>
<version>3.1.3-SNAPSHOT</version>
</dependency>
Modified: branches/3.1.x/samples/contextMenuDemo/src/main/java/org/richfaces/Bean.java
===================================================================
---
branches/3.1.x/samples/contextMenuDemo/src/main/java/org/richfaces/Bean.java 2007-11-28
19:58:07 UTC (rev 4331)
+++
branches/3.1.x/samples/contextMenuDemo/src/main/java/org/richfaces/Bean.java 2007-11-28
20:15:21 UTC (rev 4332)
@@ -92,12 +92,19 @@
//System.out.println("Bean.actionListener()" + event.getComponent());
}
- public void action() {
+ public void delete() {
FacesContext context = FacesContext.getCurrentInstance();
- context.addMessage(null, new FacesMessage("Action has been performed. Parameter
passed: " + param));
+ context.addMessage(null, new FacesMessage("Package deleted: " + param));
//System.out.println("Bean.action()" + param);
}
+ public void edit() {
+ FacesContext context = FacesContext.getCurrentInstance();
+ context.addMessage(null, new FacesMessage("Package edited: " + param));
+ //System.out.println("Bean.action()" + param);
+ }
+
+
}
\ No newline at end of file
Added: branches/3.1.x/samples/contextMenuDemo/src/main/webapp/icons/ico1.gif
===================================================================
(Binary files differ)
Property changes on:
branches/3.1.x/samples/contextMenuDemo/src/main/webapp/icons/ico1.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: branches/3.1.x/samples/contextMenuDemo/src/main/webapp/icons/ico2.gif
===================================================================
(Binary files differ)
Property changes on:
branches/3.1.x/samples/contextMenuDemo/src/main/webapp/icons/ico2.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: branches/3.1.x/samples/contextMenuDemo/src/main/webapp/pages/index.jsp
===================================================================
--- branches/3.1.x/samples/contextMenuDemo/src/main/webapp/pages/index.jsp 2007-11-28
19:58:07 UTC (rev 4331)
+++ branches/3.1.x/samples/contextMenuDemo/src/main/webapp/pages/index.jsp 2007-11-28
20:15:21 UTC (rev 4332)
@@ -1,100 +1,95 @@
-<%@ taglib
uri="http://java.sun.com/jsf/html" prefix="h" %>
+<%@ taglib
uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib
uri="http://java.sun.com/jsf/core" prefix="f"%>
-<%@ taglib
uri="http://richfaces.org/a4j" prefix="a4j" %>
-<%@ taglib
uri="http://labs.jboss.com/jbossrichfaces/ui/dataTable"
prefix="dt"%>
-<%@ taglib
uri="http://labs.jboss.com/jbossrichfaces/ui/contextMenu"
prefix="cm"%>
-<%@ taglib
uri="http://labs.jboss.com/jbossrichfaces/ui/componentControl"
prefix="cc"%>
-<%@ taglib
uri="http://labs.jboss.com/jbossrichfaces/ui/menu-components"
prefix="mc" %>
+<%@ taglib
uri="http://richfaces.org/a4j" prefix="a4j"%>
+<%@ taglib
uri="http://labs.jboss.com/jbossrichfaces/ui/dataTable"
+ prefix="dt"%>
+<%@ taglib
uri="http://labs.jboss.com/jbossrichfaces/ui/contextMenu"
+ prefix="cm"%>
+<%@ taglib
+
uri="http://labs.jboss.com/jbossrichfaces/ui/componentControl"
+ prefix="cc"%>
+<%@ taglib
uri="http://labs.jboss.com/jbossrichfaces/ui/menu-components"
+ prefix="mc"%>
<html>
- <head>
- <title>
- </title>
- <style>
- <!--
-.header {
+<head>
+<title></title>
+<style>
+<!--
+.header {
background-color: graytext;
-}
-.footer {
+}
+
+.footer {
background-color: gray;
-}
+}
+
.rich-cm-attached {
- cursor:help;
+ cursor: help;
}
- -->
- </style>
- </head>
- <body>
- <f:view>
- <h:form id="skinForm" >
- <h:selectOneRadio binding="#{skinBean.component}"/>
- <h:commandLink action="#{skinBean.change}" value="Set
Skin"/>
- <h:outputText value=" Current skin: #{skinBean.skin}" />
- </h:form>
- <div id="sgs" style="height:50px">
- <a4j:outputPanel ajaxRendered="true">
- <h:messages></h:messages>
- </a4j:outputPanel>
- </div>
- <h:form id="f">
- <h:panelGroup id="outputText">
- Right Click Here
- <cm:contextMenu submitMode="server" id="m">
- <mc:menuItem id="menuItem11"
action="#{bean.action}" value="{param} ajax submit"
submitMode="ajax" actionListener="#{bean.actionListener}">
- <a4j:actionparam assignTo="#{bean.param}"
name="param" value="{param}"></a4j:actionparam>
- </mc:menuItem>
- <mc:menuItem id="menuItem12"
action="#{bean.action}" value="{param} Server submit "
immediate="true" actionListener="#{bean.actionListener}">
- <a4j:actionparam assignTo="#{bean.param}"
name="param" value="{param}"></a4j:actionparam>
- </mc:menuItem>
- <mc:menuItem id="menuItem14"
action="#{bean.action}" value="{param} default submit "
actionListener="#{bean.actionListener}">
- <a4j:actionparam assignTo="#{bean.param}"
name="param" value="{param}"></a4j:actionparam>
- </mc:menuItem>
-
- <mc:menuSeparator id="menuSeparator11"/>
-
- <mc:menuItem id="menuItem16"
action="#{bean.action}" value="Disable16 {param}"
disabled="true" actionListener="#{bean.actionListener}">
- <a4j:actionparam assignTo="#{bean.param}"
name="param" value="{param}"></a4j:actionparam>
- </mc:menuItem>
- <mc:menuItem id="menuItem17"
action="#{bean.action}" actionListener="#{bean.actionListener}">
- <a4j:actionparam assignTo="#{bean.param}"
name="param" value="{param}"></a4j:actionparam>
- <h:inputText value="{param}"/>
- </mc:menuItem>
- <a4j:actionparam name="param" value="function()
{return new Date()}" noEscape="true"/>
- </cm:contextMenu>
- </h:panelGroup>
- <dt:dataTable id="table" value="#{bean.model}"
var="row" style="width:300px"
- first="0" rows="40" width="100%">
- <dt:column headerClass="header" footerClass="footer">
- <f:facet name="header">
- <h:outputText value="First header"></h:outputText>
- </f:facet>
- <f:facet name="footer">
- <h:outputText value="First footer"></h:outputText>
- </f:facet>
- <h:panelGroup id="aa">
- <h:outputText value="#{row.first}">
- </h:outputText>
- </h:panelGroup>
- <cc:componentControl event="oncontextmenu" attachTo="aa"
for=":f:m" operation="doShow">
- <f:param name="param"
value="#{row.first}"></f:param>
- </cc:componentControl>
- </dt:column>
- <dt:column headerClass="header" footerClass="footer">
- <f:facet name="header">
- <h:outputText value="Second header"></h:outputText>
- </f:facet>
- <f:facet name="footer">
- <h:outputText value="Second footer"></h:outputText>
- </f:facet>
- <h:panelGroup id="bb" layout="inline">
- <h:outputText value="#{row.second}"/>
- </h:panelGroup>
- <cc:componentControl event="oncontextmenu" attachTo="bb"
for=":f:m" operation="doShow">
- <f:param name="param"
value="#{row.second}"></f:param>
- </cc:componentControl>
- </dt:column>
- </dt:dataTable>
+-->
+</style>
+</head>
+<body>
+<f:view>
+ <h:form id="skinForm" >
+ <h:selectOneRadio binding="#{skinBean.component}"/>
+ <h:commandLink action="#{skinBean.change}" value="Set
Skin"/>
+ <h:outputText value=" Current skin: #{skinBean.skin}" />
</h:form>
-
- </f:view>
- </body>
-</html>
+ <div id="sgs" style="height: 50px"><a4j:outputPanel
+ ajaxRendered="true">
+ <h:messages></h:messages>
+ </a4j:outputPanel></div>
+ <h:form id="f">
+ <cm:contextMenu submitMode="server" id="m"
attached="false">
+ <mc:menuItem action="#{bean.edit}"
+ value="Edit package : {param}" submitMode="ajax"
+ actionListener="#{bean.actionListener}"
icon="/icons/ico1.gif">
+ <a4j:actionparam assignTo="#{bean.param}" name="param"
+ value="{param}"></a4j:actionparam>
+ </mc:menuItem>
+
+ <mc:menuSeparator id="menuSeparator11" />
+
+ <mc:menuItem action="#{bean.delete}"
+ value="Delete package {param}" submitMode="ajax"
+ actionListener="#{bean.actionListener}"
icon="/icons/ico2.gif">
+ <a4j:actionparam assignTo="#{bean.param}" name="param"
+ value="{param}"></a4j:actionparam>
+ </mc:menuItem>
+ </cm:contextMenu>
+ <dt:dataTable id="table" value="#{bean.model}"
var="row"
+ style="width:300px" first="0" rows="40"
width="100%">
+ <dt:column headerClass="header" footerClass="footer"
id="c1">
+ <f:facet name="header">
+ <h:outputText value="Package"></h:outputText>
+ </f:facet>
+ <f:facet name="footer">
+ <h:outputText value="Package"></h:outputText>
+ </f:facet>
+ <h:outputText value="#{row.first}">
+ </h:outputText>
+ <cc:componentControl event="oncontextmenu" attachTo="c1"
for=":f:m"
+ operation="doShow">
+ <f:param name="param"
value="#{row.first}"></f:param>
+ </cc:componentControl>
+ </dt:column>
+ <dt:column headerClass="header" footerClass="footer"
id="c2">
+ <f:facet name="header">
+ <h:outputText value="Description"></h:outputText>
+ </f:facet>
+ <f:facet name="footer">
+ <h:outputText value="Description"></h:outputText>
+ </f:facet>
+ <h:outputText value="#{row.second}" />
+ <cc:componentControl event="oncontextmenu" attachTo="c2"
for=":f:m"
+ operation="doShow">
+ <f:param name="param"
value="#{row.first}"></f:param>
+ </cc:componentControl>
+ </dt:column>
+ </dt:dataTable>
+ </h:form>
+
+</f:view>
+</body>
+</html>