Author: ilya_shaikovsky
Date: 2011-01-25 08:38:22 -0500 (Tue, 25 Jan 2011)
New Revision: 21203
Modified:
trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/tables/CarsBean.java
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/dataTable/samples/dataTableEdit-sample.xhtml
Log:
dataTable edit example
Modified:
trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/tables/CarsBean.java
===================================================================
---
trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/tables/CarsBean.java 2011-01-25
13:19:30 UTC (rev 21202)
+++
trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/tables/CarsBean.java 2011-01-25
13:38:22 UTC (rev 21203)
@@ -180,7 +180,7 @@
ii.setVendor(vendor);
ii.setModel(model);
ii.setStock(RandomHelper.randomstring(6, 7));
- ii.setVin(RandomHelper.randomstring(14, 15));
+ ii.setVin(RandomHelper.randomstring(17, 17));
ii.setMileage(new BigDecimal(RandomHelper.rand(5000,
80000)).setScale(DECIMALS, ROUNDING_MODE));
ii.setMileageMarket(new BigDecimal(RandomHelper.rand(25000,
45000)).setScale(DECIMALS, ROUNDING_MODE));
ii.setPrice(new Integer(RandomHelper.rand(15000, 55000)));
Modified:
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/dataTable/samples/dataTableEdit-sample.xhtml
===================================================================
---
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/dataTable/samples/dataTableEdit-sample.xhtml 2011-01-25
13:19:30 UTC (rev 21202)
+++
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/dataTable/samples/dataTableEdit-sample.xhtml 2011-01-25
13:38:22 UTC (rev 21203)
@@ -60,7 +60,7 @@
</a4j:commandLink>
</rich:column>
<f:facet name="footer">
- <rich:dataScroller page="#{carsBean.page}"/>
+ <rich:dataScroller page="#{carsBean.page}" />
</f:facet>
</rich:dataTable>
@@ -83,6 +83,9 @@
<rich:popupPanel header="Edit Car Details" id="editPane">
<h:form>
+ <a4j:outputPanel ajaxRendered="true">
+ <h:messages />
+ </a4j:outputPanel>
<h:panelGrid columns="3" id="editGrid">
<h:outputText value="Vendor" />
<h:outputText value="#{carsBean.editedCar.vendor}" />
@@ -91,19 +94,27 @@
<h:outputText value="#{carsBean.editedCar.model}" />
<h:panelGroup />
<h:outputText value="Price" />
- <h:inputText value="#{carsBean.editedCar.price}" id="price"
/>
+ <h:inputText value="#{carsBean.editedCar.price}"
required="true"
+ requiredMessage="Price is required" id="price"
+ validatorMessage="Should be a valid price" label="Price field"
/>
<rich:message for="price" />
<h:outputText value="Mileage" />
- <h:inputText value="#{carsBean.editedCar.mileage}" id="mage"
/>
+ <h:inputText value="#{carsBean.editedCar.mileage}" id="mage"
+ validatorMessage="Should be a valid mileage" label="Mileage
field" />
<rich:message for="mage" />
<h:outputText value="VIN" />
- <h:inputText value="#{carsBean.editedCar.vin}" id="vin" />
+ <h:inputText value="#{carsBean.editedCar.vin}" id="vin"
+ required="true" validatorMessage="Not a valid 17-digit VIN"
+ requiredMessage="VIN is required">
+ <f:validateLength minimum="17" maximum="17" />
+ </h:inputText>
<rich:message for="vin" />
</h:panelGrid>
- <a4j:commandButton value="Store" action="#{carsBean.store}"
+ <a4j:commandButton value="Store" action="#{carsBean.store}"
render="table" execute="@form"
- oncomplete="#{rich:component('editPane')}.hide();" />
- <a4j:commandButton value="Cancel"
onclick="#{rich:component('editPane')}.hide(); return false;"/>
+ oncomplete="if (#{facesContext.maximumSeverity==null})
{#{rich:component('editPane')}.hide();}" />
+ <a4j:commandButton value="Cancel"
+ onclick="#{rich:component('editPane')}.hide(); return false;"
/>
</h:form>
</rich:popupPanel>
</ui:composition>
\ No newline at end of file
Show replies by date