Author: ilya_shaikovsky
Date: 2008-03-24 07:10:59 -0400 (Mon, 24 Mar 2008)
New Revision: 7104
Added:
trunk/samples/richfaces-demo/src/main/webapp/richfaces/inplaceInput/examples/controlsCustomization.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/inplaceSelect/examples/controlsCustomization.xhtml
Modified:
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/capitals/CapitalsBean.java
trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/web.xml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/inplaceInput/usage.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/inplaceSelect/examples/selectItems.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/inplaceSelect/examples/simple.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/inplaceSelect/usage.xhtml
Log:
inplaces examples updated
Modified:
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/capitals/CapitalsBean.java
===================================================================
---
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/capitals/CapitalsBean.java 2008-03-24
10:57:02 UTC (rev 7103)
+++
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/capitals/CapitalsBean.java 2008-03-24
11:10:59 UTC (rev 7104)
@@ -16,7 +16,7 @@
public class CapitalsBean {
private ArrayList<Capital> capitals = new ArrayList<Capital>();
private ArrayList<String> capitalsNames = new ArrayList<String>();
- private ArrayList<SelectItem> capitalsOptions = new
ArrayList<SelectItem>();
+ private List<SelectItem> capitalsOptions = new ArrayList<SelectItem>();
private String capital = "";
public List<Capital> autocomplete(Object suggest) {
@@ -72,7 +72,7 @@
this.capital = capital;
}
- public ArrayList<SelectItem> getCapitalsOptions() {
+ public List<SelectItem> getCapitalsOptions() {
return capitalsOptions;
}
Modified: trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/web.xml 2008-03-24 10:57:02 UTC
(rev 7103)
+++ trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/web.xml 2008-03-24 11:10:59 UTC
(rev 7104)
@@ -52,10 +52,10 @@
<param-value>enable</param-value>
</context-param>
- <!--context-param>
+ <context-param>
<param-name>org.richfaces.LoadStyleStrategy</param-name>
<param-value>DEFAULT</param-value>
- </context-param-->
+ </context-param>
<context-param>
<param-name>org.richfaces.LoadScriptStrategy</param-name>
<param-value>ALL</param-value>
Added:
trunk/samples/richfaces-demo/src/main/webapp/richfaces/inplaceInput/examples/controlsCustomization.xhtml
===================================================================
---
trunk/samples/richfaces-demo/src/main/webapp/richfaces/inplaceInput/examples/controlsCustomization.xhtml
(rev 0)
+++
trunk/samples/richfaces-demo/src/main/webapp/richfaces/inplaceInput/examples/controlsCustomization.xhtml 2008-03-24
11:10:59 UTC (rev 7104)
@@ -0,0 +1,21 @@
+<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">
+ <rich:inplaceInput defaultLabel="Click here to edit"
showControls="true"
+ controlsHorizontalPosition="left"
controlsVerticalPosition="bottom"
+ id="inplaceInput">
+
+ <f:facet name="controls">
+ <button onclick="$('inplaceInput').component.save();"
+ type="button">Save</button>
+ <button onclick="$('inplaceInput').component.cancel();"
+ type="button">Cancel</button>
+ </f:facet>
+
+ </rich:inplaceInput>
+
+ <rich:spacer width="100%" height="40px" />
+</ui:composition>
\ No newline at end of file
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/inplaceInput/usage.xhtml
===================================================================
---
trunk/samples/richfaces-demo/src/main/webapp/richfaces/inplaceInput/usage.xhtml 2008-03-24
10:57:02 UTC (rev 7103)
+++
trunk/samples/richfaces-demo/src/main/webapp/richfaces/inplaceInput/usage.xhtml 2008-03-24
11:10:59 UTC (rev 7104)
@@ -32,19 +32,28 @@
be used in order to apply a value or cancel editing.
</p>
<h:panelGrid columns="2" columnClasses="top equals,top equals"
width="90%">
- <div class="sample-container" jsfc="h:panelGroup">
+ <div class="sample-container" jsfc="h:panelGroup"
layout="block">
<ui:include
src="/richfaces/inplaceInput/examples/simpleDefault.xhtml"/>
<ui:include src="/templates/include/sourceview.xhtml">
<ui:param name="sourcepath"
value="/richfaces/inplaceInput/examples/simpleDefault.xhtml"/>
</ui:include>
</div>
- <div class="sample-container" jsfc="h:panelGroup">
+ <div class="sample-container" jsfc="h:panelGroup"
layout="block">
<ui:include
src="/richfaces/inplaceInput/examples/simpleWithControls.xhtml"/>
<ui:include src="/templates/include/sourceview.xhtml">
<ui:param name="sourcepath"
value="/richfaces/inplaceInput/examples/simpleWithControls.xhtml"/>
</ui:include>
</div>
- </h:panelGrid>
+ </h:panelGrid>
+ <p>
+ Controls used by inplace could be redefined using <b>controls</b> named
facet:
+ </p>
+ <div class="sample-container">
+ <ui:include
src="/richfaces/inplaceInput/examples/controlsCustomization.xhtml"/>
+ <ui:include src="/templates/include/sourceview.xhtml">
+ <ui:param name="sourcepath"
value="/richfaces/inplaceInput/examples/controlsCustomization.xhtml"/>
+ </ui:include>
+ </div>
<p>
Inplace Input could be rendered with <i>span </i>or <i>div
</i>elements to display its value.
To change default span output, use <b>layout </b>attribute with
<i>block </i>value.
Added:
trunk/samples/richfaces-demo/src/main/webapp/richfaces/inplaceSelect/examples/controlsCustomization.xhtml
===================================================================
---
trunk/samples/richfaces-demo/src/main/webapp/richfaces/inplaceSelect/examples/controlsCustomization.xhtml
(rev 0)
+++
trunk/samples/richfaces-demo/src/main/webapp/richfaces/inplaceSelect/examples/controlsCustomization.xhtml 2008-03-24
11:10:59 UTC (rev 7104)
@@ -0,0 +1,31 @@
+<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">
+ <style>
+.rich-inplace-select-control-set {
+ margin-top: 4px;
+}
+</style>
+ <h:form>
+ <h:panelGrid columns="1">
+ <rich:inplaceSelect value="#{inplaceComponentsBean.inputValue}"
+ defaultLabel="Click here to edit" showControls="true"
+ controlsHorizontalPosition="left"
controlsVerticalPosition="bottom"
+ id="inplaceSelect">
+ <f:facet name="controls">
+ <button onclick="$('inplaceSelect').component.save();"
+ type="button">Save</button>
+ <button onclick="$('inplaceSelect').component.cancel();"
+ type="button">Cancel</button>
+ </f:facet>
+ <f:selectItems value="#{capitalsBean.capitalsOptions}" />
+ <a4j:support event="onviewactivated" reRender="output" />
+ </rich:inplaceSelect>
+ <h:outputText id="output" value="Current Value:
#{inplaceComponentsBean.inputValue}"/>
+ </h:panelGrid>
+ </h:form>
+ <rich:spacer width="100%" height="40px" />
+</ui:composition>
\ No newline at end of file
Modified:
trunk/samples/richfaces-demo/src/main/webapp/richfaces/inplaceSelect/examples/selectItems.xhtml
===================================================================
---
trunk/samples/richfaces-demo/src/main/webapp/richfaces/inplaceSelect/examples/selectItems.xhtml 2008-03-24
10:57:02 UTC (rev 7103)
+++
trunk/samples/richfaces-demo/src/main/webapp/richfaces/inplaceSelect/examples/selectItems.xhtml 2008-03-24
11:10:59 UTC (rev 7104)
@@ -4,22 +4,26 @@
xmlns:f="http://java.sun.com/jsf/core"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich">
- <style>
- .rich-inplace-select-control-set{
- margin-top:4px;
- }
- </style>
- <rich:inplaceSelect value="#{inplaceComponentsBean.inputValue}"
- defaultLabel="Click here to edit"
- openOnEdit="true" showControls="true"
- editEvent="ondblclick"
- controlsHorizontalPosition="left"
- controlsVerticalPosition="bottom" id="inplaceSelect">
- <f:facet name="controls">
- <button onclick="$('inplaceSelect').component.save();"
type="button">Save</button>
- <button onclick="$('inplaceSelect').component.cancel();"
type="button">Cancel</button>
- </f:facet>
- <f:selectItems value="#{capitalsBean.capitalsOptions}" />
- </rich:inplaceSelect>
- <rich:spacer width="100%" height="20px"/>
+
+ <style>
+ .inplace{
+ border: none;
+ cursor:pointer;
+ }
+ .hover {
+ color: #{a4jSkin.generalTextColor};
+ background-color :#{a4jSkin.tipBorderColor};
+ }
+ </style>
+
+ <h:panelGroup style="width:200px;" layout="block">
+ <rich:inplaceSelect value="#{inplaceComponentsBean.inputValue}"
+ defaultLabel="Click here to edit" openOnEdit="true"
+ showControls="true" editEvent="ondblclick"
layout="block"
+ viewClass="inplace" changedClass="inplace"
+ changedHoverClass="hover" viewHoverClass="hover">
+ <f:selectItems value="#{capitalsBean.capitalsOptions}" />
+ </rich:inplaceSelect>
+ </h:panelGroup>
+ <rich:spacer width="100%" height="20px" />
</ui:composition>
\ No newline at end of file
Modified:
trunk/samples/richfaces-demo/src/main/webapp/richfaces/inplaceSelect/examples/simple.xhtml
===================================================================
---
trunk/samples/richfaces-demo/src/main/webapp/richfaces/inplaceSelect/examples/simple.xhtml 2008-03-24
10:57:02 UTC (rev 7103)
+++
trunk/samples/richfaces-demo/src/main/webapp/richfaces/inplaceSelect/examples/simple.xhtml 2008-03-24
11:10:59 UTC (rev 7104)
@@ -12,4 +12,5 @@
<f:selectItem itemValue="3" itemLabel="Option 4" />
<f:selectItem itemValue="4" itemLabel="Option 5" />
</rich:inplaceSelect>
+ <rich:spacer width="100%" height="20px"/>
</ui:composition>
\ No newline at end of file
Modified:
trunk/samples/richfaces-demo/src/main/webapp/richfaces/inplaceSelect/usage.xhtml
===================================================================
---
trunk/samples/richfaces-demo/src/main/webapp/richfaces/inplaceSelect/usage.xhtml 2008-03-24
10:57:02 UTC (rev 7103)
+++
trunk/samples/richfaces-demo/src/main/webapp/richfaces/inplaceSelect/usage.xhtml 2008-03-24
11:10:59 UTC (rev 7104)
@@ -27,15 +27,18 @@
</div>
<p>
In this example <i>f:selectItems</i> tag used to define list of items to
be used.
- Additionally three usefull attributes used:
+ Additionally next usefull attributes used:
</p>
<ul>
<li>Controls "save" and "cancel" turned on with
<b>showControls</b> attribute</li>
- <li style="">
+ <li><b>editEvent</b> set as <i>ondblclick</i>.
<u>So you should click twice to edit value</u> </li>
+ <li><b>Layout</b> attribute defined as <b>block</b> and
inplace rendered as <i>div</i> element instead of<i> span
</i></li>
+
+ <li>
<b>openOnEdit</b> with true value defines that select popup list will be
opened
automatically after edit state activated.
</li>
- <li><b>editEvent</b> set as <i>ondblclick</i>. So you
should click twice to edit value</li>
+ <li> Classes customization used</li>
</ul>
<div class="sample-container" >
<ui:include
src="/richfaces/inplaceSelect/examples/selectItems.xhtml"/>
@@ -43,7 +46,16 @@
<ui:param name="sourcepath"
value="/richfaces/inplaceSelect/examples/selectItems.xhtml"/>
</ui:include>
</div>
-
+ <p>
+ Ant the last example shows simplest value saving through Ajax request and
+ controls customization using <b>controls</b> facet
+ </p>
+ <div class="sample-container" >
+ <ui:include
src="/richfaces/inplaceSelect/examples/controlsCustomization.xhtml"/>
+ <ui:include src="/templates/include/sourceview.xhtml">
+ <ui:param name="sourcepath"
value="/richfaces/inplaceSelect/examples/controlsCustomization.xhtml"/>
+ </ui:include>
+ </div>
</ui:define>
</ui:composition>