107
|
1 package IMPL::Web::TT::Collection;
|
|
2 use strict;
|
|
3
|
166
|
4 use parent qw(IMPL::DOM::Node);
|
107
|
5
|
|
6 __PACKAGE__->PassThroughArgs;
|
|
7
|
|
8 our $AUTOLOAD;
|
|
9 sub AUTOLOAD {
|
194
|
10 my $this = shift;
|
|
11 my ($method) = ($AUTOLOAD =~ /(\w+)$/);
|
|
12
|
|
13 return if $method eq 'DESTROY';
|
|
14
|
|
15 if ( @_ >= 1 ) {
|
|
16 # set
|
|
17
|
|
18 if ($method =~ /^add(\w+)/) {
|
|
19 my ($name,$args) = @_;
|
|
20 return $this->appendChild($this->document->CreateControl($name,$1,$args));
|
|
21 }
|
|
22
|
|
23 # we can't assing a node, so this is a dynamic property
|
|
24 return $this->nodeProperty($method,@_);
|
|
25 } else {
|
|
26 # get
|
|
27 # try a dynamic property first
|
|
28 if ( my $val = $this->nodeProperty($method) ) {
|
|
29 return $val;
|
|
30 } else {
|
|
31 # and return a first child node as last opportunity
|
|
32 my @result = $this->selectNodes($method);
|
|
33
|
|
34 return $result[0] if @result;
|
|
35 }
|
|
36 }
|
|
37
|
|
38 return;
|
107
|
39 }
|
|
40
|
180
|
41 1;
|