dWebSpec Dictionary
CONTEXT: descriptors->element->type-cat-selection




All Details Standard Only Platform Only
Structured Web info and helpTechnologies
 Home Page
 Product Page
 Download Page
 Feedback
Javascript Tree Menu

Results for:

 element.type-cat-selection 
Prev  Topic  Next

selection

The selection input elements provide means of choosing amongst predetermined list of items.

However, there are some special issues involving selection elements. The first of which has to do with the fact they involve multiple bindings, one for the selected items, and one or more for the options to be selected from.

The dWebSpec types involved in selections are radioGroup, checkboxGroup, select and radio type elements. These are shown in the table below.

Type

value

options

comment

checkbox

single

X

True/false entry

radio

single

single

Group member have same ID

radioGroup

single

collection

 

checkboxGroup

single/ collection

collection

 

select

single/ collection

collection

 

The first one, checkbox, is not a selections element, it as input elements that allows for true/false entries; it is included here because of the relationship with the checkboxGroup.

The radio input allow selection of one of multiple options, as such, standalone it is of no use. When included multiple times within a form, with each instance bound to different singular value, but all instances sharing an identifier, they in essence form a radio group.

The radioGroup would be bound to a collection of options, with which it would render the member radio buttons with a singular value identifier. In short the difference between the radio and radioGroup, is that the earlier allows fine grain binding of values to individual radio elements, whereas the values for radioGroup would come from a collection.

The checkboxGroup is similar to the radioGroup, in that it would be bound to a collection of options, with which it would render the member checkboxes with a single identifier. However, it could allow single or multiple selections; the latter would imply that selected values would be returned as collection. The select element has identical binding structure with the checkboxGroup.

 ASP.NET  

The list of elements of the select type is shown in the table below.

Element Type

Source Content Representation

Web Controls

checkbox

<input id="check1" type="checkbox" name="check1" onclick="javascript:" />

<asp:CheckBox id="check1" Text="Same as home phone" TextAlign="Right" AutoPostBack="True" OnCheckedChanged="Check" runat="server" />

checkboxGroup

Default: render list of checkbox in a table, with each element in its own row.

<asp:CheckBoxList id="check1" AutoPostBack="True" TextAlign="Right" OnSelectedIndexChanged="Check" runat="server"/>

option

<option value="Item 1">Item 1 </option>

<asp:ListItem>Item 1 </asp:ListItem>

options

Bindings for options are reflected directly on List controls like - asp:CheckboxList, asp:DropDownList, and asp:ListBox

Bindings for options are reflected directly on List controls like - asp:CheckboxList, asp:DropDownList, and asp:ListBox

radio

<input id="red" type="radio" name="colors" value="red" checked="checked" /><label for="red">Red</label>

<asp:RadioButton id="red" Text="Red" Checked="True" GroupName="colors" runat="server"/>

radioGroup

Default: render list of radio buttons in a table, with each element in its own row.

<asp:RadioButtonList id="radiolist1" runat="server">    <asp:ListItem selected="true">Item 1 </asp:ListItem>    <asp:ListItem>Item 2 </asp:ListItem>    <asp:ListItem>Item 3 </asp:ListItem>    <asp:ListItem>Item 4 </asp:ListItem> </asp:RadioButtonList>

select (dropdown)

<select name="drop1" id="drop1"> <option value="Item 1">Item 1 </option> <option value="Item 2">Item 2 </option> </select>

<asp:DropDownList id="drop1" runat="server"> <asp:ListItem>Item 1 </asp:ListItem> <asp:ListItem>Item 2 </asp:ListItem> </asp:DropDownList>

Select (list box)

<select size="3" name="drop1" id="drop1"> <option value="Item 1">Item 1 </option> <option value="Item 2">Item 2 </option> </select>

<asp:ListBox id="drop1" rows="3" runat="server"> <asp:ListItem>Item 1 </asp:ListItem> <asp:ListItem>Item 2 </asp:ListItem> </asp:DropDownList>

