[ http://jira.magnolia.info/browse/MAGNOLIA-1119?page=comments#action_13432 ] Chris Miner commented on MAGNOLIA-1119: ---------------------------------------
After working with my patched version for a while, I notice that the alert panel telling me that a property is missing is incorrectly localized. That is to say although my dialog is localized, the alert panel is not despite the fact that it looks like the code is attempting to do this. I tracked this down to the fact that at the time the validation is being done, the DialogControlImpl instance doesn't have a parent. The parent for such controls seems to be setup at render time. So... no access to the i18nbasename set in the dialog. Furthermore this failed attempt during validation leads to a misconfigured result from getMessages, when the dialog is later rendered and has a parent. This means the dialog label suddenly becomes unlocalized for fields that are required but fail the check. There is a workaround though. You can add i18nbasename properties to everyone of your dialog controls which are required. That way the right localized label is used in the alert panel that comes back, and same correctly localized label is shown in the dialog. But then there is the problem that only the first invalid field is reported. Via an alert panel. Better would be to indicate at least all required fields at once. With a color or something. see http://jira.magnolia.info/browse/MAGNOLIA-1361. Interestingly enough this is exactly where the if (StringUtils.isEmpty(this.getValue()) && this.getValues().size() == 0) bit actually works correctly for non multivalued fields and my patch doesn't. To make a long story short have a look at http://jira.magnolia.info/browse/MAGNOLIA-1361. > Required field in dialog > ------------------------ > > Key: MAGNOLIA-1119 > URL: http://jira.magnolia.info/browse/MAGNOLIA-1119 > Project: Magnolia > Issue Type: Bug > Affects Versions: 3.0 RC2 > Environment: OS: windows XP Pro, Tomcat 5.0, java j2sdk1.4.2_12 > Reporter: CAPITAINE Harold > Assigned To: Philipp Bracher > Fix For: 3.0.x > > Attachments: DialogControlImpl.patch, DialogControlImpl.patch, > patch.txt > > > When putting a field in a dialog to required, the field still can be empty. > Problem should come from DialogControlImpl.java in the validate function. > More precisely in the second part of the test. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.magnolia.info/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira ---------------------------------------------------------------- for list details see http://www.magnolia.info/en/magnolia/developer.html ----------------------------------------------------------------
