 |
|
ss
Oracle Tips by Burleson |
Multiple
Select Lists
Multiple Select Lists are much like select lists
but allow the user to select more than one value at a time. Just like
Select Lists, this is based on a LOV to populate the list. An example
of a multiple select could be something like shown in Figure 10.25.
Notice in Figure 10.25, that there is a scroll bar
for the box. This is another feature of the multiple select lists.
There can be more values than are shown on the page. The length of
the list can be controlled.
This type of item is good to use whenever the
developer needs someone to select one or more items from a list. Some
examples might include a pizza web site with a list of toppings or a
maybe a new car purchasing website with a list of available options.
The user selects each item by holding down the CTRL key as they select
the item or use the SHIFT key and select.
To create a Multiple Select List in a region,
click on the icon
in the Items region on the Page Definition page:
1.
On the Item Type page, select the type Multiselect List and
click Next.
2.
On the Display Position and Name page.
-
Item Name: Enter the name of the item.
-
Sequence: Enter the sequence based on
where the page item is to be displayed in the region.
-
Region: Select the region in which this
page item should be displayed.
-
Click Next.
This is the
most important part of the wizard. This is where the display values
and the results are defined for the list. On this page, a LOV that
has already be created and named will be chosen, type in a new
SELECT statement or make a Static list. For the example in Figure
10.25, a static select list was used.
STATIC:Red;R,White;W,Blue;B,Green;G,Purple;P,Yellow;Y
The following is the explanation for some
of fields on this page.
-
Enter the name
of the LOV that will provide the values for this select list.
-
- Option:
Choose whether or not to display the fact that the session state for
the item is null.
-
Answering YES here
will cause the select list to be rendered with an extra item
indicating null. The default text that will be displayed in the
select list to indicate null is %.
-
: Enter the text
to be displayed in the event the session state for the select list
is null. In Figure 10.24, the text Select a Department will be
displayed in the select list when a value has not been selected from
the list.
-
: Enter a value
to be used in session state if no item is selected in the select
list. This item can be used in page validations to check if an item
has been selected. It is common to use a -1 for numeric data and an
X for character data.
3.
On the Item Attributes page:
-
Label:
Enter the text to display next to the select list.
-
Label Alignment: Choose the position to
place the label.
-
Field Width: This is not used for
select lists.
-
Field Alignment: Select the position to
display the select list in relation to the table cell in which it
will be rendered.
-
Label Template: Choose the template to
be used for the label.
-
Click Next.
4.
On the Source page:
-
Item Source: Choose the source for
where the value is being set from. It is normal to leave this set
to Static Assignment where value equals source attribute. What
that means is when the page is rendered, the selected item will be
set to the value corresponding with the session state for the page
item.
-
Default: Enter the value that for the
select list. This should be the same as the Null Value explained
above.
-
Click the Create Item button to not set
any conditions, or click Next to set them.
5.
On the Cachingpage, select
the desired Derive Item Source
option. The default is only when the value is NULL.
6.
Click the Create Item button.
After the item is created, the list may only
display that it has one value in size and shown in Figure 10.26. The
reason that it displays this way is because the wizard does not give
the option of making it larger. Thus, the page item should be edited.
First, edit the item by clicking on the item name
in the Page definition. In the definition, there is a section called
Element. This is where the height of the list can be defined. The
height needs to be set to the number of values to show up on the
page. As noted before, if there are more items than what is shown, a
scroll bar will be provided so it is not necessary to show all the
values at one time. The width is taken care of automatically, so
there is no reason to worry about that.
The above book excerpt is from:
Easy HTML-DB
Oracle Application Express
Create
Dynamic Web Pages with OAE
ISBN 0-9761573-1-4
Michael Cunningham & Kent Crotty
http://www.rampant-books.com/book_2005_2_html_db.htm
|