The select category elements are basically input elements that allow selection from a predetermined list rather than user entry.

As such they share the same basics as the input type. Please refer to the input type for the basics.

Where the select items differ is that they would be associated with options or option type element as shown below.

ELEMENT DESCRIPTORS

id

caption

type

value

component-id

conversion-type

validators

formatter

required

visible

enabled

group-id

spec-scope

CustomerID Customer select {!.CustomerID}                  
CustomerID {CustomersDS[].CustomerName} options {CustomersDS[].CustomerID}                  

Example implementation is shown below.

  <asp:DropdownList id="CustomerID" runat="server" 
       DataSourceID="CustomersDS"          
       DataTextField="CustomerName"          
       DataValueField ="CustomerID" />

The options element properties are reflected directly on the properties of the select type elements, on the ASP.NET platform. This subtle difference should be noted. In HTML options elements are nested in the select element, and not its property. This is the way it is also modeled in dWebSpec and most platforms.

The mapping of the options to the attribute of the select controls is shown below.

Element Descriptor Attributes

Property

Description

Part of Caption/value entries

DataSourceID

The DataSourceID is derived from the object part of the {object,attribute} binding for the caption and value.

caption

DataTextField

The DataTextField is derived from the attribute part of the {object,attribute} binding for the caption

value

DataValueField

The DataValueField is derived from the attribute part of the {object.attribute} binding for the value

The list item specification and mapping is shown above, the table below shows the full set of attributes shared by list controls and their mappings. These mappings are to the element descriptor attributes, except otherwise stated.

Control Property

Descriptor Attribute

Description

AutoPostBack

Event descriptor call type: autopostback

Specifies whether the form should be posted immediately after the index of the selected item has changed or not

CausesValidation

Event descriptor call type: immediate (converse)

Specifies whether or not a page is validated when an item in a list control is clicked on.

DataSourceID

Part of caption/value entries for associated options element

The data source portion of caption or value specification. Implication is that both entries must have the same data source.

DataTextField

caption associated options element

A field in the data source to be displayed in the drop-down list

DataTextFormatString

formatter

Formatting string used to specify how to display list data

DataValueField

Value associated options element

A field in the data source that specifies the value of each selectable item in the drop-down list

SelectedValue

value

The value of the selected item in a list

Option

Unlike the implementation of the options type element that is merged with that of the associated select element, the implementation of the option type is separate.

An example specification would appear as follows.

ELEMENT DESCRIPTORS

id

caption

type

value

component-id

conversion-type

validators

formatter

required

visible

enabled

group-id

spec-scope

CustomerID Customer select {!.CustomerID}                  
CustomerID {!.CustomerName} option {!.CustomerID}                  

This would be implemented as:

  <asp:ListItem Text="{#Eval('CustopmerName'}" Value="{#Eval('CustopmerID'}" />

The dynamically populated list items would show up in the descriptors as shown in the example above. However, there could be static options in the source content; example is shown below.

<option Value="" >Please select an item</option>

The implementation for these would be as shown below.

  <asp:ListItem Value="">Please select an item</asp:ListItem>

Other List Items Implementation Attributes.

Most of the standard elements have direct correspondence to HTML elements. It is the elements of the component category that do not have direct correspondence to single HTML element. They could include multiple elements, layout and segments.

In the selection category, the checkboxGroup and radioGroup are also of the component category; they do not have correspondence to an HTML element, furthermore they could include template or layout code.

Notwithstanding, their implementation on most platform could be simplified into simple repetition of single element (e.g. checkbox), plus additional attribute to indicate horizontal or vertical layout. ASP.NET provided for these additional parameters, as highlighted in the table below.

Control Layout Parameter

Options

RepeatLayout

Table: tabular rows or columns Flow: inline left to right, flow to next line

RepeatDirection

Horizontal (rows) Vertical (columns)

RepeatColumn

Maximum columns when RepeatLayout is Table.

CellPadding, CellSpacing, TextAlign

Pass through for table layout.

 

 

Prev Next