File Coverage

blib/lib/RapidApp/Module/Combo.pm
Criterion Covered Total %
statement 17 17 100.0
branch 1 2 50.0
condition n/a
subroutine 6 6 100.0
pod 0 1 0.0
total 24 26 92.3


line stmt bran cond sub pod time code
1             package RapidApp::Module::Combo;
2              
3 5     5   2572 use strict;
  5         10  
  5         134  
4 5     5   36 use warnings;
  5         7  
  5         117  
5              
6 5     5   23 use Moose;
  5         9  
  5         25  
7             extends 'RapidApp::Module::StorCmp';
8              
9 5     5   27493 use RapidApp::Util qw(:all);
  5         13  
  5         2653  
10              
11             has 'name' => ( is => 'ro', required => 1, isa => 'Str' );
12             has 'displayField' => ( is => 'ro', required => 1, isa => 'Str' );
13             has 'valueField' => ( is => 'ro', required => 1, isa => 'Str' );
14             has 'fieldLabel' => ( is => 'ro', lazy => 1, default => sub { (shift)->name } );
15              
16             # New custom 'allowSelectNone' feature. If true '(None)' will be the first choice
17             # in the dropdown to be able to unset (null/empty) the value by selection. Specific
18             # to 'appcombo2' (see Ext.ux.RapidApp.AppCombo2)
19             has 'allowSelectNone', is => 'ro', isa => 'Bool', default => 0;
20              
21             sub BUILD {
22 6     6 0 116 my $self = shift;
23            
24 6 50       167 $self->apply_extconfig(
25             xtype => 'appcombo2',
26             typeAhead => \0,
27             mode => 'remote',
28             triggerAction => 'all',
29             selectOnFocus => \1,
30             editable => \0,
31             #allowBlank => \0,
32             width => 337,
33             name => $self->name,
34             fieldLabel => $self->fieldLabel,
35             displayField => $self->displayField,
36             valueField => $self->valueField,
37             allowSelectNone => $self->allowSelectNone ? \1 : \0
38             );
39             }
40              
41              
42              
43 5     5   35 no Moose;
  5         10  
  5         25  
44             #__PACKAGE__->meta->make_immutable;
45             1;