cvs commit: p5ee/App-Widget/lib/App/Widget Select.pm

[email protected] (Stephen Adkins)
Newsgroups perl.cvs.p5ee
Message-ID <[email protected]>
cvsuser     05/10/20 13:34:24

  Modified:    App-Widget/lib/App/Widget Select.pm
  Log:
  support EACH value
  
  Revision  Changes    Path
  1.4       +14 -6     p5ee/App-Widget/lib/App/Widget/Select.pm
  
  Index: Select.pm
  ===================================================================
  RCS file: /cvs/public/p5ee/App-Widget/lib/App/Widget/Select.pm,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Select.pm	10 Nov 2004 15:45:09 -0000	1.3
  +++ Select.pm	20 Oct 2005 20:34:24 -0000	1.4
  @@ -47,10 +47,18 @@
   ######################################################################
   
   # uncomment this when I need to do more than just call SUPER::_init()
  -#sub _init {
  -#   my $self = shift;
  -#   $self->SUPER::_init(@_);
  -#}
  +sub _init {
  +    my $self = shift;
  +    my $context = $self->{context};
  +    my $name = $self->{name};
  +    my $value = $context->so_get($name);
  +    if ($value eq "EACH") {
  +        my ($values, $labels) = $self->values_labels();
  +        $value = join(",", @$values);
  +        $context->so_set($name, undef, $value);
  +    }
  +    $self->SUPER::_init(@_);
  +}
   
   ######################################################################
   # METHODS
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.