# Displaying content

The WRTKit contains two controls that are intended simply for displaying content of some kind. The simplest of these is the Label control, which is simply showing a piece of text below its caption. Labels are useful in situations where there is some short data that needs to be shown without requiring any kind of interactivity. E.g. in an address book widget, each information field for a contact could be shown using its own label. One label for the contact's name, one for the phone number, etc. The control caption would indicate what the information is (e.g. "Name") and the label's value would indicate the actual piece of data (e.g. "John Smith").

For situations where the content is more complex or longer, the WRTKit offers a control called ContentPanel. The ContentPanel control can be foldable or non- foldable. In its non-foldable mode a ContentPanel is similar to the label control and shows a caption and a content area. In the foldable mode the caption area is interactive and can be used to collapse and expand the content area. This helps shortening the space that the content takes up on in a view, while still allowing users to expand interesting content for a closer look. E.g. an email reader widget could use this to show each email in a folder in its own content panel so that the control caption is the email subject and the content area contains the full email.

Figure 1. Foldable content panel

Foldable ContentPanel controls can be created either in expanded or collapsed mode and can be programmatically expanded and collapsed in addition to allowing users to manually expand and collapse them.

If a non-folding ContentPanel control is used without a caption, it is for all practical purposes just a canvas to which any content can be inserted. The content in the content panel area is defined as an XHTML fragment and can be used to include arbitrarily complex content, e.g. content that contains images, JavaScript code, etc.

Parent topic: Developing widgets using the WRTKit