I have a managedbean AddDeviceBean where in instantiating all domain objects used in screen in the constructor
public AddDeviceBean() {
device = new DeviceVO();
deviceacct = new DeviceAccountsVO();
deviceconfig = new DeviceConfigVO();
devicecurr =new DeviceCurrencyVO();
devicelink = new DeviceLinkVO();
devicetran = new DeviceTranVO();
devicecd = new DeviceCDVO();
deviceBlank = new DeviceBlankVO();
comments = new ArrayList<DeviceCommentsVO>();
}
I have a DB2 sequence whose next value has to be set for a property on pageload
I am using @PostConstruct annotation to generate the next value and setting the value.
Problem is I have commandButton on the screen which invokes some method in same bean and @PostConstruct is called twice after submitting and the DB2 next value is called
I need to get next value only once during page load and not during submit