1,801
การแก้ไข
| บรรทัดที่ 706: | บรรทัดที่ 706: | ||
* '''''Post-submission''''': Process what to do next based on pre-defined form attributes and the {{code|data}} returned from the server. | * '''''Post-submission''''': Process what to do next based on pre-defined form attributes and the {{code|data}} returned from the server. | ||
*# If the server demands redirection to another route ('''{{code|data.redirect}}''') or reload of the same page ('''{{code|data.reload}}'''), do so and end the submission routine. | *# If the server demands redirection to another route ('''{{code|data.redirect}}''': ''url_for string'') or reload of the same page ('''{{code|data.reload}}''': ''bool''), do so and end the submission routine. | ||
*# If the server demands a new tab to open a new route ('''{{code|data.new_tab}}'''), do so before continuing. | *# If the server demands a new tab to open a new route ('''{{code|data.new_tab}}''': ''url_for string''), do so before continuing. | ||
*# ''(Only applies when the submission fails FlaskForm validation on the server-side)'' Render field error messages packed in '''{{code|data.err}}'''. | *# ''(Only applies when the submission fails FlaskForm validation on the server-side)'' Render field error messages packed in '''{{code|data.err}}''' (''dict'': See note). | ||
*# Render flash messages packed in '''{{code|data.flash_messages}}'''. | *# Render flash messages packed in '''{{code|data.flash_messages}}''' (''dict'': See note). | ||
*# This step is split into 3 paths: | *# This step is split into 3 paths: | ||
*#* The submission '''triggers a thread-based process''' on the server ({{code|lang=javascript|1= form_obj.wait_long_process === true}}): | *#* The submission '''triggers a thread-based process''' on the server ({{code|lang=javascript|1= form_obj.wait_long_process === true}}): | ||
| บรรทัดที่ 716: | บรรทัดที่ 716: | ||
*#* '''The submission fails''' ('''{{code|lang=javascript|1= data.data === 'failure'}}'''), set the page flag '''will_proceed_editmode''' to {{code|lang=javascript|false}}. ''(This flag prevents a multi-component page from proceeding through a failed step.)'' | *#* '''The submission fails''' ('''{{code|lang=javascript|1= data.data === 'failure'}}'''), set the page flag '''will_proceed_editmode''' to {{code|lang=javascript|false}}. ''(This flag prevents a multi-component page from proceeding through a failed step.)'' | ||
*#* '''The submission succeeds''' ('''{{code|lang=javascript|1= data.data === 'success'}}'''): | *#* '''The submission succeeds''' ('''{{code|lang=javascript|1= data.data === 'success'}}'''): | ||
*#*# If the form must be repopulated ('''{{code|data.repop}}''': ''dict''), do so. ''('''{{code|data.repop}}''' shares the same format with the form data in '''{{code|data.crossfill}}''' | *#*# If the form must be repopulated ('''{{code|data.repop}}''': ''dict''), do so. ''('''{{code|data.repop}}''' shares the same format with the form data in '''{{code|data.crossfill}}''': See note.)'' | ||
*#*# If other tables and forms on the page are affected ('''{{code|data.crossfill}}''': ''dict''), re-populate them. | *#*# If other tables and forms on the page are affected ('''{{code|data.crossfill}}''': ''dict'': See note), re-populate them. | ||
*#*# | |||
| บรรทัดที่ 739: | บรรทัดที่ 740: | ||
... ] | ... ] | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{The Tenko Shrine}} | {{The Tenko Shrine}} | ||