Thanks for the answers everyone. Using defer worked perfectly for the dynamic section set.<br><br><div><span class="gmail_quote">On 12/11/06, <b class="gmail_sendername">Nelson Elhage</b> <<a href="mailto:nelhage@bestpractical.com">
nelhage@bestpractical.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Isn't the right answer these days supposed to be Scalar::Defer?
<br><br>param group_name =><br> label is 'Group Name',<br> type is 'select',<br> valid_values are defer { get_groups(); };<br><br>I don't know if it actually works yet, although I did see some commits<br>recently that I think were trying to fix it.
<br><br>- Nelson<br><br>On Mon, Dec 11, 2006 at 10:24:49AM -0500, Jesse Vincent wrote:<br>><br>><br>><br>> On Mon, Dec 11, 2006 at 04:15:33PM +0100, Agostini yves wrote:<br>> > Le lundi 11 d??cembre 2006 ?? 09:41 -0500, Edward Funnekotter a ??crit :
<br>> > > Hi,<br>> > ><br>> > > I haven't found any documentation to answer these yet (forgive me if I<br>> > > missed them):<br>> > ><br>> > > 1. Is it possible to populate an Action's selection field at runtime?
<br>> > > What I am trying to do is have a selection box in a form that has a<br>> > > subset of a list of items that is dependent on the user. I tried the<br>> > > following:<br>> > >
<br>> > > param group_name =><br>> > > label is 'Group Name',<br>> > > type is 'select',<br>> > > valid_values are sub { get_groups(); };<br>> > ><br>> > > But it seems that giving a code ref to the valid values is not
<br>> > > acceptable.<br>> ><br>> > I don't think it's possible in action<br>> > I make this yesterday by making my own html form<br>><br>> What we've done in the past is to do this in the arguments sub. (Which,
<br>> yes, is deprecated, but I haven't yet spent enough time with the param<br>> syntax to know the answer with it off the top of my head)<br>><br>> sub arguments {<br>> my $self = shift;<br>> return $self->{__cached_arguments} if (exists $self->{__cached_arguments});
<br>><br>> my $args = $self->__get_cache->{$self->__cache_key($self->record)} ||=<br>> $self->SUPER::arguments();<br>><br>> if (my $owner_id = $record->owner->id) {<br>> $args->{'owner_id'}{'default_value'} = $record->owner->email;
<br>><br>> if ( $owner_id == BTDT::CurrentUser->nobody->id<br>> or $owner_id == $self->current_user->id )<br>> {<br>> $args->{'group_id'}{'valid_values'} = [
<br>> { display => (($record->group_id ? $record->group->name : "Personal" ) . " (Unchanged)"),<br>> value => $record->group_id,<br>> },
<br>> { display => 'Personal',<br>> value => 0,<br>> },<br>> { display_from => 'name',<br>> value_from => 'id',
<br>> collection => Jifty->web->current_user->user_object->groups,<br>> },<br>> ];<br>> }<br>> }<br>><br>> ...<br>> return $args;
<br>> }<br>><br>><br>> --<br>> _______________________________________________<br>> jifty-devel mailing list<br>> <a href="mailto:jifty-devel@lists.jifty.org">jifty-devel@lists.jifty.org</a><br>> <a href="http://lists.jifty.org/cgi-bin/mailman/listinfo/jifty-devel">
http://lists.jifty.org/cgi-bin/mailman/listinfo/jifty-devel</a><br>_______________________________________________<br>jifty-devel mailing list<br><a href="mailto:jifty-devel@lists.jifty.org">jifty-devel@lists.jifty.org</a>
<br><a href="http://lists.jifty.org/cgi-bin/mailman/listinfo/jifty-devel">http://lists.jifty.org/cgi-bin/mailman/listinfo/jifty-devel</a><br></blockquote></div><br>