Commit db28ee031cd33baaacf4b328fd2faa9155f1b599

Authored by David RENÉ
1 parent f9b10d0d

add img_submit_button_load which is submitting form and the result is loaded int…

…o target_id by using (ajax_load_content)
web/CXM_jquery.anubis
@@ -14,6 +14,7 @@ read tools/basis.anubis @@ -14,6 +14,7 @@ read tools/basis.anubis
14 /* jQuery Actioner type */ 14 /* jQuery Actioner type */
15 public type JQuery_Actioner_type: 15 public type JQuery_Actioner_type:
16 jqform ( String form, WEB_Action_Name name, List((String,String)) extra_ops), 16 jqform ( String form, WEB_Action_Name name, List((String,String)) extra_ops),
  17 + jqformload ( String form, String target, WEB_Action_Name name, List((String,String)) extra_ops),
17 jqlink ( WEB_Action_Name name, List((String,String)) extra_ops), 18 jqlink ( WEB_Action_Name name, List((String,String)) extra_ops),
18 jqflink ( String link), 19 jqflink ( String link),
19 jqscript( String script), 20 jqscript( String script),
@@ -90,6 +91,8 @@ public define String @@ -90,6 +91,8 @@ public define String
90 "$('#"+form+"').get(0).setAttribute('action','"+url+"');", 91 "$('#"+form+"').get(0).setAttribute('action','"+url+"');",
91 }+ 92 }+
92 "$('#"+form+"').submit();\n", 93 "$('#"+form+"').submit();\n",
  94 + jqformload(form_id, target_id, web_action, extra_args) then
  95 + "CalexiumToolBox.jq_form_submit_and_load('"+form_id+"', '"+format_web_action_name(web_action, extra_args)+"', '"+target_id+"');\n"
93 jqlink(control_action, extra_ops) then 96 jqlink(control_action, extra_ops) then
94 if control_action is 97 if control_action is
95 { 98 {
@@ -117,6 +120,8 @@ public define String @@ -117,6 +120,8 @@ public define String
117 "$('#"+form+"').get(0).setAttribute('action','"+url+"');", 120 "$('#"+form+"').get(0).setAttribute('action','"+url+"');",
118 }+ 121 }+
119 "$('#"+form+"').submit();\n", 122 "$('#"+form+"').submit();\n",
  123 + jqformload(form_id, target_id, web_action, extra_args) then
  124 + "CalexiumToolBox.jq_form_submit_and_load('"+form_id+"', '"+format_web_action_name(web_action, extra_args)+"', '"+target_id+"');\n"
120 jqlink(control_action, extra_ops) then 125 jqlink(control_action, extra_ops) then
121 if control_action is 126 if control_action is
122 { 127 {
@@ -144,6 +149,8 @@ public define String @@ -144,6 +149,8 @@ public define String
144 "$('#"+form+"').get(0).setAttribute('action','"+url+"');", 149 "$('#"+form+"').get(0).setAttribute('action','"+url+"');",
145 }+ 150 }+
146 "$('#"+form+"').submit();\n", 151 "$('#"+form+"').submit();\n",
  152 + jqformload(form_id, target_id, web_action, extra_args) then
  153 + "CalexiumToolBox.jq_form_submit_and_load('"+form_id+"', '"+format_web_action_name(web_action, extra_args)+"', '"+target_id+"');\n"
147 jqlink(control_action, extra_ops) then 154 jqlink(control_action, extra_ops) then
148 if control_action is 155 if control_action is
149 { 156 {
web/jQuery/CXM_jquery_button.anubis
@@ -371,6 +371,17 @@ public define HTML_Partial_Content @@ -371,6 +371,17 @@ public define HTML_Partial_Content
371 WEB_Action_Name action 371 WEB_Action_Name action
372 )= 372 )=
373 jquery_button(jquery_img_button(icn16_check, label, "", jQuery_actioner(same, jqform(form_id, action, [])), left)). 373 jquery_button(jquery_img_button(icn16_check, label, "", jQuery_actioner(same, jqform(form_id, action, [])), left)).
  374 +
  375 +public define HTML_Partial_Content
  376 + img_submit_button_load
  377 + (
  378 + String label, //translated label of the button
  379 + String form_id, //form id to submit
  380 + String target_id,
  381 + WEB_Action_Name action
  382 + )=
  383 + jquery_button(jquery_img_button(icn16_check, label, "", jQuery_actioner(same, jqformload(form_id, target_id, action, [])), left)).
  384 +
374 385
375 public define HTML_Partial_Content 386 public define HTML_Partial_Content
376 img_submit_button 387 img_submit_button