Commit 48c3322abac738a717fe40a077ba3256c460d605

Authored by totoro
1 parent 00f5906e

the hidden alternative now use WebArgValue instead of InitialValue

Showing 2 changed files with 51 additions and 51 deletions   Show diff stats
web/CXM_form.anubis
... ... @@ -82,8 +82,8 @@ public type CXM_Form_Field:
82 82  
83 83 //--- hidden field ------------------------------------------------------------
84 84 hidden (HtmlId id,
85   - WebArgName web_arg_name,
86   - InitialValue init_value),
  85 + WebArgName web_arg_name,
  86 + WebArgValue init_value),
87 87 //--- explanation field ---------------------------------------------------------------
88 88 explain (String text),
89 89  
... ... @@ -343,11 +343,10 @@ public define CXM_Form_Field
343 343 public define CXM_Form_Field
344 344 hidden
345 345 (
346   - WebArgName web_arg_name,
347   - InitialValue init_value
  346 + WebArgName web_arg_name,
  347 + WebArgValue value
348 348 )=
349   - if web_arg_name is wan(name) then
350   - hidden(htmlId(name), web_arg_name, init_value).
  349 + hidden(htmlId(""), web_arg_name, value).
351 350  
352 351  
353 352 //--- explanation field ---------------------
... ...
web/CXM_making_a_web_site.anubis
... ... @@ -1146,55 +1146,55 @@ public define List(HTML_Head_Tag)
1146 1146 map((JS_File js_f) |-> js(js_f), js_file_list).
1147 1147  
1148 1148 public type HTML_In_Form:
1149   - empty,
1150   - literal_pt (Printable_tree),
1151   - literal (String),
1152   - sequence (List(HTML_In_Form) items),
1153   - text (List(Text_Option), String the_text),
1154   - preformated (List(Text_Option), String),
1155   - paragraph (List(Text_Option), HTML_In_Form content),
1156   - image (List(CoreAttrs), String url, String alternate),
1157   - image (List(CoreAttrs), String url, String alternate, Int width, Int height),
1158   - table (List(Table_Option), HTML_Header_Row(HTML_In_Form), List(HTML_Row(HTML_In_Form)), HTML_Footer_Row(HTML_In_Form)),
1159   - center (HTML_In_Form),
1160   - mail_to (String email, HTML_In_Form element),
1161   - scroller (Int width, Int height,
  1149 + empty,
  1150 + literal_pt (Printable_tree),
  1151 + literal (String),
  1152 + sequence (List(HTML_In_Form) items),
  1153 + text (List(Text_Option), String the_text),
  1154 + preformated (List(Text_Option), String),
  1155 + paragraph (List(Text_Option), HTML_In_Form content),
  1156 + image (List(CoreAttrs), String url, String alternate),
  1157 + image (List(CoreAttrs), String url, String alternate, Int width, Int height),
  1158 + table (List(Table_Option), HTML_Header_Row(HTML_In_Form), List(HTML_Row(HTML_In_Form)), HTML_Footer_Row(HTML_In_Form)),
  1159 + center (HTML_In_Form),
  1160 + mail_to (String email, HTML_In_Form element),
  1161 + scroller (Int width, Int height,
1162 1162 Int content_width, Int content_height,
1163 1163 HTML_In_Form content),
1164   - actioner (Actioner_Connection, Actioner_Target, Actioner_Aspect,
  1164 + actioner (Actioner_Connection, Actioner_Target, Actioner_Aspect,
1165 1165 String action_name, List((String,String)) extra_ops,
1166 1166 List(Actioner_Local_Action)),
1167   - foreign_link_new (Actioner_Target, Actioner_Aspect, String url),
1168   - foreign_link (List(Text_Option), String url),
1169   - foreign_link (List(Text_Option), String url, String name),
1170   - private_download (String abs_path, String name, String extra_ext,
  1167 + foreign_link_new (Actioner_Target, Actioner_Aspect, String url),
  1168 + foreign_link (List(Text_Option), String url),
  1169 + foreign_link (List(Text_Option), String url, String name),
  1170 + private_download (String abs_path, String name, String extra_ext,
1171 1171 Maybe((String,List((String,String)))) action),
1172   - text_input (List(InputAttrs), String label_text, HtmlId id, WebArgName name, InitialValue init, Int width),
1173   - text_input_ro (List(InputAttrs), String label_text, HtmlId id, WebArgName name, InitialValue init, Int width),
1174   - password_input (List(InputAttrs), String label_text, HtmlId id, WebArgName name, InitialValue init, Int width),
1175   - text_area (List(TextAreaOption), String label_text, HtmlId id, WebArgName name, InitialValue init, Int width, Int height),
1176   - file_upload (List(InputAttrs), String label, HtmlId id, WebArgName name, Int width),
1177   - selector (List(InputAttrs), String label_text, HtmlId id, WebArgName name, Int size, List(String) choices),
1178   - selector (List(InputAttrs), String label_text, HtmlId id, WebArgName name, Int size, List(String) choices, InitialValue selected),
  1172 + text_input (List(InputAttrs), String label_text, HtmlId id, WebArgName name, InitialValue init, Int width),
  1173 + text_input_ro (List(InputAttrs), String label_text, HtmlId id, WebArgName name, InitialValue init, Int width),
  1174 + password_input (List(InputAttrs), String label_text, HtmlId id, WebArgName name, InitialValue init, Int width),
  1175 + text_area (List(TextAreaOption), String label_text, HtmlId id, WebArgName name, InitialValue init, Int width, Int height),
  1176 + file_upload (List(InputAttrs), String label, HtmlId id, WebArgName name, Int width),
  1177 + selector (List(InputAttrs), String label_text, HtmlId id, WebArgName name, Int size, List(String) choices),
  1178 + selector (List(InputAttrs), String label_text, HtmlId id, WebArgName name, Int size, List(String) choices, InitialValue selected),
1179 1179 // List((String,String)) = List((code,name)) where :
1180 1180 // code is the web-arg value
1181 1181 // name appears in selector
1182   - selector_c (List(InputAttrs), String label_text, HtmlId id, WebArgName name, Int size, List((List(CoreAttrs),WebArgValue,String)) choices),
1183   - selector_c (List(InputAttrs), String label_text, HtmlId id, WebArgName name, Int size, List((List(CoreAttrs),WebArgValue,String)) choices, InitialValue selected),
1184   - radio_button (List(InputAttrs), String label_text, HtmlId id, WebArgName name, WebArgValue value, Bool checked),
1185   - radio_button_r (List(InputAttrs), String label_text, HtmlId id, WebArgName name, WebArgValue value, Bool checked),
1186   - check_box (List(InputAttrs), String label_text, HtmlId id, WebArgName name, WebArgValue value, Bool checked),
1187   - check_box_r (List(InputAttrs), String label_text, HtmlId id, WebArgName name, WebArgValue value, Bool checked),
1188   - div (List(CoreAttrs), HTML_In_Form content),
1189   - div_empty (List(CoreAttrs)),
1190   - hidden (HtmlId id, WebArgName name, InitialValue init),
1191   - partial (HTML_Partial_Content),
  1182 + selector_c (List(InputAttrs), String label_text, HtmlId id, WebArgName name, Int size, List((List(CoreAttrs),WebArgValue,String)) choices),
  1183 + selector_c (List(InputAttrs), String label_text, HtmlId id, WebArgName name, Int size, List((List(CoreAttrs),WebArgValue,String)) choices, InitialValue selected),
  1184 + radio_button (List(InputAttrs), String label_text, HtmlId id, WebArgName name, WebArgValue value, Bool checked),
  1185 + radio_button_r (List(InputAttrs), String label_text, HtmlId id, WebArgName name, WebArgValue value, Bool checked),
  1186 + check_box (List(InputAttrs), String label_text, HtmlId id, WebArgName name, WebArgValue value, Bool checked),
  1187 + check_box_r (List(InputAttrs), String label_text, HtmlId id, WebArgName name, WebArgValue value, Bool checked),
  1188 + div (List(CoreAttrs), HTML_In_Form content),
  1189 + div_empty (List(CoreAttrs)),
  1190 + hidden (HtmlId id, WebArgName name, WebArgValue value),
  1191 + partial (HTML_Partial_Content),
1192 1192 br,
1193   - progress (List(CoreAttrs), Int value, Int max),
1194   - ol (List(CoreAttrs), HTML_In_Form content),
1195   - ul (List(CoreAttrs), HTML_In_Form content),
1196   - li (List(CoreAttrs), HTML_In_Form content),
1197   - button (List(CoreAttrs), HTML_In_Form content).
  1193 + progress (List(CoreAttrs), Int value, Int max),
  1194 + ol (List(CoreAttrs), HTML_In_Form content),
  1195 + ul (List(CoreAttrs), HTML_In_Form content),
  1196 + li (List(CoreAttrs), HTML_In_Form content),
  1197 + button (List(CoreAttrs), HTML_In_Form content).
1198 1198  
1199 1199  
1200 1200 'HTML_In_Form' defines all the elements you may put within a form. We define a
... ... @@ -1337,9 +1337,9 @@ public define HTML_In_Form
1337 1337 = file_upload([], "", htmlId(""), name, width).
1338 1338  
1339 1339 public define HTML_In_Form
1340   - hidden (WebArgName name, InitialValue init)
1341   - = if name is wan(web_name) then
1342   - hidden(htmlId(web_name), name, init).
  1340 + hidden (WebArgName name, WebArgValue value)
  1341 + =
  1342 + hidden(htmlId(""), name, value).
1343 1343  
1344 1344 public type HTML_Body:...
1345 1345  
... ... @@ -4260,8 +4260,9 @@ define Printable_tree
4260 4260 format(cinfo,sn,ic_v,any_div(options, e),format_element,is_https, action_count, head_tags),
4261 4261 div_empty(options) then
4262 4262 format(cinfo,sn,ic_v,any_div_empty(options),format_element,is_https, action_count, head_tags),
4263   - hidden(id, name, value) then
4264   - ["<input type=\"hidden\" id=\"",id,"\" name=\"",name,"\" value=\"",value,"\" />"],
  4263 + hidden(_id, name, value) then
  4264 + since _id is htmlId(id),
  4265 + ["<input type=\"hidden\"",(if id = "" then "" else " id=\""+id+"\"")," name=\"",name,"\" value=\"",value,"\" />"],
4265 4266 partial(p_content) then
4266 4267 if p_content is partial_content(tags, html_elements) then
4267 4268 head_tags <- *head_tags + tags;
... ...