From 97ee784a25934d3e6407d84b2b9574d4ae33ec14 Mon Sep 17 00:00:00 2001 From: Cedric RICARD Date: Thu, 4 Dec 2008 16:14:31 +0000 Subject: [PATCH] Adding checkbox to DojoDialog --- calexium_lib/web/CXM_dojo.anubis | 61 ++++++++++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 48 insertions(+), 13 deletions(-) diff --git a/calexium_lib/web/CXM_dojo.anubis b/calexium_lib/web/CXM_dojo.anubis index cce479c..4931a39 100644 --- a/calexium_lib/web/CXM_dojo.anubis +++ b/calexium_lib/web/CXM_dojo.anubis @@ -73,9 +73,10 @@ public type Input_Type: password. public type InputDial: - input_dial(String id, Input_Type input_type, String label, Maybe(String) class), - input_date(String id, String label), - input_combo(String label, HtmlId id, WebArgName name, List((WebArgValue,String)) list_data). + input_dial(HtmlId id, Input_Type input_type, String label, Maybe(String) class), + input_date(HtmlId id, String label), + input_combo(HtmlId id, String label, List((WebArgValue,String)) list_data), + input_check(HtmlId id, String label, Bool checked). define List(HTML_Off_Form) @@ -111,20 +112,45 @@ public define HTML_Off_Form ]). define HTML_Off_Form + _maybe_label + ( + String label_text, + HtmlId html_id + ) = + if length(label_text) > 0 then literal("") + else literal(""). + +public define HTML_Off_Form + dojo_checkbox + ( + WebArgName the_name, + HtmlId the_id, + String label, + WebArgValue val, + Bool checked, + )= + sequence([ + _maybe_label(label, the_id), + literal(""), + ]). + + +define HTML_Off_Form input_in_dialog ( InputDial input_data )= if input_data is { - input_dial(id, input, label, class) then + input_dial(html_id, input, label, class) then sequence([ - literal("
") + " name=\""+html_id.id+"\" id=\""+html_id.id+"\" />") ]), - input_date(id, label) then + + input_date(html_id, label) then sequence([ - literal("
"), - literal("
"), + literal("
" ) ]), - input_combo(label, the_id, name, list_data) then + + input_combo(the_id, label, list_data) then sequence([ literal("
"), - dojo_combobox(name, the_id, label, list_data), + dojo_combobox(wan(the_id.id), the_id, label, list_data), literal("
") - ]) + ]), + + input_check(the_id, label, checked) then + sequence([ + literal("
"), + dojo_checkbox(wan(the_id.id), the_id, label, wav("1"), checked), + literal("
"), + ]), } . -- libgit2 0.21.4