diff Lib/IMPL/Web/TT/Form.pm @ 127:0dce0470a3d8

In the IMPL::Web::ControllerUnit added the ability to notify a form about a wrong data from a transaction added a relativeUrl function for a usage from a templates IMPL::Web::TT::Form now fully functional
author wizard
date Fri, 11 Jun 2010 20:21:07 +0400
parents c8dfbbdd8005
children c5bc900eefd3
line wrap: on
line diff
--- a/Lib/IMPL/Web/TT/Form.pm	Fri Jun 11 04:29:51 2010 +0400
+++ b/Lib/IMPL/Web/TT/Form.pm	Fri Jun 11 20:21:07 2010 +0400
@@ -44,6 +44,9 @@
 	) foreach @path;
 	
 	my $schema = $navi->Current;
+	my $sourceSchema = $navi->SourceSchemaNode;
+	my $queryParameter = join '/', @path;
+	shift @path;
 	my $node = $this->data->selectSingleNode(@path);
 	
 	my @errors;
@@ -54,17 +57,18 @@
 	
 	return {
 		schema => $schema,
-		sourceSchema => $navi->SourceSchemaNode,
+		sourceSchema => $sourceSchema,
 		errors => \@errors,
 		data => $node,
-		formParameter => join '/', @path
+		nodeValue => $node && $node->nodeValue, # small hack set a non dom class property through
+		queryParameter => $queryParameter
 	};
 }
 
 sub formErrors {
 	my ($this) = @_;
 	
-	if (my $node = $this->data->selectSingleNode($this->base) ) {
+	if (my $node = $this->data ) {
 		return [
 			grep {
 				( $_->Node || $_->Parent) == $node