--- trunk/lib/Frey/ObjectBrowser.pm 2008/07/11 09:25:02 93
+++ trunk/lib/Frey/ObjectBrowser.pm 2008/07/11 10:29:31 95
@@ -64,8 +64,8 @@
warn "# new layout = $layout\n";
}
- my $rows_delimiter = '
';
- $rows_delimiter = '' if $layout eq 'table';
+ my $rows_delimiter = '';
+ $rows_delimiter = '
' if $layout eq 'div';
my $form = join($rows_delimiter, map {
$_->_layout( $layout );
@@ -82,6 +82,27 @@
$form = qq|| if $layout eq 'table';
+ if ( $layout eq 'columns' ) {
+ # add header to table
+ my $header = $w[0]->render_iterator( sub {
+ my ( $name, $field_name, $label, $val ) = @_;
+ return if $name =~ /^_/;
+ return qq|$label | |;
+ });
+ $form = qq||;
+ }
+
+ my $layout_picker = join(' ',
+ qq|layout:|,
+ map {
+ if ( $layout eq $_ ) {
+ qq|
$_|;
+ } else {
+ qq|
$_|;
+ }
+ } ( 'div', 'table', 'columns' ),
+ qq|
|,
+ );
my $doc = Continuity::Widget::DomNode->create(
html => [
@@ -90,12 +111,7 @@
],
body => [
h1 => [ 'Strix::User' ],
- $layout eq 'table' ?
- # gen_link doesn't work since Widngets have it's own scope of layout
-# gen_link( 'div layout', sub { $layout = 'div' } ) :
-# gen_link( 'table layout', sub { $layout = 'table' } ),
- qq|div layout| :
- qq|table layout|,
+ $layout_picker,
form => { method=>'post' } => [
$form,
],