template::form::get_action (public)

 template::form::get_action id

Defined in packages/acs-templating/tcl/form-procs.tcl

Find out which action is in progress. This is the name of the button which was clicked when the form was in display mode.

Parameters:
id (required)
The ID of an ATS form object.
Returns:
the name of the action in progress

Partial Call Graph (max 5 caller/called nodes):
%3 packages/chat/www/transcript-edit.tcl packages/chat/ www/transcript-edit.tcl template::form::get_action template::form::get_action packages/chat/www/transcript-edit.tcl->template::form::get_action packages/forums/www/moderate/move-thread-thread.tcl packages/forums/ www/moderate/move-thread-thread.tcl packages/forums/www/moderate/move-thread-thread.tcl->template::form::get_action packages/forums/www/moderate/move-thread.tcl packages/forums/ www/moderate/move-thread.tcl packages/forums/www/moderate/move-thread.tcl->template::form::get_action packages/forums/www/moderate/move.tcl packages/forums/ www/moderate/move.tcl packages/forums/www/moderate/move.tcl->template::form::get_action template::form::create template::form::create (public) template::form::create->template::form::get_action template::adp_level template::adp_level (public) template::form::get_action->template::adp_level template::form::get_button template::form::get_button (public) template::form::get_action->template::form::get_button

Testcases:
No testcase defined.
Source code:
    # keep form properties and a list of the element items
    upvar #[template::adp_level$id:formaction formaction

    # If we've already found the action, just return that
    if { [info exists formaction] } {
        return $formaction
    }

    # Otherwise, find out now

    set formaction {}

    # If the form isn't being submitted at all, there's no action
    if { $id ne [ns_queryget "form:id"] } {
        return {}
    }

    set formbutton [get_button $id]

    # If we were in display mode, and a button was clicked, we should be in edit mode now
    if { [ns_queryget "form:mode"] eq "display" && $formbutton ne "" } {
        set formaction $formbutton
        return $formaction
    }

    # Otherwise, there should be a form:formaction variable in the form
    set formaction [ns_queryget "form:formaction"]

    return $formaction
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: