if (device != null) {
logger.info("device " + device.getValue().toString());
if (device.getValue() != null && device.getValue().toString().equalsIgnoreCase("Y")) {
logger.info("device inside is" + device.getValue().toString());
name_of_device.show();
dynamicForm.redraw();
} else {
logger.info("Initial is hiding");
name_of_device.hide();
dynamicForm.redraw();
}
}
if (device != null) {
device.addChangedHandler(new ChangedHandler() {
@Override
public void onChanged(ChangedEvent changedEvent) {
if(device.getValue().toString().equals("Yes") || device.getValue().toString().equals("Y"))
{
name_of_device.show();
name_of_device.setRequired(true);
}
else {
name_of_device.hide();
}
}
});
}
Hi Everyone, I am facing an issue where the code is working in the changedHandler where if the device.getValue() is Y the name_of_device field will show, but after I have saved the value and access to this method again, even though the value in the field is Y, the name_of_device_field will not be showing, but if I click on the changedHandler again, it is showing the correct behaviour.
Kindly advice what may be the issue and possible solutions. Thank you