[jifty-devel] canonicalize / defer

Edward Funnekotter efunneko at gmail.com
Tue Jun 10 11:35:32 EDT 2008


I am sure there are cleaner ways to do this, but one that has worked
for me was to use the 'onchange' attribute within the form field of
the first select box to cause a region refresh that includes the
second select box, containing the filtered results.

Here is an excerpt of my template that does this.  It is not exactly
the same as what you want, but it should show the concept:

--- snip ---

%# Add the resource type select
% my $rtSelect = Jifty->web->new_action(class => 'ResourceTypeSelect',
moniker => 'select_rt');
<% $rtSelect->form_field('select_item',
      onchange => {submit => $rtSelect,
          args => { show_fields => 1,
                  }
} )%>

% if ($show_fields && ($rtSelect->argument_value('select_item') ne
"--Select--")) {
  --- do stuff differently here if an item has been selected.
}
--- snip ---


On Tue, Jun 10, 2008 at 5:36 AM, Felix Abraham <abraham at schaffhausen.de> wrote:
> Hi,
>
> I am trying to build a form with two select boxes. The second one
> should only show values depending on the value selected in the first
> one. I tried to use ajax canonicalize with the first select and defer
> with the second, but that didn't work out. What would be a sensible
> approach for this?
>
> Thanks for your help,
>
> Felix
>
> _______________________________________________
> 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