1

Currently I'm trying JSF 2.0 and still learning the more advanced features.
JSF2 is comfortable when having to deal with pre-defined views (fixed component trees) whose widgets are completely known at compile time -- of course with the exception of repeating data list/table entries and light dynamic modification of forms via the DataTable "trick" (as I read here, especially under JSF2, can I add JSF components dynamically? and How to create dynamic JSF 1.2 form fields).

Now I'm wondering about the realization of completely dynamic JSF2 component trees, where a web user, for each given content type (e.g. 'Person', 'PersonList' but also 'PersonalManagementPanel'), can choose one from a list of content-type compatible widgets (=JSF custom components).
As result, this user will always see the "Personal Manager Page" rendered with his/her prefered "PersonalManagerPanel", which in turn also renders its nested components ('Person', 'PersonList') with the user's preferred variants.

Obviously, the goal is to get a selectively configurable/customizable JSF Page -- at runtime.

  1. Is this scenario realizable in JSF2? -- How could this be done?

  2. Are there more appropriate Java technologies for this requierement?
    -- One possible alternative I'm thinking of is XML plus XSLT.

Thank you very much for your help and suggestions.

Best regards
Martin

Community
  • 1
  • 1
Martin
  • 151
  • 1
  • 6

1 Answers1

0

You can use something like this:

<ui:include src="#{bean.template}" />

Or if you want more complicated components, you should take a look at the PreRenderViewEvent.

Note that there are issues with both solutions.

Adam
  • 5,045
  • 1
  • 25
  • 31