简体   繁体   English

带有 JSF 项目的组件库

[英]Component library with JSF project

I am looking forward to using a component library(perhaps richfaces or primefaces) with JSF for developing the frontend of a social application.我期待使用带有 JSF 的组件库(可能是richfaces 或 primefaces)来开发社交应用程序的前端。

I need to know:我需要知道:

1.) how far is it possible to customize the look of each individual component independently besides choosing a single theme for all components. 1.) 除了为所有组件选择一个主题之外,独立自定义每个组件的外观的可能性有多大。 Is it possible to use CSS with these components.是否可以将 CSS 与这些组件一起使用。

2.) Can I use multiple component libraries (depending on what components I need) in a single project? 2.) 我可以在一个项目中使用多个组件库(取决于我需要什么组件)吗?

3.) Any suggestions on choosing a component library also welcomed! 3.) 任何关于选择组件库的建议也欢迎!

EDIT编辑

4.) Are there any visual editors for developing UI with these libraries? 4.) 是否有用于使用这些库开发 UI 的可视化编辑器? I currently use netbeans 6.9 IDE.我目前使用 netbeans 6.9 IDE。

  1. I know it's possible with RichFaces我知道 RichFaces 可以做到
  2. Yes, it's possible.是的,这是可能的。 Most probably you have to customize at least one of them to get a consistent layout.很可能您必须至少自定义其中一个以获得一致的布局。 For some libraries there exist already such themes, eg you find some themes for Primefaces with Richfaces look and feel.对于某些库,已经存在这样的主题,例如,您可以找到一些具有 Richfaces 外观的 Primefaces 主题。
  3. We decided to use RichFaces which provides various well documented components.我们决定使用 RichFaces,它提供了各种有据可查的组件。 Look at the examples of your library candidates and decide if they might fit your needs.查看您的图书馆候选人的示例,并确定它们是否符合您的需求。

I use primefaces, and customizing each component is pretty easy and fun.我使用 primefaces,自定义每个组件非常简单有趣。 They have samples in their user-guide on how to customize each component (css).他们的用户指南中有关于如何自定义每个组件(css)的示例。 Primefaces relies heavily on jQuery(I noticed by looking at the source generated), but also uses other javascript libraries like YUI. Primefaces 严重依赖 jQuery(我通过查看生成的源代码注意到),但也使用其他 javascript 库,如 YUI。 Sometimes it could be very Javascript intensive on the client, but so far, it does what is says it do very well.有时它在客户端上可能非常密集,但到目前为止,它做得很好。

I am not sure about the multiple components, never tried it, and per my own recommendations, I think primefaces rocks.我不确定多个组件,从未尝试过,并且根据我自己的建议,我认为 primefaces 摇滚。

AS from netbeans 7.0, primefaces is included in Netbeans, so you don't have to worry about configurations anymore.从 netbeans 7.0 开始,primefaces 包含在 Netbeans 中,因此您不必再担心配置了。

I love Primefaces as they have a probably the largest and some of the most feature rich components available.我喜欢 Primefaces,因为它们可能拥有最大和一些功能最丰富的组件。 It takes a litle tweaking but you could use other component libraries with Primefaces as well.它需要一点点调整,但您也可以将其他组件库与 Primefaces 一起使用。

Be prepared though for a lot of issues.为很多问题做好准备。 There are a lot of bugs however if you are decently good with javascript and CSS and have above a beginners level understanding of JSF then you should have no problems working around them.有很多错误,但是如果你对 javascript 和 CSS 有很好的理解,并且对 JSF 有高于初学者的理解,那么你应该没有问题解决它们。 Just be prepared to implement a couple of smelly hacks to meet some requirements.只需准备好实施几个臭名昭著的黑客攻击来满足一些要求。

Despite these problems I notice it becoming more and more stable with every release so it will only get better from here.尽管存在这些问题,但我注意到它在每个版本中都变得越来越稳定,因此它只会从这里变得更好。

See that you got some answer already.看到你已经得到了一些答案。 I had more or less the same questions as you have.我和你有或多或少相同的问题。 In the end I went for Richfaces, because the following points最后我选择了 Richfaces,因为以下几点

  • Better integrated with the core JSF 2.0 libarary and has more or less the same monoculture.与核心 JSF 2.0 库更好地集成,并且或多或少具有相同的单一文化。
  • No payload on bandwidth, when not using any Richfaces component, this will happens if you use Primefaces.带宽上没有负载,当不使用任何 Richfaces 组件时,如果您使用 Primefaces,就会发生这种情况。 Because the jquery and CSS will always load, whenever you using a component or not.因为 jquery 和 CSS 将始终加载,无论您是否使用组件。
  • The documentations is bit more comprehensive.文档更全面一些。 But the Primefaces forum is more active and you'll get a better feedback但是 Primefaces 论坛更活跃,你会得到更好的反馈

The bandwidth was the key point for me, so I picked Richfaces.带宽是我的重点,所以我选择了 Richfaces。 But I like the Primefaces library too, since the verity of components is greater.但我也喜欢 Primefaces 库,因为组件的真实性更高。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM