[html-formfu] More complex DBIC/FormFu interaction
Nigel Metheringham
nigel.metheringham at dev.intechnology.co.uk
Wed Sep 1 11:51:34 GMT 2010
Just to follow up to my own message...
I won't rehash the problem, but I will present the solution in case
anyone else is trying something similar...
The YAML form config should be changed to
elements:
- type: Checkboxgroup
name: bookings
model_config:
label_column: text_info
resultset: Booking
attributes:
order_by: start
prefetch: booking_type
condition_from_stash:
event: event_id
and then the following code should be added before the
# check and process form
section of the code:-
# stash event restriction for use within form
$form->stash->{event_id} = $event->id;
$form->process;
The additional process step is needed (otherwise the value is taken
from when the previous process was run within the
Catalyst::Controller::HTML::FormFu superclass.
Carl: this isn't documented, but there are tests - thankfully which
makes it much easier to work out whats happening. I'll see if I can
come up with a doc patch for it.
Nigel.
--
[ Nigel Metheringham Nigel.Metheringham at InTechnology.com ]
[ - Comments in this message are my own and not ITO opinion/policy - ]
More information about the HTML-FormFu
mailing list