NAME

HTML::Controls::SingleChoice - class for a single choice ("select") control

SYNOPSIS

my $sc = HTML::Controls::SingleChoice->new('name',@items);

This class implements a control for choosing one item among an array. It uses the standard <select><option>... HTML field.

REDEFINED PUBLIC METHODS

new

This class' contructor takes, in addition to the control's name, an array or array reference containing the items the user has to choose from. Using the stock template, these items will be displayed directly as given (but passed through the HTML filter).

setData

Thi method is redefined not to call "_preprocess_value". It just stores the passed value.

REDEFINED PROTECTED METHODS

_preprocess_value

This method converts the posted value (an integer, see the template file) into the intended (internal) value. It just uses the posted integer as an index into the items array. Returns undef if the pastod value was not an integer, or was nto a valid index.

_body_template_name

Returns 'singlechoice.wt'.

_body_template_parms

Calls the inherited method, then adds to the hash a reference to the items array, with the koy list.

COPYRIGHT

Copyright 2005 Gianni Ceccarelli, All Rights Reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.