[
http://mifosforge.jira.com/browse/MIFOS-4112?page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#action_10115
]
jasmine sandhu logged work on MIFOS-4112:
-----------------------------------------
Author: jasmine sandhu
Created on: 08/Nov/10 11:46 PM
Start Date: 07/Nov/10 11:13 PM
Worklog Time Spent: 1 week, 2 days
Work Description: The validation errors do not handle typeMismatch errors
- these show up as binding errors on the form fields if we enter a string when
the field expects say a double.
The typeMismatch errors on a field resolve just fine. The problem is the
typeMismatch errors where the field binds to a List object need to be
parameterized and it is unclear how to parameterize those such that they
resolve correctly. For a list, the code resolver gives 7 possible messages
which actually gives a lot of flexibility for custom messages, but it is not
obvious how to parameterize any of these messages.
http://static.springsource.org/spring/docs/2.5.x/api/org/springframework/validation/DefaultMessageCodesResolver.html.
The easy option is to leave the typeMismatch.* messages un-parameterized but
this is not useful for our TWN folks. Another quick option is to delete the
typeMismatch.* messages for the list fields and replace them with the "Invalid
data" message. This is not a very informative message but reduces the
translations workload.
Ideally, I'd like to figure this out, just don't know if I can do it by Friday.
I tried playing around with the Errors interface, use the rejectValue method to
append to list of binding errors with some success - just need more time to
understand it.
Issue Time Tracking
-------------------
Time Spent: 1 week, 2 days
> Resolving MIFOS-3859 exposed a bug where typeMismatch.* error messages do not
> display correctly
> -----------------------------------------------------------------------------------------------
>
> Key: MIFOS-4112
> URL: http://mifosforge.jira.com/browse/MIFOS-4112
> Project: mifos
> Issue Type: Bug
> Components: Loan Account
> Reporter: jasmine sandhu
> Assignee: jasmine sandhu
> Attachments: typeMismatchError_after3859.png,
> typeMismatchError_after3859.png, typeMismatchErrorOnCI_oldCode.png,
> typeMismatchErrorOnCI_oldCode.png
>
> Time Spent: 1 week, 2 days
>
> In fixing: http://mifosforge.jira.com/browse/MIFOS-3859
> the error messages displayed when the defineLoanProducts.flt form is
> incorrectly filled are validated by LoanProductFormBeanValidator.java. This
> class constructs the keys for the messages based on the constraint violation,
> so if the field is null, it constructs a message as:
> NotNull.loanProduct.*
> This message is then read from messages.properties. The messages of the form:
> typeMismatch.loanProduct.* are not being displayed correctly after this
> parameterization.
> As an example, if I enter a string for the first entry in the Last Loan
> Amount table, it should trigger a typeMismatch error (see attached images).
> In the previous version, it appears the typeMismatch.* key was not being
> read, but the error was nicer in that it displayed:
> Invalid data
> Now, with the update, the error reads the string from the key but does not
> replace the parameter correctly. So it shows up as:
> Please Specify the valid Start Range Loan Amount for by last loan at row
> loanAmountByLastLoanAmount[0].lower
> but it should show up as follows if the error occurred on row 1:
> Please Specify the valid Start Range Loan Amount for by last loan at row 1.
> The commit for Mifos-3859 is: 7d543c9621afadd7754e72b83401678b0bf410ca
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://mifosforge.jira.com/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a
Billion" shares his insights and actions to help propel your
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
_______________________________________________
Mifos-issues mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mifos-issues