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 14 /* jQuery Actioner type */
15 15 public type JQuery_Actioner_type:
16 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 18 jqlink ( WEB_Action_Name name, List((String,String)) extra_ops),
18 19 jqflink ( String link),
19 20 jqscript( String script),
... ... @@ -90,6 +91,8 @@ public define String
90 91 "$('#"+form+"').get(0).setAttribute('action','"+url+"');",
91 92 }+
92 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 96 jqlink(control_action, extra_ops) then
94 97 if control_action is
95 98 {
... ... @@ -117,6 +120,8 @@ public define String
117 120 "$('#"+form+"').get(0).setAttribute('action','"+url+"');",
118 121 }+
119 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 125 jqlink(control_action, extra_ops) then
121 126 if control_action is
122 127 {
... ... @@ -144,6 +149,8 @@ public define String
144 149 "$('#"+form+"').get(0).setAttribute('action','"+url+"');",
145 150 }+
146 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 154 jqlink(control_action, extra_ops) then
148 155 if control_action is
149 156 {
... ...
web/jQuery/CXM_jquery_button.anubis
... ... @@ -371,6 +371,17 @@ public define HTML_Partial_Content
371 371 WEB_Action_Name action
372 372 )=
373 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 386 public define HTML_Partial_Content
376 387 img_submit_button
... ...