s2cuts has asked for the wisdom of the Perl Monks concerning the following question:
I'm needing to conditionally remove or disable a FormFu element (Radiogroup) from within a Catalyst action/method. My first inclination was to simply make it readonly or hidden, but I soon discovered that adding those attributes via the 'add_attributes' method would only apply the attribute to some outer span and have no effect on the radio buttons themselves.
I'm now willing to accept just simply removing the element (Radiogroup) altogether. My strategy was to use one of the 'get_*' methods to retrieve the element, then use the 'remove_element' method to remove it. However, remove_element seems to be complaining that "element not found..." in which ever way I call the method. Of course, I've confirmed that the element is indeed being found by the 'get_*' method.
Here's a little code snippet of what I've got in my action:
if ($row_object->row_attribute) { my $foo_element = $form->get_field(type => 'Radiogroup', name => 'foo_element'); $form->remove_element($foo_element); }
Maybe someone can see what I'm doing wrong, or they can suggest an alternate strategy.
Thanks all
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: HTML::FormFu element removal...
by fireartist (Chaplain) on Jun 01, 2011 at 12:45 UTC | |
by s2cuts (Acolyte) on Jun 01, 2011 at 16:35 UTC | |
|
Re: HTML::FormFu element removal...
by Anonymous Monk on May 31, 2011 at 23:08 UTC | |
by s2cuts (Acolyte) on Jun 01, 2011 at 06:46 UTC | |
by Anonymous Monk on Jun 01, 2011 at 08:36 UTC |