I have a popup dialog developed in IceFaces 1.8.x (JSF 1.2).
The dialog is reusable (used for account creation as well as modification) and has a cancel button with immediate = true
(to avoid validations). This dialog suffered a problem in the past ,where old values were rendered on re-opening the dialog, but that problem is now fixed as directed here (by setting submittedValue
to null etc.).
The problem that I am facing now is specific to a conditionally disabled input field (<ice:inputText>
) and here is what happens:
- The popup is first opened (say for account creation) and this field is NOT disabled.
- User then cancels this dialog and, as we have incorporated the fix mentioned above (
setSubmittedValue(null)
), thesubmittedValue
for this field is set to null (along with other fields). - Now the user opens "modify account" dialog, where in this field IS disabled. Everything seems to be rendered fine until user makes any changes to the form.
- When user changes some field (say name) in the form, a partial submit happens for the name field as expected, but along with it null value is submitted for this disabled field.
This problem can be worked around by adding a null check in the setter method for the field in question, but this is not the desired solution for the project - as there are multiple places where this could be needed and doesn't seem like a very intuitive thing to do.
So I need to understand:
- Why is the setter for this disabled field getting called in the first place? and that too with a null value. The setter is not called for any other enabled fields.
- More importantly, is there any way to fix this (other than adding null check in the setter)?