开发者

Tapestry 4 - omitting component render

开发者 https://www.devze.com 2022-12-16 17:00 出处:网络
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 Set

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开发者_JS百科 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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消