public GuiDemoFlexiFormCustomlayout(UserRequest ureq, WindowControl wControl, GuiDemoFlexiFormPersonData data) {
// this whole class is copy-pasted from the GuiDemoFlexiForm.java
// but the super constructor is called with a velocity page which serves then
// as layouting velocity page.
//
// inside this page one can render all the form elements with the wellknown
// $r.render("compName") paradigma. But with the form comes some naming convention
// to render the label, error, example of a form element.
// read the instructions in the customformlayout velocity page.
super(ureq, wControl, "customformlayout");
// first you may preprocess data to fit into the form items
// if all preprocessing is done, create the form items
//
// example for simple preprocessing - check for NULL
if(data != null){
personData = data;
}else{
personData = new GuiDemoFlexiFormPersonData();
}
//
// calls our initForm(formlayout,listener,ureq) with default values.
initForm(ureq);
//
// after initialisation you may need to do some stuff
// but typically initForm(..) is the last call in the constructor.
}
|