Author: spadkins
Date: Tue Apr 11 10:47:00 2006
New Revision: 5896
Modified:
p5ee/trunk/App-Widget-JSApp/lib/App/Widget/JSApp.pm
p5ee/trunk/App-Widget-JSApp/lib/App/Widget/JSApp/TabbedAppFrame.pm
p5ee/trunk/App-Widget/lib/App/Widget.pm
Log:
add support for onLoad handling
Modified: p5ee/trunk/App-Widget-JSApp/lib/App/Widget/JSApp.pm
==============================================================================
--- p5ee/trunk/App-Widget-JSApp/lib/App/Widget/JSApp.pm (original)
+++ p5ee/trunk/App-Widget-JSApp/lib/App/Widget/JSApp.pm Tue Apr 11 10:47:00 2006
@@ -23,6 +23,16 @@
=cut
+# NOTE: This might not get called by App::Widget::JSApp::TabbedAppFrame because
+# it does multiple inheritance.
+sub _init {
+ &App::sub_entry if ($App::trace);
+ my ($self) = @_;
+ $self->{onload_handler} = "context.onLoad();" if
(!$self->{onload_handler});
+ $self->SUPER::_init();
+ &App::sub_exit() if ($App::trace);
+}
+
sub html {
&App::sub_entry if ($App::trace);
my $self = shift;
@@ -42,6 +52,7 @@
}
my $value = $context->so_get($name);
$value = "" if (!defined $value);
+ $value = join(",",@$value) if (ref($value) eq "ARRAY");
push(@attrib, "default", $value);
my $js_conf = "";
if ($#attrib > -1) {
@@ -59,6 +70,7 @@
$so_name = $attribs->{$attrib};
$so_name = $attrib if (!$so_name || $so_name eq "1");
$value = $context->so_get($so_name);
+ $value = join(",",@$value) if (ref($value) eq "ARRAY");
$js_conf .= ",\n \"$attrib\" : \"" .
$self->escape_double_quoted_value($value) . "\"";
}
}
@@ -139,6 +151,7 @@
$response->include("javascript", $js_conf);
$response->include("javascript", $js);
}
+ $self->{onload_handler} = "context.onLoad();" if
(!$self->{onload_handler});
&App::sub_exit() if ($App::trace);
}
Modified: p5ee/trunk/App-Widget-JSApp/lib/App/Widget/JSApp/TabbedAppFrame.pm
==============================================================================
--- p5ee/trunk/App-Widget-JSApp/lib/App/Widget/JSApp/TabbedAppFrame.pm
(original)
+++ p5ee/trunk/App-Widget-JSApp/lib/App/Widget/JSApp/TabbedAppFrame.pm Tue Apr
11 10:47:00 2006
@@ -61,9 +61,11 @@
######################################################################
sub _init {
+ &App::sub_entry if ($App::trace);
my $self = shift;
$self->SUPER::_init(@_);
$self->init_jsapp();
+ &App::sub_exit() if ($App::trace);
}
1;
Modified: p5ee/trunk/App-Widget/lib/App/Widget.pm
==============================================================================
--- p5ee/trunk/App-Widget/lib/App/Widget.pm (original)
+++ p5ee/trunk/App-Widget/lib/App/Widget.pm Tue Apr 11 10:47:00 2006
@@ -172,6 +172,7 @@
}
}
}
+ $bodyoptions .= " onLoad=\"$self->{onload_handler}\"" if
($self->{onload_handler});
my $context = $self->{context};
my $options = $context->{options};