Commit 59451adff7bc3794399cb5583a13ab6a03b6440d
1 parent
33d329ff
combo in dialog
Showing
1 changed file
with
40 additions
and
2 deletions
Show diff stats
calexium_lib/web/CXM_dojo.anubis
| ... | ... | @@ -74,7 +74,42 @@ public type Input_Type: |
| 74 | 74 | |
| 75 | 75 | public type InputDial: |
| 76 | 76 | input_dial(String id, Input_Type input_type, String label), |
| 77 | - input_date(String id, String label). | |
| 77 | + input_date(String id, String label), | |
| 78 | + input_combo(String label, HtmlId id, WebArgName name, List((WebArgValue,String)) list_data). | |
| 79 | + | |
| 80 | + | |
| 81 | +define List(HTML_Off_Form) | |
| 82 | + format_list_data | |
| 83 | + ( | |
| 84 | + List((WebArgValue,String)) list_data, | |
| 85 | + List(HTML_Off_Form) result_list | |
| 86 | + )= | |
| 87 | + if list_data is | |
| 88 | + { | |
| 89 | + [] then result_list, | |
| 90 | + [h . t] then | |
| 91 | + if h is (wa, label) then | |
| 92 | + format_list_data(t, [literal("<option value=\"" + wa.value + "\">" + label + "</option>") . result_list]) | |
| 93 | + }. | |
| 94 | + | |
| 95 | +public define HTML_Off_Form | |
| 96 | + dojo_combobox | |
| 97 | + ( | |
| 98 | + WebArgName the_name, | |
| 99 | + HtmlId the_id, | |
| 100 | + String label, | |
| 101 | + List((WebArgValue,String)) list_data, | |
| 102 | + )= | |
| 103 | + sequence([ | |
| 104 | + literal("<label for=\"" + the_id.id + "\">" + label + "</label> | |
| 105 | + <select id=\""+the_id.id+"\" | |
| 106 | + name=\"" + the_name.name + "\" | |
| 107 | + dojoType=\"dijit.form.ComboBox\" | |
| 108 | + autoComplete=\"false\" | |
| 109 | + pageSize=\"30\">"), | |
| 110 | + sequence((format_list_data(list_data, []))), | |
| 111 | + literal("</select>") | |
| 112 | + ]). | |
| 78 | 113 | |
| 79 | 114 | define HTML_Row(HTML_Off_Form) |
| 80 | 115 | input_in_dialog |
| ... | ... | @@ -102,7 +137,10 @@ define HTML_Row(HTML_Off_Form) |
| 102 | 137 | dojoType=\"dijit.form.DateTextBox\"> |
| 103 | 138 | </div>" |
| 104 | 139 | ) |
| 105 | - ]))]) | |
| 140 | + ]))]), | |
| 141 | + input_combo(label, id, name, list_data) then | |
| 142 | + row([], [cell([], sequence([ | |
| 143 | + dojo_combobox(name, id, label, list_data)]))]) | |
| 106 | 144 | } |
| 107 | 145 | . |
| 108 | 146 | ... | ... |