Commit 5184af72d628d4f7a4ba96611e6955b19cdff2e5
1 parent
a7adcfe6
dojo dialog, file added
Showing
2 changed files
with
30 additions
and
20 deletions
Show diff stats
calexium_lib/web/CXM_dojo.anubis
| ... | ... | @@ -44,35 +44,30 @@ public define HTML_Off_Form |
| 44 | 44 | String name, |
| 45 | 45 | String dialog_id, |
| 46 | 46 | String execute, |
| 47 | + Bool file | |
| 47 | 48 | ) |
| 48 | 49 | = |
| 49 | 50 | sequence[ |
| 50 | - dojo_button(name,"dijit.byId('"+dialog_id+"').show()", "dialog_id"), | |
| 51 | + dojo_button(name,"dijit.byId('"+dialog_id+"').show()", dialog_id + "_button"), | |
| 51 | 52 | div([attr("dojoType", "dijit.Dialog"), id(dialog_id), title(name), attr("execute", execute)], |
| 52 | 53 | table([], |
| 53 | 54 | empty, |
| 54 | 55 | [ |
| 55 | - row([], [cell([], literal("<input dojoType=dijit.form.TextBox type=\"text\" name=\"name\" id=\"name_"+dialog_id+"\" />"))]), | |
| 56 | + row([], [cell([], literal("<input dojoType=dijit.form.TextBox " + | |
| 57 | + (if file then | |
| 58 | + "type=\"file\"" | |
| 59 | + else | |
| 60 | + "type=\"text\"") | |
| 61 | + + " name=\"name\" id=\"name_"+dialog_id+"\" />") | |
| 62 | + | |
| 63 | + )]), | |
| 56 | 64 | row([], [cell([columns(2), h_center], literal("<button dojoType=dijit.form.Button type=\"submit\">OK</button>"))]), |
| 57 | 65 | ], |
| 58 | 66 | empty)), |
| 59 | 67 | literal("<br/>"), |
| 60 | -// literal(" | |
| 61 | -// <div dojoType=\"dijit.Dialog\" id=\""+id+"\" title=\""+name+"\" | |
| 62 | -// execute=\""+execute+"\"> | |
| 63 | -// <table> | |
| 64 | -// <tr> | |
| 65 | -// <td><input dojoType=dijit.form.TextBox type=\"text\" name=\"name\" id=\"name_"+id+"\"></td> | |
| 66 | -// </tr> | |
| 67 | -// | |
| 68 | -// <tr> | |
| 69 | -// <td colspan=\"2\" align=\"center\"> | |
| 70 | -// <button dojoType=dijit.form.Button type=\"submit\">OK</button></td> | |
| 71 | -// </tr> | |
| 72 | -// </table> | |
| 73 | -// </div><br />") | |
| 74 | 68 | ] |
| 75 | 69 | . |
| 70 | + | |
| 76 | 71 | public type DojoGridEditor: |
| 77 | 72 | inputEditor, |
| 78 | 73 | boolEditor, |
| ... | ... | @@ -367,6 +362,16 @@ public define HTML_Off_Form |
| 367 | 362 | content). |
| 368 | 363 | |
| 369 | 364 | |
| 365 | + public define HTML_In_Form | |
| 366 | + dojo_declaration | |
| 367 | + ( | |
| 368 | + String name, | |
| 369 | + List(CoreAttrs) attributes, | |
| 370 | + HTML_In_Form content | |
| 371 | + )= | |
| 372 | + div([attr("dojoType", "dijit.Declaration"), attr("widgetClass", name) . attributes ], | |
| 373 | + content). | |
| 374 | + | |
| 370 | 375 | public define HTML_In_Form |
| 371 | 376 | dojo_editor |
| 372 | 377 | ( | ... | ... |
calexium_lib/web/CXM_making_a_web_site.anubis
| ... | ... | @@ -1053,7 +1053,7 @@ public type HTML_In_Form: |
| 1053 | 1053 | check_box_r (List(InputAttrs), String label_text, HtmlId id, WebArgName name, WebArgValue value, Bool checked), |
| 1054 | 1054 | div (List(CoreAttrs), HTML_In_Form content), |
| 1055 | 1055 | div_empty (List(CoreAttrs)), |
| 1056 | - hidden (WebArgName name, InitialValue init). | |
| 1056 | + hidden (HtmlId id, WebArgName name, InitialValue init). | |
| 1057 | 1057 | |
| 1058 | 1058 | |
| 1059 | 1059 | 'HTML_In_Form' defines all the elements you may put within a form. We define a |
| ... | ... | @@ -1194,6 +1194,11 @@ public define HTML_In_Form |
| 1194 | 1194 | public define HTML_In_Form |
| 1195 | 1195 | file_upload (WebArgName name, Int width) |
| 1196 | 1196 | = file_upload([], "", htmlId(""), name, width). |
| 1197 | + | |
| 1198 | +public define HTML_In_Form | |
| 1199 | + hidden (WebArgName name, InitialValue init) | |
| 1200 | + = if name is wan(web_name) then | |
| 1201 | + hidden(htmlId(web_name), name, init). | |
| 1197 | 1202 | |
| 1198 | 1203 | public type HTML_Body:... |
| 1199 | 1204 | |
| ... | ... | @@ -3999,8 +4004,8 @@ define Printable_tree |
| 3999 | 4004 | format(cinfo,sn,ic_v,any_div(options, e),format_element,is_https), |
| 4000 | 4005 | div_empty(options) then |
| 4001 | 4006 | format(cinfo,sn,ic_v,any_div_empty(options),format_element,is_https), |
| 4002 | - hidden(name, value) then | |
| 4003 | - ["<input type=\"hidden\" name=\"",name,"\" value=\"",value,"\" />"], | |
| 4007 | + hidden(id, name, value) then | |
| 4008 | + ["<input type=\"hidden\" id=\"",id,"\" name=\"",name,"\" value=\"",value,"\" />"], | |
| 4004 | 4009 | |
| 4005 | 4010 | }. |
| 4006 | 4011 | |
| ... | ... | @@ -4081,7 +4086,7 @@ define Bool |
| 4081 | 4086 | check_box_r(o,_,_,n,v,c) then false, |
| 4082 | 4087 | div(o,c) then contains_an_upload(c), |
| 4083 | 4088 | div_empty(o) then false, |
| 4084 | - hidden(_,_) then false | |
| 4089 | + hidden(_,_,_) then false | |
| 4085 | 4090 | }. |
| 4086 | 4091 | |
| 4087 | 4092 | define String | ... | ... |