/[Apache-SVN]/perl/embperl/trunk/Embperl/Form/ControlMultValue.pm
ViewVC logotype

Diff of /perl/embperl/trunk/Embperl/Form/ControlMultValue.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

--- perl/embperl/trunk/Embperl/Form/ControlMultValue.pm	2006/04/22 13:11:04	396121
+++ perl/embperl/trunk/Embperl/Form/ControlMultValue.pm	2006/04/22 13:17:34	396122
@@ -23,6 +23,28 @@ use base 'Embperl::Form::Control' ;
 
 # ---------------------------------------------------------------------------
 #
+#   init - Init the new control
+#
+
+
+sub init
+
+    {
+    my ($self) = @_ ;
+    
+    if ($self -> {datasrc})
+        {
+        my $form = $self -> form ;
+        my $packages = $form -> get_datasrc_packages ;
+        my $self -> {datasrcobj} = $form -> new_object ($packages, $self -> {datasrc}, $self) ;
+        }
+        
+    return $self ;
+    }
+    
+
+# ---------------------------------------------------------------------------
+#
 #   get_values - returns the values and options
 #
 
@@ -31,6 +53,7 @@ sub get_values
     {
     my ($self) = @_ ;
 
+    return $self -> {datasrcobj} -> get_values if ($self -> {datasrcobj}) ;
     return ($self -> {values}, $self -> {options}) ;
     }
 
@@ -65,5 +88,64 @@ sub get_active_id
     }
 
 
-  1 ;
-  
\ No newline at end of file
+1 ;
+
+__END__
+
+=pod
+
+=head1 NAME
+
+Embperl::Form::ControlMultValue - Base class for controls inside
+an Embperl Form which have multiple values to select from, like
+a select box or radio buttons.
+
+
+=head1 SYNOPSIS
+
+Do not use directly, instead derive a class
+
+=head1 DESCRIPTION
+
+This class is not used directly, it is used as a base class for
+all controls which have multiple values to select from inside
+an Embperl Form. It provides a set of methods
+that could be overwritten to customize the behaviour of your controls.
+
+=head1 METHODS
+
+=head2 get_values
+
+returns the values and options
+
+=head2 get_active_id
+
+get the id of the value which is currently active
+
+=head1 PARAMETERS
+
+=head3 values
+
+Arrayref with the values to select from. This is what gets
+submited back to the server.
+
+=head3 options
+
+Arrayref with the options to select from. This is what the user sees.
+
+=head3 datasrc
+
+Name of an class which provides the values for the
+values and options parameters. Either a full package name or
+a name, in which case all packages which are returned
+by Embperl::Form::get_datasrc_packages are searched.
+
+=head1 AUTHOR
+
+G. Richter (richter@dev.ecos.de)
+
+=head1 SEE ALSO
+
+perl(1), Embperl, Embperl::Form, Embperl::From::Control, Embperl::Form::DataSource
+
+    
\ No newline at end of file

 

infrastructure at apache.org
ViewVC Help
Powered by ViewVC 1.1.26