xowf::WorkflowPage instproc www-view (public)

 <instance of xowf::WorkflowPage[i]> www-view [ content ]

Defined in packages/xowf/tcl/xowf-procs.tcl

Provide additional view modes: - edit: instead of viewing a page, it is opened in edit mode - view_user_input: show user the provided input - view_user_input_with_feedback: show user the provided input with feedback

Parameters:
content (optional)

Partial Call Graph (max 5 caller/called nodes):
%3 test_create_test_items create_test_items (test xowf) xowf::WorkflowPage instproc www-view xowf::WorkflowPage instproc www-view test_create_test_items->xowf::WorkflowPage instproc www-view test_create_workflow_with_instance create_workflow_with_instance (test xowf) test_create_workflow_with_instance->xowf::WorkflowPage instproc www-view

Testcases:
create_test_items, create_workflow_with_instance
Source code:
# The edit method calls view with an HTML content as argument.
# To avoid a loop, when "view" is redirected to "edit",
# we make sure that we only check the redirect on views
# without content.

#:msg "view [self args] [:is_wf_instance]"

if {[:is_wf_instance] && $content eq ""} {
  set ctx [::xowf::Context require [self]]
  set method [$ctx get_view_method]
  set s [$ctx current_state]
  :include_header_info -css [$s extra_css] -js [$s extra_js]

  if {$method ne "" && $method ne "view"} {
    #:msg "view redirects to $method in state [$ctx get_current_state]"
    switch -- $method {
      view_user_input {
        #:msg "calling edit with disable_input_fields=1"
        return [:www-edit -disable_input_fields 1]
      }
      view_user_input_with_feedback {
        set :__feedback_mode 1
        #:msg "calling edit with disable_input_fields=1"
        return [:www-edit -disable_input_fields 1]
      }
      default {
        #:msg "calling $method"
        return [::${:package_id} invoke -method $method]
      }
    }
  }
}
next
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: