Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

jifty::web::form(3pm) [debian man page]

Jifty::Web::Form(3pm)					User Contributed Perl Documentation				     Jifty::Web::Form(3pm)

NAME
Jifty::Web::Form - Tools for rendering and dealing with HTML forms METHODS
new ARGS Creates a new Jifty::Web::Form. Arguments: id The HTML id attribute given to the form. This is aliased to name. That is, name and id are always equal and changing one changes the other. class The HTML class attribute given to the form. name The name given to the form. This is mostly for naming specific forms for testing. call All buttons in this form will act as continuation calls for the given continuation id. disable_autocomplete Disable browser autocomplete for this form. Jifty autocomplete will still work. PRIVATE _init Reinitialize this form. name The form name call The continuation id to call actions Returns a reference to a hash of Jifty::Action objects in this form keyed by moniker. If you want to add actions to this form, use "add_action" name [VALUE] Gets or sets the HTML name given to the form element. call [CONTID] Gets or sets the continuation ID that will be called for this form. is_open [BOOL] This accessor returns true if Jifty is currently in the middle of rendering a form (if it's printed a <form> but not yet printed a </form> tag.) Use this in your components to decide whether to open a form or not if you might be called from a template that opened the form for you. add_action PARAMHASH Calls "new_action" in Jifty::Web with the paramhash given, and adds it to the form. register_action ACTION Adds "ACTION" as an action for this form. Called so that actions' form fields can register the action against the form they're being used in. has_action MONIKER If this form has an action whose moniker is "MONIKER", returns it. Otherwise returns undef. start Renders the opening form tag. submit MESSAGE, [PARAMETERS] Renders a submit button with the text MESSAGE on it (which will be HTML escaped). Returns the empty string (for ease of use in interpolation). Any extra PARAMETERS are passed to Jifty::Web::Form::Field::Clickable's constructor. return MESSAGE, [PARAMETERS] Renders a return button with the text MESSAGE on it (which will be HTML escaped). Returns the empty string (for ease of use in interpolation). Any extra PARAMETERS are passed to Jifty::Web::Form::Field::Button's constructor. end Renders the closing form tag (including rendering errors for and registering all of the actions) After doing this, it resets its internal state such that "start" may be called again. print_action_registration MONIKER Print out the action registration goo for this action _right now_, unless we've already done so. next_page PARAMHASH Set the page this form should go to on success. This simply creates a Jifty::Action::Redirect action; any parameters in the "PARAMHASH" are passed as arguments to the Jifty::Action::Redirect action. Returns an empty string so it can be included in forms DESTROY Checks to ensure that forms that were opened were actually closed, which is when actions are registered. perl v5.14.2 2011-01-24 Jifty::Web::Form(3pm)

Check Out this Related Man Page

Jifty::Test::WWW::Mechanize(3pm)			User Contributed Perl Documentation			  Jifty::Test::WWW::Mechanize(3pm)

NAME
Jifty::Test::WWW::Mechanize - Subclass of Test::WWW::Mechanize with extra Jifty features METHODS
new Overrides Test::WWW::Mechanize's "new" to automatically give the bot a cookie jar. request We override WWW::Mechanize's default request method so accept-encoding is not set to gzip by default. moniker_for ACTION, FIELD1 => VALUE1, FIELD2 => VALUE2 Finds the moniker of the first action of type ACTION whose "constructor" field FIELD1 is VALUE1, and so on. my $mon = $mech->moniker_for('MyApp::Action::UpdateInfo'); If there is only one action of type ACTION, be sure not to pass any more arguments to this method, or the method will return undef. NOTE that if you're using this in a series of different pages or forms, you'll need to run it again for each new form: $mech->fill_in_action_ok($mech->moniker_for('MyApp::Action::UpdateInfo'), owner_id => 'someone'); $mech->submit_html_ok(); is($mech->action_field_value($mech->moniker_for("MyApp::Action::UpdateInfo"), 'owner_id'), 'someone', "Owner was reassigned properly to owner 'someone'"); fill_in_action MONIKER, FIELD1 => VALUE1, FIELD2 => VALUE2, ... Finds the fields on the current page with the names FIELD1, FIELD2, etc in the MONIKER action, and fills them in. Returns the HTML::Form object of the form that the action is in, or undef if it can't find all the fields. fill_in_action_ok MONIKER, FIELD1 => VALUE1, FIELD2 => VALUE2, ... Finds the fields on the current page with the names FIELD1, FIELD2, etc in the MONIKER action, and fills them in. Returns the HTML::Form object of the form that the action is in, or undef if it can't find all the fields. Also, passes if it finds all of the fields and fails if any of the fields are missing. action_form MONIKER [ARGUMENTNAMES] Returns the form (as an HTML::Form object) corresponding to the given moniker (which also contains inputs for the given argumentnames), and also selects it as the current form. Returns undef if it can't be found. action_field_input MONIKER, FIELD Finds the field on the current page with the names FIELD in the action MONIKER, and returns its HTML::Form::Input, or undef if it can't be found. action_field_value MONIKER, FIELD Finds the field on the current page with the names FIELD in the action MONIKER, and returns its value, or undef if it can't be found. send_action CLASS ARGUMENT => VALUE, [ ... ] Sends a request to the server via the webservices API, and returns the Jifty::Result of the action. "CLASS" specifies the class of the action, and all parameters thereafter supply argument keys and values. The URI of the page is unchanged after this; this is accomplished by using the "back button" after making the webservice request. fragment_request PATH ARGUMENT => VALUE, [ ... ] Makes a request for the fragment at PATH, using the webservices API, and returns the string of the result. field_error_text MONIKER, FIELD Finds the error span on the current page for the name FIELD in the action MONIKER, and returns the text (tags stripped) from it. (If the field can't be found, return undef). uri WWW::Mechanize has a bug where it returns the wrong value for "uri" after redirect. This fixes that. See http://rt.cpan.org/NoAuth/Bug.html?id=9059 get_html_ok URL Calls "get" URL, followed by testing the HTML using Test::HTML::Lint. html_ok [STRING] Tests the current "content" using Test::HTML::Lint. If passed a string, tests against that instead of the current content. submit_html_ok Calls "submit", followed by testing the HTML using Test::HTML::Lint. follow_link_ok Calls "follow_link", followed by testing the HTML using Test::HTML::Lint. Warns if it cannot find the specified link (you should use "ok" on "find_link" first to check its existence). warnings_like WARNING, [REASON] Tests that the warnings generated by the server (since the last such check) match the given "WARNING", which should be a regular expression. If an array reference of regular expressions is passed as "WARNING", checks that one warning per element was received. no_warnings_ok [REASON] Checks that no warnings were generated by the server (since the last such check). session Returns the server-side Jifty::Web::Session object associated with this Mechanize object. continuation [ID] Returns the current continuation of the Mechanize object, if any. Or, given an ID, returns the continuation with that ID. current_user Returns the Jifty::CurrentUser object or descendant, if any. perl v5.14.2 2011-04-14 Jifty::Test::WWW::Mechanize(3pm)
Man Page