Show TOC Start of Content Area

Background documentation Tool Bar Dropdown List Box  Locate the document in its SAP Library structure

A control with a dropdown arrow that the user clicks to display a list of options. An item in the toolbarDropdownListBox is called listBoxItem. The toolbarDropdownListBox has to be used together with the "toolbar" control.

·        enabled

A boolean value that defines if the toolbarDropdownListBox is clickable. If the toolbarDropdownListBox is disabled (enabled="FALSE") it is not selectable. A disabled toolbarDropdownListBox has a different color for the displayed listBoxItem.

·        id

Identification name of the toolbarDropdownListBox.

·        model

Defines the model which provides the toolbarDropdownListBox with data. How to work with the IListModel.

·        nameOfKeyColumn

Specifies the name of the column that contains the key. This is used when you use an underlying table in the model.

·        nameOfValueColumn

Specifies the name of the column that contains the visible text. This is used when you use an underlying table in the model.

·        onClientSelect 

Defines the JavaScript fragment that is executed when the user clicks on the toolbarDropdownListBox. If both events ('onSelect' and 'onClientSelect') are specified, the 'onClientSelect' event handling method is activated first. By default the 'onSelect' event handling method is activated afterwards. In the JavaScript fragment you can cancel the activation of the 'onSelect' event handling method with the command

htmlbevent.cancelSubmit=true;

The 'onClientSelect' event is useful to preprocess the form and only send the form to client if the preprocessing was successful (for example, date validation, valid number format etc.) to save client/server interaction.

This graphic is explained in the accompanying text

A toolbarDropdownListBox click usually activates the client/server interaction. If an input field has to be filled out for further processing, the JavaScript fragment can check the necessary input on the client side and display a message if the necessary input is missing, without server interaction.

 

Note

To use JavaScript the JSP has to use the page tag (see page tag).

 

·        onSelect

Defines the event handling method that will be processed when the user clicks on the enabled toolbarDropdownListBox. If you do not define a onClick event the toolbarDropdownListBox can be clicked but no event is generated.

·        selection

Specifies the key of the listBoxItem which is displayed in the toolbarDropdownListBox.

·        width

Defines the width of the toolbarDropdownListBox in pixel or percent.

 

Attributes

M

Values

Usage

enabled

 

TRUE (d)
FALSE

Taglib
disabled="TRUE"

Classlib
setEnabled (false)

id

*

String (cs)

Taglib
id = "listbox_te"

Classlib
setId ("listbox_te")

model

 

String

Taglib
model = "mybean.model"

Classlib
setModel((IListModel) model)

nameOfKeyColumn

 

String

Taglib
nameOfKeyColumn = "k1"

Classlib
setNameOfKeyColumn ("k1")

nameOfValueColumn

 

String

Taglib
nameOfValueColumn = "v1"

Classlib
setNameOfValueColumn ("v1")

selection

 

String

Taglib
selection = "HD"

Classlib
setSelection("HD")

width

 

Unit

Taglib
width = "200"

Classlib
setWidth ("200")

 

Events

M

Values

Usage

onClientSelect

 

String (cs)

 

Taglib
onClientSelect="alert('Click')"

Classlib
setOnClientSelect("alert('Click')")

onSelect

 

String (cs)

Taglib
onSelect="proc_listbox"

Classlib
setOnSelect ("proc_listbox")

 

listBoxItem

Defines the items in a toolbarDropdownListBox, toolbarDropdownListBox or listBox instead of the model. See listBoxItem for more details.

 

 

Example

using the taglib

  <hbj:toolbarDropDownListBox id="myDDL2" >
      <hbj:listBoxItem key=
"k1" value="Arial" />
      
<hbj:listBoxItem key="k2" value="Times Roman" />
      <hbj:listBoxItem key=
"k3" value="Verdana" selected="true" />
  
</hbj:toolbarDropDownListBox>

 

using the classlib

    ToolbarDropdownListBox ddl = new ToolbarDropdownListBox("Fonts");
    
ddl.addItem("k1","Arial");
    ddl.addItem(
"k2","Times Roman");
    
ddl.addItem("k3","Verdana");
    ddl.setSelection(
"k3");

 

Result

The toolbar dropdown list box has to be used in the toolbar control. See the "toolbar" control description for the result.

End of Content Area