-1

View looks like this:

form (can have only one checkbox selected)

----------------------------------------

checkbox_1 (on value change clears checkbox_1 and checkbox_2 values in the backing bean and updates form**. new checkbox_1value is set after all checkbox values are cleared)row_checkbox_1(rendered only ifcheckbox_1` is checked)

checkbox_2 (on value change clears checkbox_1 and checkbox_2 values in the backing bean and updates form**. new checkbox_2value is set after all checkbox values are cleared)row_checkbox_2(rendered only ifcheckbox_2` is checked)

saveButton (on click updates formand a separate messages component)

---------------------------------

Lets state checkbox_1 is selected meaning that row_checkbox_1 components is also visible. Also there are errors in row_checkbox_1 fields. After saveButtonis pressed the errors are displayed. Problem: pressing/checking checkbox_2 updates backing bean - checkbox_1 value field in the backing bean gets set to false (debugged and verified by looking at getter) and checkbox_2 value field is set to true. However view does not update correctly since checkbox_1 is rendered as checked while row_checkbox_1 is not rendered at all. Remember row_checkbox_1 is rendered only if checkbox_1 is true. checkbox_2 is rendered and checked as it should be and row_checkbox_2 fields are visible as it should be.

I'm doing all this in PrimeFaces 6.0

Community
  • 1
  • 1
user435421
  • 859
  • 2
  • 13
  • 31
  • Version info does not belong in the title UNLESS it e.g. works with a previous version and is a regression. Still than, see ; https://stackoverflow.com/help/tagging – Kukeltje Jun 19 '19 at 09:16

1 Answers1

0

ajax attribute restValues="true" helped. Maybe someone could do an explanation why this situation occurs? Would gladly give answer point to them!

user435421
  • 859
  • 2
  • 13
  • 31
  • https://stackoverflow.com/questions/6642242/how-can-i-populate-a-text-field-using-primefaces-ajax-after-validation-errors-oc – Kukeltje Jun 20 '19 at 14:04