Commit e3ffb1b4a7f5942ff58991e799dcb9ffd05b0b71

Authored by totoro
1 parent 523830e5

add WEB_Action_Name to be compliant with the current Calexium_Lib

Showing 1 changed file with 17 additions and 10 deletions   Show diff stats
view/view_table_renderer.anubis
... ... @@ -32,6 +32,13 @@ read calexium_lib/web/CXM_form.anubis
32 32 read calexium_lib/web/widgets/css_helper.anubis
33 33 read calexium_lib/web/widgets/button.anubis
34 34  
  35 +public define WEB_Action_Name edit_table = controller_action("hk_c", "edit_table").
  36 +public define WEB_Action_Name view_table = controller_action("hk_c", "view_table").
  37 +public define WEB_Action_Name save_row = controller_action("hk_c", "save_row").
  38 +public define WEB_Action_Name delete_row = controller_action("hk_c", "delete_row").
  39 +public define WEB_Action_Name ajax_edit_table = controller_action("hk_c", "ajax_edit_table").
  40 +
  41 +
35 42 define CXM_Form_Field
36 43 help_line
37 44 (
... ... @@ -112,7 +119,7 @@ public define HTML_Partial_Content
112 119 partial_content(jq_datetimepicker_init(lang),
113 120 cxm_form( table_name, lwa,
114 121 edit_form_lines(db, _T, vt_elist.list, [])+
115   - [ submit("create", failure, button_name, [("table_name", table_name)]) ]
  122 + [ submit(save_row, failure, button_name, [("table_name", table_name)]) ]
116 123 )).
117 124  
118 125 public define Maybe(HTML_Partial_Content)
... ... @@ -140,7 +147,7 @@ public define Maybe(HTML_Partial_Content)
140 147 define HTML_Row(HTML_Off_Form) make_line
141 148 (
142 149 String table_name,
143   - String action_name, //default is "edit_table", but can be surcharged for own use
  150 + String _action_name, //default is "edit_table", but can be surcharged for own use
144 151 List(VT_view_entry) entries,
145 152 List(HTML_Cell(HTML_Off_Form)) so_far
146 153 )=
... ... @@ -152,11 +159,11 @@ define HTML_Row(HTML_Off_Form) make_line
152 159 {
153 160 text(string) then cell((HTML_Off_Form)text(not_null_String(string))),
154 161 // link(id, string) then cell((HTML_Off_Form)actioner(same,same, link(string), action_name, [("table_name", table_name),("id",id)])),
155   - link(id, string) then cell((HTML_Off_Form)literal(jq_dialog_open(string, dialog_id(action_name+"_dlg_ajax"), "'id="+id+"'"))),
156   - link_id_action(id, name, action) then cell((HTML_Off_Form)actioner(same,same, link(name), action, [("id",id)])),
  162 + link(id, string) then cell((HTML_Off_Form)literal(jq_dialog_open(string, dialog_id(_action_name+"_dlg_ajax"), "'id="+id+"'"))),
  163 + link_id_action(id, name, action) then cell((HTML_Off_Form)actioner(same,same, link(name), action_name(action), [("id",id)])),
157 164 icon(icon_path) then cell((HTML_Off_Form)image([], icon_path, ""))
158 165 },
159   - make_line(table_name, action_name, t, [cell . so_far])
  166 + make_line(table_name, _action_name, t, [cell . so_far])
160 167 }.
161 168  
162 169 define List(HTML_Row(HTML_Off_Form))
... ... @@ -177,7 +184,7 @@ define List(HTML_Row(HTML_Off_Form))
177 184 with actions_cell = (HTML_Cell(HTML_Off_Form))
178 185 cell([],
179 186 sequence([
180   - partial(img_button_confirm(icn16_cross, _T("CONFIRMATION_REQUEST"), _T("CONFIRM_LINE_DELETION") , _T("OK"), _T("CANCEL"), jQuery_actioner(same, jqlink, "hk_del_row" + format_extra_operands([("table_name", table_name),("id",to_String(h.db_id))])))),
  187 + partial(img_button_confirm(icn16_cross, _T("CONFIRMATION_REQUEST"), _T("CONFIRM_LINE_DELETION") , _T("OK"), _T("CANCEL"), jQuery_actioner(same, jqlink(controller_action("hk_c", "delete_row" + format_extra_operands([("table_name", table_name),("id",to_String(h.db_id))])))))),
181 188 partial(img_button(icn16_edit, [event(onclick, jq_dialog_open(dialog_id(action_name+"_dlg_ajax"), "'id="+to_String(h.db_id)+"'"))], "", [])),
182 189 ])
183 190 ),
... ... @@ -199,8 +206,8 @@ define HTML_Header_Row(HTML_Off_Form)
199 206 with cell = if h is
200 207 {
201 208 text(string) then header_cell((HTML_Off_Form)text(_T(string))),
202   - link(id, string) then header_cell((HTML_Off_Form)actioner(same,same, link(string),"edit_table",[])), //TODO
203   - link_id_action(id, text, action) then header_cell((HTML_Off_Form)actioner(same,same, link(text),action,[("id",id)])), //TODO
  209 + link(id, string) then header_cell((HTML_Off_Form)actioner(same, same, link(string), edit_table,[])), //TODO
  210 + link_id_action(id, text, action) then header_cell((HTML_Off_Form)actioner(same,same, link(text),action_name(action),[("id",id)])), //TODO
204 211 icon(icon_path) then header_cell((HTML_Off_Form)image([], icon_path, ""))
205 212 },
206 213 make_header(_T, t, [cell . so_far])
... ... @@ -220,9 +227,9 @@ public define HTML_Partial_Content
220 227 div( [/*class("tableau")*/],
221 228 sequence(
222 229 [
223   - partial(jquery_button(jQuery_button(button, "edit_table_"+rows.table_name, "", _T("NEW"), jQuery_actioner(same, jqlink, "edit_table&table_name="+rows.table_name)))),
  230 + partial(jquery_button(jQuery_button(button, "edit_table_"+rows.table_name, "", _T("NEW"), jQuery_actioner(same, jqlink(controller_action("hk_c", "edit_table&table_name="+rows.table_name)))))),
224 231 //dialog used by datatable entries
225   - partial(jq_dialog_create(dialog_id(action_name+"_dlg_ajax"), ajax("?a=ajax_edit_table&table_name="+rows.table_name))),
  232 + partial(jq_dialog_create(dialog_id(action_name+"_dlg_ajax"), ajax(controller_action("hk_c", "ajax_edit_table&table_name="+rows.table_name)))),
226 233  
227 234 table([core_attrs([id("table_view"), class("tableau display compact nowrap")])],
228 235 make_header(_T, rows.header.list, [action_header_cell]),
... ...