Barry King > Apache-Wyrd > Apache::Wyrd::Site::WidgetControl

Download:
Apache-Wyrd-0.98.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.98   Source  

NAME ^

Apache::Wyrd::Site::WidgetControl - Links that change a Widget's State

SYNOPSIS ^

  <BASENAME::SomeWidget>
    <BASENAME::Site::WidgetControl attribute="color" value="blue" flags="default">
      Try this Widget in BLUE
    </BASENAME::Site::WidgetControl>
    <BASENAME::Site::WidgetControl attribute="color" value="green">
      Try this Widget in GREEN
    </BASENAME::Site::WidgetControl>
    <BASENAME::Site::WidgetControl attribute="color" value="red">
      Try this Widget in RED
    </BASENAME::Site::WidgetControl>
  </BASENAME::SomeWidget>

DESCRIPTION ^

A WidgetControl provides controlled access to attributes of a Widget via a self-maintaining set of links. These links provide encoded page-state data via a link to the Apache::Wyrd::Site::Page object of the target of that link. Using this page-state data, an attribute of the Widget in which the WidgetControl is enclosed can indipendently maintain its state from other widgets on the page, while allowing some element of it to be changed for a dynamic purpose, such as changing the sort order of a Pull, or altering the coloration or units of a chart.

To do so, it must return it's enclosed HTML "_data" in the final output, since the WidgetControl objects it encloses will have provided themselves as links in that HTML text.

HTML ATTRIBUTES

attribute

Which attribute of the enclosing widget is manipulated by this WidgetControl.

value

The value of that attribute if this Control's link is clicked.

off/on

How this Control should look (i.e. the HTML) when waiting to be clicked on, or if just clicked on. In general, it is simpler just to assign a class to the anchor tag and provide this class as an attribute to the WidgetControl.

FLAGS

default

Designate this WidgetControl out of all others in this widget as the "default" value.

PERL METHODS

(format: (returns) name (arguments after self))

(scalar) url (void)

create the href of the link which will provide the state data. The default is to bundle up all CGI attributes other than _page_state and put in placemarkers for the WidgetControl maintenance data.

BUGS/CAVEATS ^

Reserves the _setup and _format_output methods.

AUTHOR ^

Barry King <wyrd@nospam.wyrdwright.com>

SEE ALSO ^

Apache::Wyrd

General-purpose HTML-embeddable perl object

Apache::Wyrd::Site::Widget

Abstract dynamic element of a Page

Apache::Wyrd::Site::Page

Construct and track a page of an integrated site

LICENSE ^

Copyright 2002-2007 Wyrdwright, Inc. and licensed under the GNU GPL.

See LICENSE under the documentation for Apache::Wyrd.

syntax highlighting: