views:

26

answers:

1

Hi,

Im completely new to Java web stuff, but here goes my question:

1) How can I add new controls to a JSF page (webuijsf) in the prerender() function? 2) How can I change the position of elements already added using the visual designer? Also in prerender().

I have a number of input fields + labels to show, coming from a database. So I imagine I read from the database and add the appropriate number of controls during prerender. There's also a grid below these dynamically added controls, which I'd like to move further down at the same time.

Thanks!

A: 

You would need to write your own component if you wished to render forms based on database data. You should position your grid using standard html techniques or writing your own custom grid component.

Justin
So I cannot, for instance, add a number of labels using Java code? I have to add them via the designer or in the JSP tree structure?
You could write a component which added n number of labels, so instead of <h:outputLabel> you would use your own tag eg.<my:dynamicForm> which would generate n label tags based on whatever code you write.
Justin