[Catalyst] Re: Reaction Widgets questions

Matt S Trout dbix-class at trout.me.uk
Wed Jan 17 10:36:22 GMT 2007

On 16 Jan 2007, at 17:07, Jonas Alves wrote:
> As for a controller that limits visible attributes, are you wanting
> to do this for the listview or globally?
> Imagine that i have 2 forms for the same table. One with all the  
> fields and another with just some of them. What came to me was  
> define another schema class to the same table but just with some of  
> the attributes defined. But that doesn't seem the best aproach...  
> But creating new action classes that just differ in the attributtes  
> defined doesn't seem a better way. Maybe if I could pass the fields  
> to the class when I push it to the viewport. Something like:

Assuming the action can be committed without the additional fields,  
just subclass the Action class and override parameter_attributes to  
only return the attributes you want visible, then pass a copy of that  
action to the ViewPort instead.

It's not perfect, but it works pretty well for me so far so I'm  
punting on a better solution until we've got a better idea what we  
need out of it.

Matt S Trout, Technical Director, Shadowcat Systems Ltd.
Offering custom development, consultancy and support contracts for  
DBIx::Class and BAST. Contact mst (at) shadowcatsystems.co.uk for  
+ Help us build a better perl ORM: http://dbix- 
class.shadowcatsystems.co.uk/ +

More information about the Catalyst mailing list