Commit d0edb4a62a640e3c6eae1d85fe7924f5d5efd865
1 parent
6fe23a09
remove the value from checkbox to replace it by "true" internally. This improve …
…the using of the get_Bool(lwa, "xxx"), because get bool, looking for "1", "true", etc...
Showing
3 changed files
with
30 additions
and
33 deletions
Show diff stats
web/CXM_dojo.anubis
| ... | ... | @@ -671,14 +671,13 @@ public define HTML_Off_Form |
| 671 | 671 | public define HTML_In_Form |
| 672 | 672 | dojo_checkbox |
| 673 | 673 | ( |
| 674 | - List(CoreAttrs) attributes, | |
| 675 | - WebArgName name, | |
| 676 | - HTML_Id id, | |
| 677 | - String label_str, | |
| 678 | - WebArgValue val, | |
| 679 | - Bool checked, | |
| 674 | + List(CoreAttrs) attributes, | |
| 675 | + WebArgName name, | |
| 676 | + HTML_Id id, | |
| 677 | + String label_str, | |
| 678 | + Bool checked, | |
| 680 | 679 | )= |
| 681 | - check_box_r([attr("dojoType", "dijit.form.CheckBox") . attributes] , label(label_str, no_help), id, name, val, checked). | |
| 680 | + check_box_r([attr("dojoType", "dijit.form.CheckBox") . attributes] , label(label_str, no_help), id, name, checked). | |
| 682 | 681 | |
| 683 | 682 | public define HTML_In_Form |
| 684 | 683 | dojo_combobox | ... | ... |
web/CXM_form.anubis
| ... | ... | @@ -157,7 +157,6 @@ public type CXM_Form_Field: |
| 157 | 157 | HTML_Label label, |
| 158 | 158 | HTML_Id id, |
| 159 | 159 | WebArgName web_arg_name, |
| 160 | - WebArgValue web_arg_value, | |
| 161 | 160 | Bool checked, |
| 162 | 161 | Mandatory mandatory), |
| 163 | 162 | |
| ... | ... | @@ -167,7 +166,6 @@ public type CXM_Form_Field: |
| 167 | 166 | HTML_Label label, |
| 168 | 167 | HTML_Id id, |
| 169 | 168 | WebArgName web_arg_name, |
| 170 | - WebArgValue web_arg_value, | |
| 171 | 169 | Bool checked, |
| 172 | 170 | Mandatory mandatory |
| 173 | 171 | ), |
| ... | ... | @@ -177,7 +175,6 @@ public type CXM_Form_Field: |
| 177 | 175 | List(CoreAttrs) options, |
| 178 | 176 | HTML_Label label, |
| 179 | 177 | WebArgName web_arg_name, |
| 180 | - WebArgValue web_arg_value, | |
| 181 | 178 | Bool checked, |
| 182 | 179 | List(CXM_Form_Field) fields |
| 183 | 180 | ), |
| ... | ... | @@ -321,12 +318,12 @@ public define CXM_Form_Field |
| 321 | 318 | = password_input([], label, html_Id(n.name), n, init_value, width, mand). |
| 322 | 319 | |
| 323 | 320 | public define CXM_Form_Field |
| 324 | - checkbox(HTML_Label label, WebArgName n, WebArgValue value, Bool checked, Mandatory mand) | |
| 325 | - = checkbox([], label, html_Id(n.name), n, value, checked, mand). | |
| 321 | + checkbox(HTML_Label label, WebArgName n, Bool checked, Mandatory mand) | |
| 322 | + = checkbox([], label, html_Id(n.name), n, checked, mand). | |
| 326 | 323 | |
| 327 | 324 | public define CXM_Form_Field |
| 328 | - checkboxr(HTML_Label label, WebArgName n, WebArgValue value, Bool checked, Mandatory mand) | |
| 329 | - = checkboxr([], label, html_Id(n.name), n, value, checked, mand). | |
| 325 | + checkboxr(HTML_Label label, WebArgName n, Bool checked, Mandatory mand) | |
| 326 | + = checkboxr([], label, html_Id(n.name), n, checked, mand). | |
| 330 | 327 | |
| 331 | 328 | public define CXM_Form_Field |
| 332 | 329 | radio_button(HTML_Label label, WebArgName n, WebArgValue value, Bool checked, Mandatory mand) |
| ... | ... | @@ -552,18 +549,18 @@ public define HTML_In_Form |
| 552 | 549 | partial(partial_content(partial_content_list)) |
| 553 | 550 | ]), |
| 554 | 551 | |
| 555 | - checkbox(options, _label, id, wan, val, checked, mand) then | |
| 556 | - check_box([class("in") . options], star(_label, mand), id, wan, val, get_Bool(lwa, wan.name, checked)), | |
| 552 | + checkbox(options, _label, id, wan, checked, mand) then | |
| 553 | + check_box([class("in") . options], star(_label, mand), id, wan, get_Bool(lwa, wan.name, checked)), | |
| 557 | 554 | |
| 558 | - checkboxr(options, _label, id, wan, val, checked, mand) then | |
| 559 | - check_box_r([class("in") . options], star(_label, mand), id, wan, val, get_Bool(lwa, wan.name, checked)), | |
| 555 | + checkboxr(options, _label, id, wan, checked, mand) then | |
| 556 | + check_box_r([class("in") . options], star(_label, mand), id, wan, get_Bool(lwa, wan.name, checked)), | |
| 560 | 557 | |
| 561 | - checkbox_hide_show(options, _label, wan, val, checked, fields) then | |
| 558 | + checkbox_hide_show(options, _label, wan, checked, fields) then | |
| 562 | 559 | with div_id = generate_random_string(15), |
| 563 | 560 | sequence([ |
| 564 | - check_box([data("show_id", div_id), class("in"), class("cxm_checkbox_hide_show"), event(onclick, "checked_hide_show_element('"+div_id+"', this);")], _label, html_Id("checkbox_"+div_id), wan, val, get_Bool(lwa, wan.name, checked)), | |
| 561 | + check_box([data("show_id", div_id), class("in"), class("cxm_checkbox_hide_show"), event(onclick, "checked_hide_show_element('"+div_id+"', this);")], _label, html_Id("checkbox_"+div_id), wan, get_Bool(lwa, wan.name, checked)), | |
| 565 | 562 | div([id(div_id), style("display:"+if checked then "block" else "none")], format_div_CXM_Form_Field(fields, lwa, _class, b_with_label)) |
| 566 | - ]), | |
| 563 | + ]), | |
| 567 | 564 | |
| 568 | 565 | radio_button(options, _label, id, wan, val, checked, mand) then |
| 569 | 566 | radio_button([class("in"), event(onclick, "radio_hide_show_group('"+wan.name+"', this);") . options], star(_label, mand), id, wan, val, get_Bool(lwa, wan.name, checked)), | ... | ... |
web/CXM_making_a_web_site.anubis
| ... | ... | @@ -1428,8 +1428,8 @@ public type HTML_In_Form: |
| 1428 | 1428 | selector_c (List(CoreAttrs), HTML_Label label, HTML_Id id, WebArgName name, Int size, List((List(CoreAttrs),WebArgValue,String)) choices, InitialValue selected), |
| 1429 | 1429 | radio_button (List(CoreAttrs), HTML_Label label, HTML_Id id, WebArgName name, WebArgValue value, Bool checked), |
| 1430 | 1430 | radio_button_r (List(CoreAttrs), HTML_Label label, HTML_Id id, WebArgName name, WebArgValue value, Bool checked), |
| 1431 | - check_box (List(CoreAttrs), HTML_Label label, HTML_Id id, WebArgName name, WebArgValue value, Bool checked), | |
| 1432 | - check_box_r (List(CoreAttrs), HTML_Label label, HTML_Id id, WebArgName name, WebArgValue value, Bool checked), | |
| 1431 | + check_box (List(CoreAttrs), HTML_Label label, HTML_Id id, WebArgName name, Bool checked), | |
| 1432 | + check_box_r (List(CoreAttrs), HTML_Label label, HTML_Id id, WebArgName name, Bool checked), | |
| 1433 | 1433 | div (List(CoreAttrs), List(HTML_In_Form) content), |
| 1434 | 1434 | div_empty (List(CoreAttrs)), |
| 1435 | 1435 | hidden (HTML_Id id, WebArgName name, WebArgValue value), |
| ... | ... | @@ -1663,12 +1663,12 @@ public define HTML_In_Form |
| 1663 | 1663 | = radio_button_r (options, label, html_Id(n.name), n, value, checked). |
| 1664 | 1664 | |
| 1665 | 1665 | public define HTML_In_Form |
| 1666 | - check_box (List(CoreAttrs) options, HTML_Label label, WebArgName n, WebArgValue value, Bool checked) | |
| 1667 | - = check_box (options, label, html_Id(n.name), n, value, checked). | |
| 1666 | + check_box (List(CoreAttrs) options, HTML_Label label, WebArgName n, Bool checked) | |
| 1667 | + = check_box (options, label, html_Id(n.name), n, checked). | |
| 1668 | 1668 | |
| 1669 | 1669 | public define HTML_In_Form |
| 1670 | - check_box_r (List(CoreAttrs) options, HTML_Label label, WebArgName n, WebArgValue value, Bool checked) | |
| 1671 | - = check_box_r (options, label, html_Id(n.name), n, value, checked). | |
| 1670 | + check_box_r (List(CoreAttrs) options, HTML_Label label, WebArgName n, Bool checked) | |
| 1671 | + = check_box_r (options, label, html_Id(n.name), n, checked). | |
| 1672 | 1672 | |
| 1673 | 1673 | public define HTML_In_Form |
| 1674 | 1674 | file_upload (WebArgName n, Int width) |
| ... | ... | @@ -3257,6 +3257,7 @@ public define Web_Site |
| 3257 | 3257 | List(Web_arg) lwa, |
| 3258 | 3258 | Bool is_https) |-> |
| 3259 | 3259 | //(Printable_tree) |
| 3260 | + println(dump_web_arg_values(lwa)); | |
| 3260 | 3261 | since separate_web_args(lwa, http_info) is swa(mb_previous_state, mb_action_name, operands), |
| 3261 | 3262 | with new_state = if mb_previous_state is |
| 3262 | 3263 | { |
| ... | ... | @@ -5540,11 +5541,11 @@ define Printable_tree |
| 5540 | 5541 | radio_button_r(options, label, id, n, v, c) then |
| 5541 | 5542 | [ "<input type=\"radio\" name=\"",n,"\" id=\"",id,"\" value=\"",v,"\"",(if c then " checked=\"checked\"" else ""),format_attrs([class("in") . options])," />", |
| 5542 | 5543 | format_label(label, id)], |
| 5543 | - check_box(options, label, id, n, v, c) then | |
| 5544 | + check_box(options, label, id, n, c) then | |
| 5544 | 5545 | [ format_label(label, id), |
| 5545 | - "<input type=\"hidden\" name=\"~",n,"\" value=\"~",v,"\" /><input type=\"checkbox\" name=\"",n,"\" id=\"",id,"\" value=\"",v,"\"",(if c then " checked=\"checked\" " else ""),format_attrs([class("in") . options])," />"] | |
| 5546 | - check_box_r(options, label, id, n, v, c) then | |
| 5547 | - [ "<input type=\"hidden\" name=\"~",n,"\" value=\"~",v,"\" /><input type=\"checkbox\" name=\"",n,"\" id=\"",id,"\" value=\"",v,"\"",(if c then " checked=\"checked\" " else ""),format_attrs([class("in") . options])," />", | |
| 5546 | + "<input type=\"hidden\" name=\"~",n,"\" value=\"~true\" /><input type=\"checkbox\" name=\"",n,"\" id=\"",id,"\" value=\"true\"",(if c then " checked=\"checked\" " else ""),format_attrs([class("in") . options])," />"] | |
| 5547 | + check_box_r(options, label, id, n, c) then | |
| 5548 | + [ "<input type=\"hidden\" name=\"~",n,"\" value=\"~true\" /><input type=\"checkbox\" name=\"",n,"\" id=\"",id,"\" value=\"true\"",(if c then " checked=\"checked\" " else ""),format_attrs([class("in") . options])," />", | |
| 5548 | 5549 | format_label(label, id)] |
| 5549 | 5550 | div(options, e) then |
| 5550 | 5551 | format(cinfo,ic_v,any_div(options, e),format_element,is_https, action_count, head_tags), |
| ... | ... | @@ -5650,8 +5651,8 @@ define Bool |
| 5650 | 5651 | selector_c(o,l,i,n,s,c,p) then false, |
| 5651 | 5652 | radio_button(o,_,_,n,v,c) then false, |
| 5652 | 5653 | radio_button_r(o,_,_,n,v,c) then false, |
| 5653 | - check_box(o,_,_,n,v,c) then false, | |
| 5654 | - check_box_r(o,_,_,n,v,c) then false, | |
| 5654 | + check_box(o,_,_,n,c) then false, | |
| 5655 | + check_box_r(o,_,_,n,c) then false, | |
| 5655 | 5656 | div(o,l) then mapor(contains_an_upload,l), //contains_an_upload(c), |
| 5656 | 5657 | div_empty(o) then false, |
| 5657 | 5658 | hidden(_,_,_) then false, | ... | ... |