X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Felements%2Fselect-table.html;h=c0dde74147eb1df67743b574f610326942c73c52;hb=aed8ec35ccb9cdeb7ea0cb6ff2946f9d83d582f6;hp=4d8d9a98886d5c6d0da72865f38c61e485589bca;hpb=d6be23266fb627a4e7831055bf55ae675dbad4e9;p=freeside.git diff --git a/httemplate/elements/select-table.html b/httemplate/elements/select-table.html index 4d8d9a988..c0dde7414 100644 --- a/httemplate/elements/select-table.html +++ b/httemplate/elements/select-table.html @@ -29,8 +29,12 @@ Example: #or 'records' => \@records, #instead of search params + #instead of the primary key... only for special cases + 'value_col' => 'columnname', + #basic params controlling the resulting %} @@ -110,7 +124,7 @@ Example: my( %opt ) = @_; -warn "elements/select-table.html: \n". Dumper(%opt) +warn "elements/select-table.html: \n". Dumper(\%opt) if exists $opt{debug} && $opt{debug}; $opt{'extra_option_attributes'} ||= []; @@ -127,7 +141,7 @@ if ( $opt{'onchange'} ) { my $dbdef_table = dbdef->table($opt{'table'}) or die "can't find dbdef for ". $opt{'table'}. " table\n"; -my $key = $dbdef_table->primary_key; #? $opt{'primary_key'} || +my $key = $opt{'value_col'} || $dbdef_table->primary_key; my $name_col = $opt{'name_col'}; @@ -180,6 +194,7 @@ if ( ref( $value ) eq 'ARRAY' ) { $value = { map { $_ => 1 } @$value }; } -my @pre_options = $opt{pre_options} ? @{ $opt{pre_options} } : (); +my @pre_options = $opt{pre_options} ? @{ $opt{pre_options} } : (); +my @post_options = $opt{post_options} ? @{ $opt{post_options} } : ();