NAME
HTML::GUI::container - Create and control a whole container for web application
VERSION
Version 0.01
CONTAINER
Manage a container : it loads its definition with a YAML file and create all the widgets it contains. It can generate javascript code to check constraints on the web page. It can test if constraints of each widget are OK. It can generate the HTML of each widget for use with HTML::Template.
PUBLIC METHODS
new
create a new container
addChild
Parameters :
widget_def : hash ref : Parameters to define the widget inside the container.
The same parameters as to create a a widget but you can specify the cloneID (the id of the widget you want to clone from).
Return :
Description :
Create and add a widget to the container
getDefinitionData
Specialization of the widget.pm function
getIds
Return :
array
Description :
return an array of the ids of the widgets which belong
to the container.
setIndex
Parameters :
$widget : widget objet : the object to add to the index.
Description :
update the index of the container and all of its parents in order to have all indexes "up-to-date"
getElementById
Parameters :
id : string : id of the object to find.
Description :
return the objet widget whose id is $id or undef if no object has this id
setDefaultField
Parameters :
widgetObj : widget : The widget objet you want to use as a default widget.
Return :
Description :
The default widget defined with this function will be used anytime your create a new widget without specifiing options.
ListError
Return :
string
Description :
Return a string describing all the public errors that occured in all the widget objects in order to explain to the user why his input cannot be recorded.
validate
Return :
return 1 if no field of the container break no constraint
return 0 if one or more field break constraint
getFiredBtn
Parameters :
$params : the hash ref containing the POST key-value pairs.
Description :
Find the button the user clic (if one button was fired)
Returns :
- The button object which was fired
- undef if no button was fired
getValueHash
Description :
get all the values stored in the container
Return :
a ref to a hash containing the value associated to each input id
setValueFromParams
Description :
set the value of the widgets of the container for which a value fits in $params hash;
Return :
nothing
setValue
Description :
set the value of the widgets of the container for which a value fits in $params hash;
Parameters :
$valueHash : a hash ref of the same form as the function getValueHash returns
Return :
nothing
getHtml
Return :
a string containing the html of the widget contained in the container.
DESTROY The destructor to erase the ref to the parent and avoid cycle references
AUTHOR
Jean-Christian Hassler, <jhassler at free.fr>
BUGS
Please report any bugs or feature requests to bug-gui-libhtml-container at rt.cpan.org
, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=HTML-GUI-widget. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
SUPPORT
You can find documentation for this module with the perldoc command.
perldoc HTML::GUI::widget
You can also look for information at:
AnnoCPAN: Annotated CPAN documentation
CPAN Ratings
RT: CPAN's request tracker
Search CPAN
ACKNOWLEDGEMENTS
COPYRIGHT & LICENSE
Copyright 2007 Jean-Christian Hassler, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.