Editing Tabular Data

Figure 10-3 shows the version of the report entries list area that is displayed when you click a link in the reports list, where the user can edit the current entries of the selected report. Each entry is represented by editable fields and a selection list, plus buttons to delete or update the entry.

The report entries list area with editable columns
Figure 10-3. The report entries list area with editable columns

At the top of the screen, the report title is displayed along with a link for navigating back to the reports list page. It’s always a good idea to provide explicit navigation features like this in a web application, because the standard Back button behavior is unreliable. For instance, if the user updates the report entries so the total amount changes and then clicks the browser’s Back button, the browser may display a cached version of the reports list page with the old total. Different browsers also handle Back button clicks differently, especially when the previous page was generated by an HTTP POST request, as it always is in this example. Some redisplay a cached version, but others ask the user if a new POST request should be sent to the server. Various tricks can improve the situation, but none is foolproof, so I recommend designing the user interface with links and buttons for navigation and teach your users to use them instead of the Back button.

Example 10-4 shows the JSP page for the entries ...

Get JavaServer Faces now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.