OpenXava 4.2.2 released

OpenXava 4.6 released

You can assign a model object (an entity or a transient object) directly to a View to populate it.

In the jUnit tests you can assert the content of generated PDFs

New @RowAction annotation for collections.

Labels and messages available in Russian.

The file name for generated reports includes model name and time.

And many other useful new features and bug fixes.

Custom reports generation from list

In list mode there is a new action called Custom report:When the user clicks on it he gets the next dialog:This dialog allows the user to define his own report. He can add and remove columns, specify filters, ordering and set the report title. It’s true that the features are almost the same of the already existing Generate PDF, because the user has always been able to add, remove and move columns, and filter and order in the list. Maybe the only advantage of the new UI is that the user can specify ordering for more than 2 columns and that he can specify the report title. The important thing is that this new UI for reporting will allow us to add new interesting features in future versions, such as storing the reports by name to recover them afterwards, specifying labels and width for columns, using hidden columns for filtering and ordering, etc.

Custom editors for list mode

The standard list mode is very powerful and suitable for most case, but sometimes you need something special for your list. To meet this necessity we have added the possibility to define custom editors for @Tabs. Therefore, if you want the customers list would be displayed in this way:You have to define a @Tab in your entity as following:

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: