-
1. conversion errors and immediate="true"
ncheck Mar 9, 2011 5:00 PM (in response to ncheck)Sorry - I should correct something - clicking the button refreshes everything BUT the fail conversion values - those values seem to somehow stick or be cached somewhere. The actual backing bean value contains the correct value but the screen does not show it after reRender. Please help!
-
2. Re: conversion errors and immediate="true"
boy18nj Mar 9, 2011 5:14 PM (in response to ncheck)You forget to add this attribute, this will update your backing bean value on the screen-
<a4j:support ajaxSingle="true" event="onblur" ignoreDupResponses="true" oncomplete="checkFieldValidation(this)" onsubmit="updateDirty()"/>
change to
<a4j:support
reRender="grossVolume" ajaxSingle="true" event="onblur" ignoreDupResponses="true" oncomplete="checkFieldValidation(this)" onsubmit="updateDirty()"/>
Don't forget to mark the post as correct/helpful answer, if it solves/helps you.
-
3. conversion errors and immediate="true"
ncheck Mar 9, 2011 5:18 PM (in response to boy18nj)Hi Aman,
Thank you for your reply - normally, I would have put the reRender attribute as you suggested, however, in this particular instance the reRender tag has been purposely omitted because in IE, the reRender causes the user to lose focus if an error (validation) has occurred on the page. for this reason, I am updating the status in the oncomplete.
The above all works fine - it is with the REFRESH (or attempted refresh) of the panel in which the bad (non-convertable) field is found that the issue exsists. The cached value seems to persist somewhere and I'm not sure how to clear it?
Thanks again!
-
4. Re: conversion errors and immediate="true"
boy18nj Mar 9, 2011 5:31 PM (in response to ncheck)Please let us know your conversion error stack trace and what is this datatype {volumeBean.enteredGrossVolume}?
I guess your revert ajax button purpose is to clear the value entered by the user and show the existing value from the bean. For this either you have to add a4j:region around all h:inputText elements you want to rerender or add rerender attribute to your revert button, listing all the fields you want to rerender.
-
5. conversion errors and immediate="true"
ncheck Mar 9, 2011 5:30 PM (in response to boy18nj)I don't have the conversion error stack - it just returns an error the datatype is BigDecimal and if I enter something non-numeric in the field, a subsequent reRender of the containing panel does not update the bad data - it's stuck there and keeps failing conversion....
-
6. Re: conversion errors and immediate="true"
boy18nj Mar 9, 2011 5:34 PM (in response to ncheck)this is how jsf lifecycle works, if there is conversion error, it won't update the model values.
-
7. conversion errors and immediate="true"
ncheck Mar 9, 2011 5:40 PM (in response to boy18nj)Hi again,
Yes, I know that the model is not updated - however my problem is not the model - the model contains the correct values.
The problem is that I cannot FORCE the screen to refresh (partial update) with the correct values on the click of my refresh button - the bad fields are not cleared unless the user is forced to clear them - which should not happen if the a4j:commmandButton has immediate="true"
-
8. conversion errors and immediate="true"
ncheck Mar 9, 2011 7:15 PM (in response to boy18nj)And please note that the error occurs regardless of whether there is a reRender attribute set on the a4j:support
Here are the steps to reproduce - just to clarify further:
1. navigate to the screen where the BigDecimal input field exists
2. type aa into the field (should be a number but put non-numeric characters purposely)
3. tab off the field
4. notice that an error is reported 'aa' is not a valid netVolume
5. click on the RESET button
6. all of the changed fields have their original values EXCEPT those that have non-numeric data entered
7. unless the user manually deletes the non-numeric data in the fields or refreshes the entire screen, the "bad data" sticks
-
9. conversion errors and immediate="true"
nbelaevski Mar 10, 2011 3:35 AM (in response to ncheck)Nina,
Is 'volumeBean.revert' being called when you press the button? Also it the button inside or outside table?
-
10. conversion errors and immediate="true"
boy18nj Mar 10, 2011 11:21 AM (in response to ncheck)I guess your revert ajax button purpose is to clear the value entered by the user and show the existing value from the bean. For this either you have to add a4j:region around all h:inputText elements you want to rerender or add rerender attribute to your revert button, listing all the fields you want to rerender or clear.
Did you tried this?
-
11. conversion errors and immediate="true"
ncheck Mar 10, 2011 12:39 PM (in response to boy18nj)HI Aman,
Yes, I've tried this. I've tried both reRendering the individual fields and the outputPanel - both with the same result....
-
12. conversion errors and immediate="true"
ncheck Mar 10, 2011 1:33 PM (in response to nbelaevski)Hi Nick,
I've tried both - the a4j:commandButton inside the same panel and outside the panel - both yield the same results - the aa string is not refreshed to original (valid) value....
N
-
13. conversion errors and immediate="true"
ncheck Mar 10, 2011 1:35 PM (in response to nbelaevski)Hi Nick, - also add 'yes', volumeBean.revert is being called for 100% sure