Mercurial > pub > Impl
diff 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 |
line wrap: on
line diff
--- a/Lib/IMPL/Web/TT/Form.pm Tue Jul 13 02:05:38 2010 +0400 +++ b/Lib/IMPL/Web/TT/Form.pm Wed Jul 21 06:27:12 2010 +0400 @@ -76,6 +76,23 @@ }; } +sub makeContent { + my ($this,$mappings) = @_; + + my $formSchema = $this->schema->selectSingleNode(sub { $_->nodeName eq 'ComplexNode' and $_->name eq $this->base } ) + or die new Exception("Cant find a schema element for the specified form", $this->base); + + my $doc = $this->document; + foreach my $itemSchema ( $formSchema->content->childNodes ) { + my $itemName = $itemSchema->name; + if (my $controlClass = $mappings->{$itemName} ) { + my $contorl = $doc->CreateControl($itemName,$controlClass,$this->makeControlArgs($itemName)); + $this->appendChild($contorl); + } + } + return; +} + sub formErrors { my ($this) = @_;