Mike Minicki
Mike Minicki

Reputation: 8466

Tapestry 4 - omitting component render

I have a component in Tapestry 4 that should render only when user has privileges to use it's attached business code. In Tapestry 5 I would probably use rendering phases and would return false on SetupRender in order to skip rendering of this component:

http://tapestry.apache.org/tapestry5/guide/rendering.html

But how would I go about doing it in Tapestry 4? I could probably override renderComponent( IMarkupWriter writer, IRequestCycle cycle ) and suppress a call to super when one doesn't have rights to use this functionality. But this seems kind of hackish.

Is there a Tapestry 4 way to do that?

Thanks.

Upvotes: 2

Views: 282

Answers (1)

Martin
Martin

Reputation: 38309

I don't think there's anything like T5's rendering phases in T4, but you could wrap the component in an If component where you evaluate privileges.

Upvotes: 1

Related Questions