14.01.2013 Views

Oracle JHeadstart Developer's Guide - Downloads - Oracle

Oracle JHeadstart Developer's Guide - Downloads - Oracle

Oracle JHeadstart Developer's Guide - Downloads - Oracle

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

6.2. Default Display Value<br />

6.2.1. Using EL expressions<br />

In the Application Definition Editor you can set the Default Display Value of an item.<br />

This value is used when creating new rows.<br />

For example, a new employee has by default a salary of 1000:<br />

1. Enter the default value with Application Definition Editor.<br />

2. Generate/run your application and create a new record. The default display<br />

value is shown now in the column.<br />

In addition to literal values, you can enter Expression Language in the Default Display<br />

Value.<br />

Imagine that for new employees the salary must be calculated based on job and so on.<br />

Assume the result of the calculation is stored on the session context in an object called<br />

Salary with method getDefaultSalary. In such a situation enter for Default Display Value<br />

the EL #{salary.defaultSalary}<br />

Use the same technique to display the current date: store it on the request or session and<br />

enter an EL expression for showing on a page.<br />

<strong>JHeadstart</strong> Developer’s <strong>Guide</strong> Generating User Interface Widgets 6- 3

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!