Wiki source code of WOPopUpButton

Last modified by Pascal Robert on 2011/09/26 05:50

Show last authors
1 {{toc/}}
2
3 = Introduction =
4
5 WOPopUpButton, when clicked, displays itself as a selection list that allows the user to select only one item at a time. The related element WOBrowser is similar to WOPopUpButton except that it allows the user to select more than one item at a time.
6
7 You should provide the title of an item in displayString rather than in value. If there is no binding for displayString, the string assigned to value is used for the item.
8
9 = Usage =
10
11 {{code}}
12
13 WOPopUpButton {
14 list=anArray;
15 item=anItem;
16 displayString=displayedValue;
17 [value=optionValue;]
18 [selection=theSelection; | selectedValue=selectedValue;]
19 [name=fieldName;]
20 [disabled=aBoolean;]
21 [escapeHTML=aBoolean;]
22 [noSelectionString=aString;]...
23 }
24
25 {{/code}}
26
27 = Bindings =
28
29 |(((
30 list
31 )))|(((
32 Array of objects from which the WOPopUpButton derives its values.
33 )))
34 |(((
35 item
36 )))|(((
37 Identifier for the elements of the list. For example, aCollege could represent an object in a colleges array.
38 )))
39 |(((
40 displayString
41 )))|(((
42 Value to display in the selection list; for example, aCollege.name for each college object in the list.
43 )))
44 |(((
45 value
46 )))|(((
47 For each OPTION tag within the selection, this is the "value" attribute (that is, <OPTION value="someValue">). You can use this binding to specify additional identifiers of each item in the menu.
48 )))
49 |(((
50 selection
51 )))|(((
52 Object that the user chose from the selection list. For the college example, selection would be a college object.
53 )))
54 |(((
55 selectedValue
56 )))|(((
57 Value that is used with direct actions to specify which option in the list is selected.
58 )))
59 |(((
60 name
61 )))|(((
62 Name that uniquely identifies this element within the form. You can specify a name or let WebObjects automatically assign one at runtime.
63 )))
64 |(((
65 disabled
66 )))|(((
67 If disabled evaluates to true, this element appears in the page but is not active. That is, selection does not contain the user's selection when the page is submitted.
68 )))
69 |(((
70 escapeHTML
71 )))|(((
72 If escapeHTML evaluates to true, the string rendered by displayString is converted so that characters which would be interpreted as HTML control characters become their escaped equivalent (this is the default). Thus, if a your displayString is "a <b>bold</b> idea", the string passed to the client browser would be "a <B>bold</B> idea", but it would display in the browser as "a <b>bold</b> idea". If escapeHTML evaluates to false , WebObjects simply passes your data to the client browser "as is." In this case, the above example would display in the client browser as "a bold idea". If you are certain that your strings have no characters in them which might be interpreted as HTML control characters, you get better performance if you set escapeHTML to false.
73 )))
74 |(((
75 noSelectionString
76 )))|(((
77 Enables the first item to be "empty." Bind this attribute to a string (such as an empty string) that, if chosen, represents an empty selection. When this item is selected, the selection attribute is set to null.
78 )))
79
80 = Examples =
81
82 == Java methods ==
83
84 == WOD-style ==
85
86 {{code/}}
87
88 == Inline bindings (WOOGNL) ==
89
90 {{code/}}
91
92 = Related documents =