comparison Lib/IMPL/Web/TT/Form.pm @ 145:bd10093bb122

Minor changes
author wizard
date Wed, 21 Jul 2010 06:27:12 +0400
parents b56ebc31bf18
children e6447ad85cb4
comparison
equal deleted inserted replaced
144:b56ebc31bf18 145:bd10093bb122
74 nodeValue => $node && $node->nodeValue, # small hack set a non dom class property through 74 nodeValue => $node && $node->nodeValue, # small hack set a non dom class property through
75 queryParameter => $queryParameter 75 queryParameter => $queryParameter
76 }; 76 };
77 } 77 }
78 78
79 sub makeContent {
80 my ($this,$mappings) = @_;
81
82 my $formSchema = $this->schema->selectSingleNode(sub { $_->nodeName eq 'ComplexNode' and $_->name eq $this->base } )
83 or die new Exception("Cant find a schema element for the specified form", $this->base);
84
85 my $doc = $this->document;
86 foreach my $itemSchema ( $formSchema->content->childNodes ) {
87 my $itemName = $itemSchema->name;
88 if (my $controlClass = $mappings->{$itemName} ) {
89 my $contorl = $doc->CreateControl($itemName,$controlClass,$this->makeControlArgs($itemName));
90 $this->appendChild($contorl);
91 }
92 }
93 return;
94 }
95
79 sub formErrors { 96 sub formErrors {
80 my ($this) = @_; 97 my ($this) = @_;
81 98
82 if (my $node = $this->data ) { 99 if (my $node = $this->data ) {
83 return [ 100 return [