_xowiki__form_fields_from_form_constraints (private)

 _xowiki__form_fields_from_form_constraints

Defined in packages/xowiki/tcl/test/api-test-procs.tcl

Partial Call Graph (max 5 caller/called nodes):
%3 aa_log aa_log (public) aa_log_result aa_log_result (public) aa_true aa_true (public) ad_conn ad_conn (public) dom dom _xowiki__form_fields_from_form_constraints _xowiki__form_fields_from_form_constraints _xowiki__form_fields_from_form_constraints->aa_log _xowiki__form_fields_from_form_constraints->aa_log_result _xowiki__form_fields_from_form_constraints->aa_true _xowiki__form_fields_from_form_constraints->ad_conn _xowiki__form_fields_from_form_constraints->dom

Testcases:
No testcase defined.
Source code:
        
        set _aa_export {}
        set body_count 1
        foreach testcase_body {{
        ::xo::require_html_procs
        set p1 [xowiki::Page new  -name en:foo  -package_id [ad_conn package_id]  -destroy_on_cleanup]
        aa_log "p1 = $p1"
        foreach fc {
            {t:textarea,value=foo}
            {show_ip:boolean,horizontal=true,default=t,label=Show_IP}
            {date:date,default=2022-02-01 22:03:00}
        } props {
            {name t rows 2 cols 80}
            {name show_ip value t horizontal true required false label Show_IP}
            {name date value "2022-02-01 22:03:00"}
        } {
            set ff [$p1 create_form_fields_from_form_constraints  [list $fc]]

            aa_log "<pre>[$ff serialize]</pre>"
            #aa_log "[$ff name] [$ff info class] [$ff value]"
            foreach {k v} $props {
                aa_true "$k has value '$v' == '[$ff $k]'" {[$ff $k] eq $v}
            }
            dom createDocument html doc
            set root [$doc documentElement]
            $root appendFromScript {
                $ff render_input
            }
            #
            # Here we could check with xpath the content of the rended
            # form field.
            #
            set HTML [lmap n [$root childNode] {$n asHTML}]
            aa_log "<pre>[ns_quotehtml $HTML]</pre>"
        }
    }} {
          aa_log "Running testcase body $body_count"
          set ::__aa_test_indent [info level]
          set catch_val [catch $testcase_body msg]
          if {$catch_val != 0 && $catch_val != 2} {
              aa_log_result "fail" "form_fields_from_form_constraints (body $body_count): Error during execution: $msg, stack trace: \n$::errorInfo"
          }
          incr body_count
        }
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: