--- lib/A3C/View/Strix.pm 2008/06/17 23:04:29 199 +++ lib/A3C/View/Strix.pm 2008/06/17 23:06:31 200 @@ -137,6 +137,11 @@ title is _('Site navigation'); render_region( + name => 'selected-instances', + path => '/strix/selected-instances' + ); + + render_region( name => 'select-strix-site', path => '/strix/select-site' ); @@ -308,6 +313,7 @@ if ( $selected->count > 0 ) { my $instance = get('instance'); + warn "# selected-instances -- selected: $instance\n"; div { _('%1 instances selected', $selected->count ) }; table { @@ -375,11 +381,28 @@ moniker => 'strix-select-site', ); - #warn "action = ", dump( $action ); + warn "# action = ", dump( $action ); + + warn "# argument_values = ", dump( $action->argument_values ); + + if ( ! $action->argument_value('instance') ) { + $action->argument_value( 'instance', get('instance') ); + warn "# run action with instance\n"; + $action->run; + } + + my $magic = [ + { submit => $action, refresh_self => 1 }, + # this is basically a closure + { refresh => 'selected-instances', path => '/strix/selected-instances', args => { + instance => { result_of => $action, name => 'instance' } + } } + ]; form { - render_param( $action, 'instance', onchange => { submit => $action, refresh_self => 1 }, default => get('instance') ); - render_param( $action, 'site_id', onchange => { submit => $action, refresh_self => 1 } ); + render_param( $action, 'instance', onchange => $magic ); + render_param( $action, 'site_id', onchange => $magic ); + form_submit( label => _('Show navigation'), onclick => $magic ); }; warn "## select-site action ",dump( $action->result );