简体   繁体   English

动态创建XHTML页面?

[英]Create XHTML pages dynamically?

Is it possible to dynamically create PrimeFaces or RichFaces pages? 是否可以动态创建PrimeFaces或RichFaces页面? What I want to do is build up an editor in a kind of "members" area within my application, where the users can create forms by selecting multiple check boxes, radio buttons, text boxes, and place them at defined positions. 我想要做的是在应用程序的“成员”区域中建立一个编辑器,用户可以通过选择多个复选框,单选按钮,文本框并将其放置在定义的位置来创建表单。 I would think the information of such a dynamic page would best be stored in the database. 我认为这种动态页面的信息最好存储在数据库中。 Are there ready to use functions that provide dynamic page creation like this? 是否可以使用提供动态页面创建功能的功能? Or do I have to build it myself using loops and switches? 还是我必须使用循环和开关自己构建它? I kindly thank in advance for any help on this! 我在此先感谢您的帮助!

You can do it either declaratively (switches in the xhtml to show or not certain components) or programmatically, adding new components to the UI root. 您可以声明性地执行此操作(在xhtml中进行切换以显示或不显示某些组件),也可以以编程方式将其添加到UI根目录中。 Use FacesContext to obtain the UI root and then add the classes you need. 使用FacesContext获取UI根目录,然后添加所需的类。 (for example, you might add a InputText object). (例如,您可以添加一个InputText对象)。

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

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