- What Is Dojo?
- Default Dojo Libraries Using Dojo Modules in XPages
- Dojo Modules and Dojo in the Extension Library
- Dojo Extensions to the Edit Box Control
- Dojo Extensions to the Multiline Edit Box Control
- Dojo Extensions to the Select Control
- Dojo Extensions to Buttons
- Composite Dojo Extensions
- Dojo Effects Simple Actions
- Conclusion
Dojo Extensions to the Multiline Edit Box Control
There are two Dojo controls in the Extension Library that extend the Multiline Edit Box: the Dojo Text Area (xe:djTextarea) and the Dojo Simple Text Area (xe:djSimpleTextarea). One of the advantages of these controls is that they also have some of the string manipulation properties familiar from the Dojo extensions that are based on the Edit Box controls. So trim, propercase, lowercase, and uppercase are implemented, which makes it easy to manipulate the content as soon as the user leaves the field. There is no built-in Dojo functionality to validate the Dojo Text Area control, but you can utilize all the core XPages validation techniques.
One of the strengths of XPages is that you can present and edit a collection of documents in the same web page. However, the challenge for a developer is that, unless the user is editing a small document such as a Comments document, the editable form can take up a large amount of real estate. If that includes the Multiline Edit Box as well, it takes up even more real estate when rows and cols properties are defined. But the beauty of the Dojo Text Area control is that it is auto-expanding. This means it takes up less screen real estate while still expanding as much as is required to show the user all the content. The Dojo Simple Text Area control, however, is fixed size. Of course, size attributes can be computed using Server-Side JavaScript, just as they can for any other XPages properties.
As with the Multiline Edit Box, you can define the width of the field using the rows property or using CSS to specify the width. Of course, because the Dojo Text Area is auto-expanding, the rows property has no effect for that control, only for the Dojo Simple Text Area control.
Table 5.8 details two additional properties of the Dojo Text Area and Dojo Simple Text Area.
Table 5.8. xe:djTextArea and xe:djSimpleTextArea Properties
Property |
Description |
rows |
Defines the number of rows the text area will show. This property is applicable only to the Dojo Simple Text Area control. |
cols |
Defines the number of columns the text area will show. |