[html-formfu] model_stash + model_config with ComboBox element

Ascii King tech at swattermatter.com
Thu Mar 5 16:58:54 GMT 2009


Is there some reason this will not work within a repeatable group? I 
have this set up and it runs fine unless I move it inside a repeatable 
block and then it will not populate.

>> BTW, you could get rid of all that code to populate $select->options()
>> by making sure the appropriate Model is in your form stash, by setting
>> this in your cat application config:
>>
>>     'Controller::HTML::FormFu':
>>       model_stash:
>>         schema: My
>>
>> Then modifying the Select field in your form config:
>>
>>     type: Select
>>     name: genres
>>     model_config:
>>         resultset: Genres
>>
>> That will also have the benefit of populating the Select menu every
>> time the form's built - so if you add an AutoSet constraint to the
>> field, it'll check whether the user-submitted value was a valid
>> option, when you call $form->submitted_and_valid().
>>
>> Carl
>>     



More information about the HTML-FormFu mailing list