Form binding with object field

I have a EXAM class which has a updatedBy field - which references USER class.

EXAM Class

private int examid;
private String examname;
@ManyToOne
@JoinColumn(name=“updatedby”)
private User updatedByUser;

USER Class

private int userid;
private String username;

I can display the data OK, by binding the Exam Item. However, i want to be able to update the updatedByUser when i click on the Save Button… How can i do this? As far as i can see, i can only do this by using:-

examItem.getItemProperty(“updatedByUser”).setValue(user);

But this then doesn’t update the fieldGroup ismodified flag, so isn’t updated… Any other options?

Regards,

John.

Anyone got a hint or advice on this?

Hi,
what about updating updatedByUser directly on the bean in a FieldGroup commit handler (FieldGroup.addCommitHandler)?

HTH
Marco

I also need to set the user for other elements, like startedByUser etc. which should be instant when the user clicks on the start button on my form. How can i bind such an object to a form?

Anyone any pointers on this?

Do i need a custom field for this? In short, i want to be able to push a form button and set the value of a bound object so i can save changes along with other form changes…