# Revision history [back]

I'll add this again here, maybe in got lost in the mixed answer.

If you need to initialize and pre-populate some values in the Form you can manually create a proxy:

Pojo originalPojo;
Pojo pojoForm = ProxyHelper.createProxyIfAny(originalPojo); //form proxy around the pojo
pojoForm.setIcdVersion(123456); //will set the value in the form only
//does not affect the originalPojo

public Pojo getPojoForm() {
return pojoForm;
}

/*getter setter for originalPojo*/


and use it in the zul file:

<groupbox form="@id('fx') @init(vm.pojoForm) @load(vm.originalPojo)
@save(vm.originalPojo, before='savePojo') " >


I hope that clarifies the usage for you

I'll add this again here, maybe in got lost in the mixed answer.

If you need to initialize and pre-populate some values in the Form you can manually create a proxy:

Pojo originalPojo;
Pojo pojoForm;

@Init
public void init() {
//retrieve original Pojo ...
//create a proxy around the originalPojo
pojoForm = ProxyHelper.createProxyIfAny(originalPojo); //form
//set a value in the form proxy around the pojo
pojoForm.setIcdVersion(123456); //will set the value in the form only
//does not affect the originalPojo
originalPojo direcly, only after successful saving
pojoForm.setIcdVersion(123456);
}

public Pojo getPojoForm() {
return pojoForm;
}

/*getter setter for originalPojo*/


and use it in the zul file:

<groupbox form="@id('fx') @init(vm.pojoForm) @load(vm.originalPojo)
@save(vm.originalPojo, before='savePojo') " >


I hope that clarifies the usage As you can see there is no need for you

an Object like Simple form anymore. You still work with your original class' interface, just behind a proxy.

I'll add this again here, maybe in got lost in the mixed answer.

If you need to initialize and pre-populate some values in the Form you can manually create a proxy:

Pojo originalPojo;
Pojo pojoForm;

@Init
public void init() {
//retrieve original Pojo ...
//create a proxy around the originalPojo
pojoForm = ProxyHelper.createProxyIfAny(originalPojo);
//set a value in the form proxy only
//does not affect the originalPojo direcly, only after successful saving
pojoForm.setIcdVersion(123456);
}

public Pojo getPojoForm() {
return pojoForm;
}

/*getter setter for originalPojo*/


and use it in the zul file:

<groupbox form="@id('fx') @init(vm.pojoForm) @load(vm.originalPojo)
@save(vm.originalPojo, before='savePojo') " >


As you can see there is no need for an Object like Simple form SimpleForm anymore. You still work with your original class' interface, just behind a proxy.

Support Options
• Email Support
• Training
• Consulting
• Outsourcing