Convert Text, Url, JsonTable and AssetReportQuery to use headTags.

This commit is contained in:
Colin Kuskie 2010-09-14 11:33:23 -07:00
parent d2623c2159
commit adb279771b
4 changed files with 58 additions and 12 deletions

View file

@ -168,6 +168,20 @@ sub getValue {
#-------------------------------------------------------------------
=head2 headTags
Sets the JS for this form plugin
=cut
sub headTags {
my $self = shift;
my $session = $self->session;
$session->style->setScript($session->url->extras("yui-webgui/build/form/assetReportQuery.js"),{ type=>"text/javascript" });
}
#-------------------------------------------------------------------
=head2 i18n
Returns the i18n object for the form
@ -185,6 +199,7 @@ sub i18n {
return $self->{_i18n};
}
#----------------------------------------------------------------------------
=head2 toHtml
@ -250,7 +265,6 @@ sub toHtml {
$style->setRawHeadTags(qq|<script type="text/javascript">var classValues = $jsonStr; </script>|);
my $jsonData = $self->get("value") || q|{ "isNew" : "true" }|;
$style->setRawHeadTags(qq|<script type="text/javascript">var dataValues = $jsonData; var first_row_error_msg = '$first_row_error_msg';</script>|);
$session->style->setScript($session->url->extras("yui-webgui/build/form/assetReportQuery.js"),{ type=>"text/javascript" });
#Decode JSON data for filling in some of the fields
my $jsonDataHash = JSON->new->decode($jsonData);