| By Javier Paniza | Article Rating: |
|
| November 26, 2012 10:24 AM EST | Reads: |
3,777 |
You have to define a @Tab in your entity as following:
@Tab ( name ="Cards", editor="CustomerCardList",
properties="number, name, type, address.city, address.state.name"
)
And also define the editor in the editors.xml file of your project:
<editor name="CustomerCardList" url="customerCardListEditor.jsp"/>
Of course, you have to write customerCardListEditor.jsp to render the customers in your own way. Learn more details about how to choose an editor for a @Tab in the reference guide.
Moreover, it's possible to define an editor for all the lists of a model or even for all the lists of your application. Look at the customizing chapter of the reference guide.
With the addition of lists now we have editors for properties, references, collections and lists, thus the customization of the UI generated by OpenXava is total. You get exactly the UI you want.
Assigning model objects directly to View
Until now to put and get the data from a view based on a transient class you needed to use getView().get/setValue() with simple values or getView().get/setValues() with maps, you couldn't use the model object directly. Since OpenXava 4.6 you can use model objects to populate the view. So, a code like this is possible:
DateRange range = ... // DateRange can be an entity or a transient class
...
getView().setModel(range); // Populate the view with range data
This code populate the view with data from the DateRange object, even if the view currently is not displaying a DateRange the view is changed to display it.
Asserting PDF content in jUnit tests
Now you can verify that the content of the generated PDFs in your jUnit tests is the correct one. To do this ModuleTestBase has the following new methods: getPopupPDFAsText(), printPopupPDFAsText(), getPopupPDFLine(), assertPopupPDFLine(), assertPopupPDFLinesCount() and getPopupPDFLinesCount(). From now on you can write test code as following:
execute("CustomReport.generatePdf");
assertPopupPDFLinesCount(5);
assertPopupPDFLine(1, "jUnit Carrier report");
assertPopupPDFLine(2, "Name Number Zone");
assertPopupPDFLine(3, "CUATRO 4 1");
A good news for all of us that love automated testing.
@RowAction for collections
@RowAction allows to define an action to be show in each row, but not in the collection button bar. If you write a code like this:
@OneToMany(mappedBy="parent", cascade=CascadeType.ALL)
@RowAction("OrderDetail.reduceQuantity")
Collection<OrderDetail> details = new ArrayList<OrderDetail>()
You'll get the next user interface for the collection:
Note as Reduce quantity action is in the row but not in the button bar. Read more about @RowAction at wiki.
And more
See changelog for the complete list of new features and fixes.
Published November 26, 2012 Reads 3,777
Copyright © 2012 SYS-CON Media, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
More Stories By Javier Paniza
Javier Paniza is the project lead for OpenXava project. He works as software developer at Gestión 400, a software company for public administration in Spain. He has been developing with Java Enterprise since 1998. Also he has been J2EE mentor for development teams in banking projects.
- Cloud People: A Who's Who of Cloud Computing
- New Relic Q1 2013 Blazes Past Growth Targets and Reaches 40,000 Active Customer Accounts
- Cloud Expo New York: Delivering Digital Marketing on the Cloud
- Cloud Expo New York: Rethink IT and Reinvent Business with IBM SmartCloud
- Cloudant to Exhibit at Cloud Expo & Big Data Expo New York
- The Accessibility of the Cloud
- Cloud Expo NY: Best Practices for Delivering Oracle Database as a Service
- Cloud Expo New York: Basics of SSD Technology and Its Use in Cloud
- Session Topics: 12th Cloud Expo / Cloud Expo New York
- Cloud Expo New York: The Big Challenge of Big Data & Hadoop Integration
- Measuring the Business Value of Cloud Computing
- What CIOs Need to Know About Enterprise Virtualization
- Cloud People: A Who's Who of Cloud Computing
- Cloud Expo New York: Best CIO Practices Shared from SHI’s Customers
- Cloud Expo New York: How to Use Google Apps Script
- New Relic Q1 2013 Blazes Past Growth Targets and Reaches 40,000 Active Customer Accounts
- Cloud Expo New York: Why Big Data Is Really About Small Data
- Small Cancers, Big Data, and a Life Examined
- Cloud Expo New York: Delivering Digital Marketing on the Cloud
- Cloud Expo New York: Requirements of a Cloud Database
- Cloud Expo New York: Rethink IT and Reinvent Business with IBM SmartCloud
- Cloudant to Exhibit at Cloud Expo & Big Data Expo New York
- The Accessibility of the Cloud
- Learn How To Use Google Apps Script
- A Cup of AJAX? Nay, Just Regular Java Please
- Java Developer's Journal Exclusive: 2006 "JDJ Editors' Choice" Awards
- JavaServer Faces (JSF) vs Struts
- The i-Technology Right Stuff
- Rich Internet Applications with Adobe Flex 2 and Java
- Java vs C++ "Shootout" Revisited
- Bean-Managed Persistence Using a Proxy List
- Reporting Made Easy with JasperReports and Hibernate
- Creating a Pet Store Application with JavaServer Faces, Spring, and Hibernate
- Why Do 'Cool Kids' Choose Ruby or PHP to Build Websites Instead of Java?
- What's New in Eclipse?
- Where Are RIA Technologies Headed in 2008?






















