Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: ModPerl: Embperl-cvs

svn commit: r1222070 - in /perl/embperl/trunk/Embperl/Form: Control/grid.pm ControlMultValue.pm

 

 

ModPerl embperl-cvs RSS feed   Index | Next | Previous | View Threaded


richter at apache

Dec 21, 2011, 10:52 PM

Post #1 of 1 (257 views)
Permalink
svn commit: r1222070 - in /perl/embperl/trunk/Embperl/Form: Control/grid.pm ControlMultValue.pm

Author: richter
Date: Thu Dec 22 06:52:55 2011
New Revision: 1222070

URL: http://svn.apache.org/viewvc?rev=1222070&view=rev
Log:
Hash support for grid control

Modified:
perl/embperl/trunk/Embperl/Form/Control/grid.pm
perl/embperl/trunk/Embperl/Form/ControlMultValue.pm

Modified: perl/embperl/trunk/Embperl/Form/Control/grid.pm
URL: http://svn.apache.org/viewvc/perl/embperl/trunk/Embperl/Form/Control/grid.pm?rev=1222070&r1=1222069&r2=1222070&view=diff
==============================================================================
--- perl/embperl/trunk/Embperl/Form/Control/grid.pm (original)
+++ perl/embperl/trunk/Embperl/Form/Control/grid.pm Thu Dec 22 06:52:55 2011
@@ -81,7 +81,10 @@ sub init_data
my $fdat = $req -> {docdata} || \%fdat ;
my $ldap = $req->{ldap};
my $name = $self->{name} ;
- my @entries = ref $fdat->{$name} eq 'ARRAY'?@{$fdat->{$name}}:split("\t",$fdat->{$name});
+ my $rowno = 1 ;
+ my @entries = ref $fdat->{$name} eq 'ARRAY'?@{$fdat->{$name}}:
+ ref $fdat->{$name} eq 'HASH' ?map { [$rowno++, $_ => $fdat->{$name}{$_}] } keys %{$fdat->{$name}}:
+ split("\t",$fdat->{$name});
my $fields = $self -> {fields} ;
my $line2 = $self -> {line2} ;
my $order = $self -> {order} ;

Modified: perl/embperl/trunk/Embperl/Form/ControlMultValue.pm
URL: http://svn.apache.org/viewvc/perl/embperl/trunk/Embperl/Form/ControlMultValue.pm?rev=1222070&r1=1222069&r2=1222070&view=diff
==============================================================================
--- perl/embperl/trunk/Embperl/Form/ControlMultValue.pm (original)
+++ perl/embperl/trunk/Embperl/Form/ControlMultValue.pm Thu Dec 22 06:52:55 2011
@@ -203,13 +203,13 @@ sub get_option_from_value
}

if ($self->{datasrc})
- {
+ {
my $option = $self -> {datasrcobj} -> get_option_from_value ($value, $req, $self) ;

return $option if (defined ($option)) ;
}
else
- {
+ {
my $i = 0 ;
foreach (@{$self -> {values}})
{
@@ -219,7 +219,7 @@ sub get_option_from_value
}
$i++ ;
}
- }
+ }

my $addbottom = $self -> {addbottom} ;
if ($addbottom)
@@ -280,6 +280,7 @@ sub show_control_readonly

my $value = $self -> get_value ($req) ;
my $option = $self -> get_option_from_value ($value, $req) ;
+
$self -> SUPER::show_control_readonly ($req, $option) ;
}




---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-cvs-unsubscribe [at] perl
For additional commands, e-mail: embperl-cvs-help [at] perl

ModPerl embperl-cvs RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.