Help-Site Computer Manuals
Software
Hardware
Programming
Networking
  Algorithms & Data Structures   Programming Languages   Revision Control
  Protocols
  Cameras   Computers   Displays   Keyboards & Mice   Motherboards   Networking   Printers & Scanners   Storage
  Windows   Linux & Unix   Mac

Jifty::Web::Form::Clickable
Some item that can be clicked on -- either a button or a link.

Jifty::Web::Form::Clickable - Some item that can be clicked on -- either a button or a link.


NAME

Jifty::Web::Form::Clickable - Some item that can be clicked on -- either a button or a link.


DESCRIPTION

accessors

Clickable adds url, escape_label, continuation, call, returns, submit, and preserve_state to the list of accessors and mutators, in addition to those offered by accessors in the Jifty::Web::Form::Element manpage.

new PARAMHASH

Creates a new the Jifty::Web::Form::Clickable manpage object. Depending on the requirements, it may render as a link or as a button. Possible parameters in the PARAMHASH are:

url
Sets the page that the user will end up on after they click the button. Defaults to the current page.

label
The text on the clickable object.

tooltip
Additional information about the link target.

escape_label
If set to true, HTML escapes the content of the label and tooltip before displaying them. This is only relevant for objects that are rendered as HTML links. The default is true.

continuation
The current continuation for the link. Defaults to the current continuation now, if there is one. This may be either a the Jifty::Continuation manpage object, or the id of such.

call
The continuation to call when the link is clicked. This will happen after actions have run, if any. Like continuation, this may be a the Jifty::Continuation manpage object or the id of such.

returns
Passing this parameter implies the creation of a continuation when the link is clicked. It takes an anonymous hash of return location to where the return value is pulled from -- that is, the same structure the parameters method takes.

See query_parameters in the Jifty::Request::Mapper manpage for details.

submit
A list of actions to run when the object is clicked. This may be an array refrence or a single element; each element may either be a moniker or, a the Jifty::Action manpage or a hashref with the keys 'action' and 'arguments'. An undefined value submits all actions in the form, an empty list reference (the default) submits none.

In the most complex case, you have something like this:


    submit => [

                  {   action    => $my_action,

                      arguments => {

                          name => 'Default McName',

                          age  => '23'

                      },

                  },

                  $my_other_action,

                  'some-other-action-moniker'

              ]

If you specify arguments in the submit block for a button, they will override any values from form fileds submitted by the user.

preserve_state
A boolean; whether state variables are preserved across the link. Defaults to true if there are any AJAX actions on the link, false otherwise.

parameters
A hash reference of query parameters that go on the link or button. These will end up being submitted exactly like normal query parameters.

as_button
By default, Jifty will attempt to make the clickable into a link rather than a button, if there are no actions to run on submit. Providing a true value for as_button forces the generate manpage to produce a the Jifty::Web::Form::Clickable::InlineButton manpage instead of a the Jifty::Web::Form::Link manpage.

as_link
Attempt to rework a button into displaying as a link -- note that this only works in javascript browsers. Supplying both as_button and as_link will work, and not as perverse as it might sound at first -- it allows you to make any simple GET request into a POST request, while still appearing as a link (a GET request).

target
For things that start off as links, give them an html target attribute.

Anything from the Jifty::Web::Form::Element manpage
Note that this includes the onclick parameter, which allows you to attach javascript to your Clickable object, but be careful that your Javascript looks like return someFunction();, or you may get an unexpected error from your browser.

url

Sets the page that the user will end up on after they click the button. Defaults to the current page.

label

The text on the clickable object.

escape_label

If set to true, HTML escapes the content of the label before displaying it. This is only relevant for objects that are rendered as HTML links. The default is true.

continuation

The current continuation for the link. Defaults to the current continuation now, if there is one. This may be either a the Jifty::Continuation manpage object, or the id of such.

call

The continuation to call when the link is clicked. This will happen after actions have run, if any. Like continuation, this may be a the Jifty::Continuation manpage object or the id of such.

returns

Passing this parameter implies the creation of a continuation when the link is clicked. It takes an anonymous hash of return location to where the return value is pulled from. See the Jifty::Request::Mapper manpage for details.

submit

A list of actions to run when the object is clicked. This may be an array refrence or a single element; each element may either be a moniker or a the Jifty::Action manpage. An undefined value submits all actions in the form, an empty list reference (the default) submits none.

preserve_state

A boolean; whether state variables are preserved across the link. Defaults to true if there are any AJAX actions on the link, false otherwise.

parameter KEY VALUE

Sets the given HTTP paramter named KEY to the given VALUE.

state_variable KEY VALUE

Sets the state variable named KEY to VALUE.

region_fragment NAME PATH

Sets the path of the fragment named NAME to be PATH.

region_argument NAME ARG VALUE

Sets the value of the ARG argument on the fragment named NAME to VALUE.

parameters

Returns the generic list of HTTP form parameters attached to the link as a hash. Use of this is discouraged in favor or post_parameters and get_parameters.

post_parameters

The hash of parameters as they would be needed on a POST request.

get_parameters

The hash of parameters as they would be needed on a GET request.

complete_url

Returns the complete GET URL, as it would appear on a link.

as_link

Returns the clickable as a the Jifty::Web::Form::Link manpage, if possible. Use of this method is discouraged in favor of generate, which can better determine if a link or a button is more appropriate.

as_button

Returns the clickable as a the Jifty::Web::Form::Field::InlineButton manpage, if possible. Use of this method is discouraged in favor of generate, which can better determine if a link or a button is more appropriate.

generate

Returns a the Jifty::Web::Form::Field::InlineButton manpage or Jifty::Web::Form::Link, whichever is more appropriate given the parameters.

Programminig
Wy
Wy
yW
Wy
Programming
Wy
Wy
Wy
Wy