开发者

add the code for a widget (widget.xhtml) once but use it twice in same webpage, possible ? How?

I have a widget in my application that I need to display at two places(once in main p开发者_如何学编程age body and once through dialog box). Currently its code has been added twice in the page. Now I was thinking, If there was a way I could just include it only once and show the same instance in the dialog box, as in the main page body.

Can you suggest a way for this?


I'm Using:-

JSF 2.0 with Facelets

Primefaces 3.0 M3 Snapshot


JSF 2 has exactly the feature you want: it's called composite components. I bascially allows you to write a bunch of Facelet code into a file and use it just like any other JSF component, pass parameters to it, etc.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