[jifty-devel] Appending to nested regions
Jesse Vincent
jesse at bestpractical.com
Mon Nov 19 08:27:21 EST 2007
Todd Chapman wrote:
> Hello all,
>
> I have 2 regions. The first has a form and appends to the second when
> the form is submitted. This worked fine until both regions were
> embedded in another region when I started using TabView. Now the form
> region can't find it's sibling.
>
> Here is the form region:
>
> template useradd => sub {
> h3 {_("Add peeps:")}
> form {
> render_action( new_action( moniker => 'add_user', class => 'AddSanta'));
> form_submit( label => 'Add', onclick => { submit =>
> 'add_user', region => 'users', append => '/user' } );
> }
> };
>
>
> Do I need to switch from the region argument to using element argument
> and rely on CSS selection? What's the best way to do this? Thank!
I believe the problem is that you're using explicit region names, rather
than qualified region names. Code that, I think, does what you want:
Jifty->web->form->submit(
label => _('Create'),
onlick => [
{ submit => {
action => $create,
arguments => {
owner_id =>
Jifty->web->current_user->user_object->email,
accepted => 1,
}
}
},
{ refresh_self => 1,
arguments =>
{ deadline => $deadline, project => $project }
},
{ element =>
Jifty->web->current_region->parent->get_element(
'div.list'),
append => $self->fragment_for('view'),
args => {
object_type => $object_type,
id => { result_of => $create, name => 'id' },
},
},
]
);
>
> -Todd
> _______________________________________________
> jifty-devel mailing list
> jifty-devel at lists.jifty.org
> http://lists.jifty.org/cgi-bin/mailman/listinfo/jifty-devel
>
More information about the jifty-devel
mailing list