[Seaside] Using one component to render multiple views?
rickf at ca-flower.com
Fri Aug 11 00:31:42 UTC 2006
Boris Popov wrote:
> You could also have your components rendering slightly different for users
> with varying privileges,
> self user isAdmin
> ifTrue: [html input value: username; callback: [:v | username := v]]
> ifFalse: [html text: username].
Yup.. I've got logic in for that sort of thing now -- which works rather
well -- currently I use it mostly for which hyperlinks to display in the
top link-bar -- admin users get a different set than average-joe users do.
> But I'd say different views often warrant components of their own. Depending
> on your composition, you could also insert admin-type child component into
> your standard views.
I think in my case, many of my views (for lack of a better term) are not
going to be very complex and will consist mostly of forms+validation and
writing to my Glorp tables. I was just trying to reduce the amount of
classes I've got if there wasn't a need to split out functionality. Thanks!
More information about the Seaside