Author: ilya_shaikovsky
Date: 2007-12-04 11:26:51 -0500 (Tue, 04 Dec 2007)
New Revision: 4453
Added:
branches/3.1.x/samples/richfaces-demo/src/main/webapp/richfaces/contextMenu/example/
branches/3.1.x/samples/richfaces-demo/src/main/webapp/richfaces/contextMenu/example/menu.xhtml
branches/3.1.x/samples/richfaces-demo/src/main/webapp/richfaces/contextMenu/usage.xhtml
Log:
http://jira.jboss.com/jira/browse/RF-1496
Added:
branches/3.1.x/samples/richfaces-demo/src/main/webapp/richfaces/contextMenu/example/menu.xhtml
===================================================================
---
branches/3.1.x/samples/richfaces-demo/src/main/webapp/richfaces/contextMenu/example/menu.xhtml
(rev 0)
+++
branches/3.1.x/samples/richfaces-demo/src/main/webapp/richfaces/contextMenu/example/menu.xhtml 2007-12-04
16:26:51 UTC (rev 4453)
@@ -0,0 +1,59 @@
+<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:a4j="http://richfaces.org/a4j"
+
xmlns:rich="http://richfaces.org/rich">
+
+ <h:form id="form">
+ <rich:contextMenu attached="false" id="menu"
submitMode="ajax">
+ <rich:menuItem value="Show Details">
+ <a4j:actionparam name="current" value="Show Details"
assignTo="#{ddmenu.current}"/>
+ </rich:menuItem>
+ <rich:menuGroup value="Actions">
+ <rich:menuItem value="Put To Basket">
+ <a4j:actionparam name="current" value="Put To Basket"
assignTo="#{ddmenu.current}"/>
+ </rich:menuItem>
+ <rich:menuItem value="Read Comments">
+ <a4j:actionparam name="current" value="Read Comments"
assignTo="#{ddmenu.current}"/>
+ </rich:menuItem>
+ <rich:menuItem value="Go to {car} {model} site">
+ <a4j:actionparam name="current" value="Go to #{car.make}
#{car.model} site" assignTo="#{ddmenu.current}"/>
+ </rich:menuItem>
+ </rich:menuGroup>
+ </rich:contextMenu>
+ <rich:dataGrid value="#{dataTableScrollerBean.allCars}"
var="car" columns="4" elements="12">
+ <rich:panel id="panel">
+ <rich:componentControl attachTo="panel" event="oncontextmenu"
for=":form:menu" operation="doShow">
+ <f:param value="#{car.model}" name="model"/>
+ <f:param value="#{car.make}" name="car"/>
+ </rich:componentControl>
+ <f:facet name="header">
+ <h:outputText value="#{car.make}
#{car.model}"></h:outputText>
+ </f:facet>
+ <h:panelGrid columns="2">
+ <h:outputText value="Price:"
styleClass="label"></h:outputText>
+ <h:outputText value="#{car.price}" />
+ <h:outputText value="Mileage:"
styleClass="label"></h:outputText>
+ <h:outputText value="#{car.mileage}" />
+ <h:outputText value="VIN:"
styleClass="label"></h:outputText>
+ <h:outputText value="#{car.vin}" />
+ <h:outputText value="Stock:"
styleClass="label"></h:outputText>
+ <h:outputText value="#{car.stock}" />
+ </h:panelGrid>
+ </rich:panel>
+ <f:facet name="footer">
+ <rich:datascroller></rich:datascroller>
+ </f:facet>
+ </rich:dataGrid>
+ <rich:spacer height="30px"/>
+ <a4j:outputPanel ajaxRendered="true">
+ <rich:panel>
+ <f:facet name="header">
+ <h:outputText value="Last actions fired:"/>
+ </f:facet>
+ <h:outputText value="#{ddmenu.current}"></h:outputText>
+ </rich:panel>
+ </a4j:outputPanel>
+ </h:form>
+</ui:composition>
\ No newline at end of file
Added:
branches/3.1.x/samples/richfaces-demo/src/main/webapp/richfaces/contextMenu/usage.xhtml
===================================================================
---
branches/3.1.x/samples/richfaces-demo/src/main/webapp/richfaces/contextMenu/usage.xhtml
(rev 0)
+++
branches/3.1.x/samples/richfaces-demo/src/main/webapp/richfaces/contextMenu/usage.xhtml 2007-12-04
16:26:51 UTC (rev 4453)
@@ -0,0 +1,43 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:a4j="http://richfaces.org/a4j"
+
xmlns:rich="http://richfaces.org/rich">
+ <ui:composition template="/templates/component-sample.xhtml">
+ <ui:define name="sample">
+
+
+
+ <p>RichFaces Context menu is a component that allows to organize the
hierarchical popup menus
+ similar to one that almost every desktop application has.
+ </p>
+
+ <p>
+ To call the menu - perform right click inside any car info panel. After you click
some item - panel above the grid will be updated.
+ </p>
+ <div class="sample-container">
+
+ <ui:include src="/richfaces/contextMenu/example/menu.xhtml"/>
+ <ui:include src="/templates/include/sourceview.xhtml">
+ <ui:param name="sourcepath"
value="/richfaces/contextMenu/example/menu.xhtml"/>
+ </ui:include>
+
+ </div>
+ <p>The context menu is an invisible panel
+ that appears after a particular client side event (onmouseover, onclick etc) occured
on parent component.
+ The event is defined with an 'event' attribute.</p>
+
+ <p>Drop Down Menu can contains a set of Menu Items, Menu Groups and Menu
Separators.
+ Group plays a role of label for secondary levels on the menu. Separator is
represented with
+ horizontal lines between the items or groups. An item is an active element that might
produce
+ Ajax or non-Ajax requests. The submittion mode is defined with 'submitMode'
attribute that has
+ three possible options - "server", "ajax" or "none".
Mode "none" does not produce any request, but
+ allows you to provide your own functionality inside the menu item with an inline
content.
+ </p>
+
+ </ui:define>
+
+ </ui:composition>
+</html>