Author: SergeySmirnov
Date: 2007-05-07 21:24:16 -0400 (Mon, 07 May 2007)
New Revision: 688
Added:
trunk/richfaces-samples/richfaces-demo/src/main/java/org/richfaces/demo/ddmenu/
trunk/richfaces-samples/richfaces-demo/src/main/java/org/richfaces/demo/ddmenu/Menu.java
Modified:
trunk/richfaces-samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml
trunk/richfaces-samples/richfaces-demo/src/main/webapp/richfaces/dropDownMenu/usage.xhtml
Log:
ddmenu demo
Added:
trunk/richfaces-samples/richfaces-demo/src/main/java/org/richfaces/demo/ddmenu/Menu.java
===================================================================
---
trunk/richfaces-samples/richfaces-demo/src/main/java/org/richfaces/demo/ddmenu/Menu.java
(rev 0)
+++
trunk/richfaces-samples/richfaces-demo/src/main/java/org/richfaces/demo/ddmenu/Menu.java 2007-05-08
01:24:16 UTC (rev 688)
@@ -0,0 +1,38 @@
+package org.richfaces.demo.ddmenu;
+
+public class Menu {
+ private String current;
+
+ public String getCurrent() {
+ return this.current;
+ }
+
+ public void setCurrent(String current) {
+ this.current = current;
+ }
+
+ public String doNew() {
+ this.current="New";
+ return null;
+ }
+ public String doOpen() {
+ this.current="Open";
+ return null;
+ }
+ public String doClose() {
+ this.current="Close";
+ return null;
+ }
+ public String doSaveText() {
+ this.current="Save as Text File";
+ return null;
+ }
+ public String doSavePDF() {
+ this.current="Save as PDF File";
+ return null;
+ }
+ public String doExit() {
+ this.current="Exit";
+ return null;
+ }
+}
Modified: trunk/richfaces-samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
---
trunk/richfaces-samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml 2007-05-08
01:23:04 UTC (rev 687)
+++
trunk/richfaces-samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml 2007-05-08
01:24:16 UTC (rev 688)
@@ -13,6 +13,11 @@
</managed-property>
</managed-bean>
<managed-bean>
+ <managed-bean-name>ddmenu</managed-bean-name>
+ <managed-bean-class>org.richfaces.demo.ddmenu.Menu</managed-bean-class>
+ <managed-bean-scope>request</managed-bean-scope>
+ </managed-bean>
+ <managed-bean>
<managed-bean-name>dfsBean</managed-bean-name>
<managed-bean-class>org.richfaces.demo.datafilterslider.DemoSliderBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
Modified:
trunk/richfaces-samples/richfaces-demo/src/main/webapp/richfaces/dropDownMenu/usage.xhtml
===================================================================
---
trunk/richfaces-samples/richfaces-demo/src/main/webapp/richfaces/dropDownMenu/usage.xhtml 2007-05-08
01:23:04 UTC (rev 687)
+++
trunk/richfaces-samples/richfaces-demo/src/main/webapp/richfaces/dropDownMenu/usage.xhtml 2007-05-08
01:24:16 UTC (rev 688)
@@ -7,15 +7,14 @@
xmlns:rich="http://richfaces.ajax4jsf.org/rich">
<ui:composition template="/templates/component-sample.xhtml">
<ui:define name="sample">
-
+
<style>
.optionList {
height:30px;
}
- .Avertical-menu .rich-menu-item-hover,.Avertical-menu .rich-menu-group-hover {
- background-image:none;
- background-color: #{a4jSkin.additionalBackgroundColor};
- }
+ .vertical-menu-cell {
+ padding:0px 4px 0px 4px;
+ }
</style>
@@ -23,52 +22,61 @@
similar to one that almost every desktop application have.
</p>
<a4j:log hotkey="M" />
+
+
<div class="sample-container">
<h:form>
-
+
<rich:toolBar>
- <rich:dropDownMenu showDelay="0" hideDelay="1000"
value="File">
- <rich:menuItem width="40px" mode="ajax"
value="Open" action="open"/>
+ <rich:dropDownMenu value="File">
+
+ <rich:menuItem submitMode="ajax" value="New"
action="#{ddmenu.doNew}">
+ </rich:menuItem>
+ <rich:menuItem submitMode="ajax" value="Open"
action="#{ddmenu.doOpen}"/>
+ <rich:menuGroup value="Save As...">
+ <rich:menuItem submitMode="ajax" value="Text File"
action="#{ddmenu.doSaveText}"/>
+ <rich:menuItem submitMode="ajax" value="PDF File"
action="#{ddmenu.doPDF}"/>
+ </rich:menuGroup>
+ <rich:menuItem submitMode="ajax" value="Close"
action="#{ddmenu.doClose}"/>
<rich:menuSeparator id="menuSeparator11"/>
-
- <rich:menuItem mode="none"
onclick="document.location.href='http://www.exadel.com'">
- <h:outputLink value="http://www.exadel.com">output
Link</h:outputLink>
- </rich:menuItem>
+ <rich:menuItem submitMode="ajax" value="Exit"
action="#{ddmenu.doExit}"/>
+
</rich:dropDownMenu>
- <rich:dropDownMenu showDelay="0" hideDelay="1000">
+ <rich:dropDownMenu>
+
<f:facet name="label">
<h:panelGrid cellpadding="0" cellspacing="0"
columns="2" style="vertical-align:middle">
- <h:graphicImage
value="/richfaces/toolBar/images/palette_edit.gif"/>
- <h:outputText value="Options" />
+ <h:graphicImage
value="/richfaces/toolBar/images/yellow_lamp.gif"/>
+ <h:outputText value="Links" />
</h:panelGrid>
</f:facet>
- <rich:menuItem value="Read" />
- <rich:menuItem value="Print">
+
+ <rich:menuItem submitMode="none"
onclick="document.location.href='http://labs.jboss.com/jbossrich...
<f:facet name="icon">
- <h:graphicImage id="print"
value="/richfaces/toolBar/images/print.gif" />
+ <h:graphicImage
value="/richfaces/toolBar/images/webapp_welcome.gif" />
</f:facet>
+ <h:outputLink
value="http://labs.jboss.com/jbossrichfaces/">
+ <h:outputText value="RichFaces Home Page"></h:outputText>
+ </h:outputLink>
</rich:menuItem>
- <rich:menuItem value="Remove" />
- <rich:menuGroup value="Drop Out and Foget About It">
- <rich:menuItem value="Forever" />
- <rich:menuGroup value="And Ever">
- <rich:menuGroup value="And Ever">
- <rich:menuGroup value="And Ever">
- <rich:menuGroup value="And Ever">
- <rich:menuGroup value="And Ever">
- <rich:menuGroup value="And Ever">
- <rich:menuItem value="But Never" />
- </rich:menuGroup>
- </rich:menuGroup>
- </rich:menuGroup>
- </rich:menuGroup>
- </rich:menuGroup>
- </rich:menuGroup>
- </rich:menuGroup>
+
+ <rich:menuItem submitMode="none"
onclick="document.location.href='http://jboss.com/index.html?mod...
+ <f:facet name="icon">
+ <h:graphicImage value="/richfaces/toolBar/images/timer_task.gif"
/>
+ </f:facet>
+ <h:outputLink
value="http://jboss.com/index.html?module=bb&op=viewforum&am...
+ <h:outputText value="RichFaces Forum"></h:outputText>
+ </h:outputLink>
+ </rich:menuItem>
+
</rich:dropDownMenu>
</rich:toolBar>
</h:form>
+ <a4j:outputPanel ajaxRendered="true">
+ <h:outputText value="Current Selection: "></h:outputText>
+ <h:outputText style="font-weight:bold"
value="#{ddmenu.current}"></h:outputText>
+ </a4j:outputPanel>
</div>
<p>The drop down menu has label that always appears on the page and invisible
panel
that appears by particular client side event (onmouseover, onclick etc). The event
is
@@ -78,18 +86,20 @@
horizontal lines between the items or groups. Item is a 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 developers to provide own functionality inside the menu item.
+ allows developers to provide own functionality inside the menu item with inline
content.
</p>
+ <p>You can place the block of drop down menus horizontally or vertially how it
is shown below.
+ </p>
<div class="sample-container">
<h:form>
- <h:panelGrid class="vertical-menu"
style="background-color:#{a4jSkin.additionalBackgroundColor}"
columns="1" cellspacing="0" cellpadding="0">
+ <h:panelGrid class="vertical-menu-cell" columns="1"
cellspacing="0" cellpadding="0">
<rich:dropDownMenu style="border:1px solid
#{a4jSkin.panelBorderColor}" value="Option1"
direction="bottom-right" jointPoint="tr">
<rich:menuItem value="Suboption1-1" />
<rich:menuItem value="Suboption1-2">
<f:facet name="icon">
- <h:graphicImage id="print2"
value="/richfaces/toolBar/images/print.gif" />
+ <h:graphicImage value="/richfaces/toolBar/images/print.gif" />
</f:facet>
</rich:menuItem>
@@ -115,7 +125,6 @@
</h:form>
</div>
-
</ui:define>
<ui:define name="sources">
Here is a fragment of page sources for the given example: