You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Benjamin McCann (JIRA)" <ji...@apache.org> on 2007/10/16 22:14:38 UTC
[jira] Created: (WW-2256) Validation broken on autocompleters
Validation broken on autocompleters
-----------------------------------
Key: WW-2256
URL: https://issues.apache.org/struts/browse/WW-2256
Project: Struts 2
Issue Type: Bug
Components: Plugins, Views
Affects Versions: 2.0.9, 2.1.0
Environment: Issue identified on Windows XP using Firefox
Reporter: Benjamin McCann
Priority: Critical
I have an autocompleter named "site":
<s:url id="siteList" action="AutocompleteField" method="selectSite" namespace="/general" />
<sx:autocompleter label="Site" value="%{system.site}"
forceValidOption="true"
cssStyle="width:132px; height:18px; border:1px solid #7B9EBD"
name="site" required="true" href="%{siteList}"
loadOnTextChange="true" showDownArrow="false" dropdownWidth="300"
searchType="substring" />
It has the following validator:
<field name="site">
<field-validator type="requiredstring">
<message>Field is required</message>
</field-validator>
</field>
When I submit my .jsp without site filled in I get the message: "TypeError: row.cells has no properties"
When I submit my .jsp with site filled in I get message that the field is required and all the other fields are blanked out.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (WW-2256) Validation broken on autocompleters
Posted by "Benjamin McCann (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/struts/browse/WW-2256?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43375#action_43375 ]
Benjamin McCann commented on WW-2256:
-------------------------------------
This issue arises in Firefox using the Dojo plugin (possibly other cases too, but this is the one I'm aware of.)
Firefox for some reason inserts an extra span element (viewable with Firebug) making the current implementation break. The patch fixes the issue by not assuming it needs to go up a fixed two parent levels, but instead figures that out dynamically.
I changed the labels errorFor to reference elements by name instead of id because there were instances in which Struts was generating a name, but not an id. I didn't see any cases where it was the other way around, which makes some sense because you only need the name attribute defined to submit data. The validation code was broken for those instances where an id was not generated by Struts, so this patch solves that issue as well. I made it a single patch because this is everything needed to get validation working with the Dojo plugin.
I'm not sure if there's a good way to unit test JS. I suppose we could look at HtmlUnit. I've been using a patched version of Struts with this and several other bug fixes I wrote in an enterprise environment with thousands of users for the last few months with no issues.
Also, yes, consider only the larger patch. The smaller patch fixes only a subset of the issues (adding errors, but not clearing them)
> Validation broken on autocompleters
> -----------------------------------
>
> Key: WW-2256
> URL: https://issues.apache.org/struts/browse/WW-2256
> Project: Struts 2
> Issue Type: Bug
> Components: Plugin - Mechanism, Plugin - Tags
> Affects Versions: 2.0.9, 2.1.0
> Environment: Issue identified on Windows XP using Firefox
> Reporter: Benjamin McCann
> Priority: Critical
> Fix For: 2.1.4
>
> Attachments: allFieldsFilledOnSubmit.png, siteEmptyOnSubmit.png, validation.js.patch, validation.js.patch
>
>
> I have an autocompleter named "site":
> <s:url id="siteList" action="AutocompleteField" method="selectSite" namespace="/general" />
> <sx:autocompleter label="Site" value="%{system.site}"
> forceValidOption="true"
> cssStyle="width:132px; height:18px; border:1px solid #7B9EBD"
> name="site" required="true" href="%{siteList}"
> loadOnTextChange="true" showDownArrow="false" dropdownWidth="300"
> searchType="substring" />
> It has the following validator:
> <field name="site">
> <field-validator type="requiredstring">
> <message>Field is required</message>
> </field-validator>
> </field>
> When I submit my .jsp without site filled in I get the message: "TypeError: row.cells has no properties"
> When I submit my .jsp with site filled in I get message that the field is required and all the other fields are blanked out.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (WW-2256) Validation broken on autocompleters
Posted by "Jeromy Evans (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/struts/browse/WW-2256?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43376#action_43376 ]
Jeromy Evans commented on WW-2256:
----------------------------------
I thought the id attribute on all dojo tags was mandatory. Each tag includes code to generate a random id if not specified. I think the non-dojo tags don't auto-assign an id unless key is specified If there are tags that still have this issue that probably should be raised separately.
I'm quite sure that in html4 the label's for attribute must reference the form element by id. I'm certain that's the case in XHTML and strict
(it may work with a transitional doctype or with certain browsers). I don't think that part of the patch should go in with this issue.
Have time to submit another patch?
> Validation broken on autocompleters
> -----------------------------------
>
> Key: WW-2256
> URL: https://issues.apache.org/struts/browse/WW-2256
> Project: Struts 2
> Issue Type: Bug
> Components: Plugin - Mechanism, Plugin - Tags
> Affects Versions: 2.0.9, 2.1.0
> Environment: Issue identified on Windows XP using Firefox
> Reporter: Benjamin McCann
> Priority: Critical
> Fix For: 2.1.4
>
> Attachments: allFieldsFilledOnSubmit.png, siteEmptyOnSubmit.png, validation.js.patch, validation.js.patch
>
>
> I have an autocompleter named "site":
> <s:url id="siteList" action="AutocompleteField" method="selectSite" namespace="/general" />
> <sx:autocompleter label="Site" value="%{system.site}"
> forceValidOption="true"
> cssStyle="width:132px; height:18px; border:1px solid #7B9EBD"
> name="site" required="true" href="%{siteList}"
> loadOnTextChange="true" showDownArrow="false" dropdownWidth="300"
> searchType="substring" />
> It has the following validator:
> <field name="site">
> <field-validator type="requiredstring">
> <message>Field is required</message>
> </field-validator>
> </field>
> When I submit my .jsp without site filled in I get the message: "TypeError: row.cells has no properties"
> When I submit my .jsp with site filled in I get message that the field is required and all the other fields are blanked out.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (WW-2256) Validation broken on autocompleters
Posted by "Benjamin McCann (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/struts/browse/WW-2256?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Benjamin McCann updated WW-2256:
--------------------------------
Attachment: allFieldsFilledOnSubmit.png
This is what happens after submitting when site is filled in.
> Validation broken on autocompleters
> -----------------------------------
>
> Key: WW-2256
> URL: https://issues.apache.org/struts/browse/WW-2256
> Project: Struts 2
> Issue Type: Bug
> Components: Plugins, Views
> Affects Versions: 2.0.9, 2.1.0
> Environment: Issue identified on Windows XP using Firefox
> Reporter: Benjamin McCann
> Priority: Critical
> Attachments: allFieldsFilledOnSubmit.png, siteEmptyOnSubmit.png
>
>
> I have an autocompleter named "site":
> <s:url id="siteList" action="AutocompleteField" method="selectSite" namespace="/general" />
> <sx:autocompleter label="Site" value="%{system.site}"
> forceValidOption="true"
> cssStyle="width:132px; height:18px; border:1px solid #7B9EBD"
> name="site" required="true" href="%{siteList}"
> loadOnTextChange="true" showDownArrow="false" dropdownWidth="300"
> searchType="substring" />
> It has the following validator:
> <field name="site">
> <field-validator type="requiredstring">
> <message>Field is required</message>
> </field-validator>
> </field>
> When I submit my .jsp without site filled in I get the message: "TypeError: row.cells has no properties"
> When I submit my .jsp with site filled in I get message that the field is required and all the other fields are blanked out.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (WW-2256) Validation broken on autocompleters
Posted by "Benjamin McCann (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/struts/browse/WW-2256?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Benjamin McCann updated WW-2256:
--------------------------------
Attachment: siteEmptyOnSubmit.png
This is what happens after I submit without the site field filled in.
> Validation broken on autocompleters
> -----------------------------------
>
> Key: WW-2256
> URL: https://issues.apache.org/struts/browse/WW-2256
> Project: Struts 2
> Issue Type: Bug
> Components: Plugins, Views
> Affects Versions: 2.0.9, 2.1.0
> Environment: Issue identified on Windows XP using Firefox
> Reporter: Benjamin McCann
> Priority: Critical
> Attachments: siteEmptyOnSubmit.png
>
>
> I have an autocompleter named "site":
> <s:url id="siteList" action="AutocompleteField" method="selectSite" namespace="/general" />
> <sx:autocompleter label="Site" value="%{system.site}"
> forceValidOption="true"
> cssStyle="width:132px; height:18px; border:1px solid #7B9EBD"
> name="site" required="true" href="%{siteList}"
> loadOnTextChange="true" showDownArrow="false" dropdownWidth="300"
> searchType="substring" />
> It has the following validator:
> <field name="site">
> <field-validator type="requiredstring">
> <message>Field is required</message>
> </field-validator>
> </field>
> When I submit my .jsp without site filled in I get the message: "TypeError: row.cells has no properties"
> When I submit my .jsp with site filled in I get message that the field is required and all the other fields are blanked out.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (WW-2256) Validation broken on autocompleters
Posted by "Benjamin McCann (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/struts/browse/WW-2256?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_42402 ]
Benjamin McCann commented on WW-2256:
-------------------------------------
I should note this bug report is using Struts 2.1.0. I had filed a similar report (WW-2098) earlier for Struts 2.0.9, which was never looked at since it was assumed it would not reoccur in 2.1.
> Validation broken on autocompleters
> -----------------------------------
>
> Key: WW-2256
> URL: https://issues.apache.org/struts/browse/WW-2256
> Project: Struts 2
> Issue Type: Bug
> Components: Plugins, Views
> Affects Versions: 2.0.9, 2.1.0
> Environment: Issue identified on Windows XP using Firefox
> Reporter: Benjamin McCann
> Priority: Critical
> Attachments: siteEmptyOnSubmit.png
>
>
> I have an autocompleter named "site":
> <s:url id="siteList" action="AutocompleteField" method="selectSite" namespace="/general" />
> <sx:autocompleter label="Site" value="%{system.site}"
> forceValidOption="true"
> cssStyle="width:132px; height:18px; border:1px solid #7B9EBD"
> name="site" required="true" href="%{siteList}"
> loadOnTextChange="true" showDownArrow="false" dropdownWidth="300"
> searchType="substring" />
> It has the following validator:
> <field name="site">
> <field-validator type="requiredstring">
> <message>Field is required</message>
> </field-validator>
> </field>
> When I submit my .jsp without site filled in I get the message: "TypeError: row.cells has no properties"
> When I submit my .jsp with site filled in I get message that the field is required and all the other fields are blanked out.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (WW-2256) Validation broken on autocompleters
Posted by "Jeromy Evans (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/struts/browse/WW-2256?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jeromy Evans resolved WW-2256.
------------------------------
Resolution: Fixed
Fix Version/s: (was: 2.1.4)
2.1.1
Issue confirmed.
The attached patches weren't sufficient as they did not work where a child element of the form was not contained by a table row and because the input inserted by dojo contained a blank id and that was not matched by the function clearing labels based on the errorFor labels.
Unfortunately I also have to raise the following two issues:
1. WW-2521 client-side validation doesn't work if the control doesn't have a label
2.WW-2522 autocompleter cannot be used within a css_xhtml form with clientside validation
The validation script for the css_xhtml theme searches for the containing divs but the autocompeter is contained in tables (based on xhtml theme)
I've committed the fix based on the patches but with additional error detection. Thanks Benjamin.
> Validation broken on autocompleters
> -----------------------------------
>
> Key: WW-2256
> URL: https://issues.apache.org/struts/browse/WW-2256
> Project: Struts 2
> Issue Type: Bug
> Components: Plugin - Mechanism, Plugin - Tags
> Affects Versions: 2.0.9, 2.1.0
> Environment: Issue identified on Windows XP using Firefox
> Reporter: Benjamin McCann
> Assignee: Jeromy Evans
> Priority: Critical
> Fix For: 2.1.1
>
> Attachments: allFieldsFilledOnSubmit.png, siteEmptyOnSubmit.png, validation.js.patch, validation.js.patch, validation.js.patch
>
>
> I have an autocompleter named "site":
> <s:url id="siteList" action="AutocompleteField" method="selectSite" namespace="/general" />
> <sx:autocompleter label="Site" value="%{system.site}"
> forceValidOption="true"
> cssStyle="width:132px; height:18px; border:1px solid #7B9EBD"
> name="site" required="true" href="%{siteList}"
> loadOnTextChange="true" showDownArrow="false" dropdownWidth="300"
> searchType="substring" />
> It has the following validator:
> <field name="site">
> <field-validator type="requiredstring">
> <message>Field is required</message>
> </field-validator>
> </field>
> When I submit my .jsp without site filled in I get the message: "TypeError: row.cells has no properties"
> When I submit my .jsp with site filled in I get message that the field is required and all the other fields are blanked out.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Assigned: (WW-2256) Validation broken on autocompleters
Posted by "Jeromy Evans (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/struts/browse/WW-2256?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jeromy Evans reassigned WW-2256:
--------------------------------
Assignee: Jeromy Evans
> Validation broken on autocompleters
> -----------------------------------
>
> Key: WW-2256
> URL: https://issues.apache.org/struts/browse/WW-2256
> Project: Struts 2
> Issue Type: Bug
> Components: Plugin - Mechanism, Plugin - Tags
> Affects Versions: 2.0.9, 2.1.0
> Environment: Issue identified on Windows XP using Firefox
> Reporter: Benjamin McCann
> Assignee: Jeromy Evans
> Priority: Critical
> Fix For: 2.1.4
>
> Attachments: allFieldsFilledOnSubmit.png, siteEmptyOnSubmit.png, validation.js.patch, validation.js.patch, validation.js.patch
>
>
> I have an autocompleter named "site":
> <s:url id="siteList" action="AutocompleteField" method="selectSite" namespace="/general" />
> <sx:autocompleter label="Site" value="%{system.site}"
> forceValidOption="true"
> cssStyle="width:132px; height:18px; border:1px solid #7B9EBD"
> name="site" required="true" href="%{siteList}"
> loadOnTextChange="true" showDownArrow="false" dropdownWidth="300"
> searchType="substring" />
> It has the following validator:
> <field name="site">
> <field-validator type="requiredstring">
> <message>Field is required</message>
> </field-validator>
> </field>
> When I submit my .jsp without site filled in I get the message: "TypeError: row.cells has no properties"
> When I submit my .jsp with site filled in I get message that the field is required and all the other fields are blanked out.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (WW-2256) Validation broken on autocompleters
Posted by "Benjamin McCann (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/struts/browse/WW-2256?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Benjamin McCann updated WW-2256:
--------------------------------
Attachment: validation.js.patch
The initial patch I submitted only fixed the addition of field errors. This patch completely fixes the validation problem by also clearing the errors properly. You may disregard the first patch submitted.
> Validation broken on autocompleters
> -----------------------------------
>
> Key: WW-2256
> URL: https://issues.apache.org/struts/browse/WW-2256
> Project: Struts 2
> Issue Type: Bug
> Components: Plugin - Mechanism, Plugin - Tags
> Affects Versions: 2.0.9, 2.1.0
> Environment: Issue identified on Windows XP using Firefox
> Reporter: Benjamin McCann
> Priority: Critical
> Fix For: 2.1.4
>
> Attachments: allFieldsFilledOnSubmit.png, siteEmptyOnSubmit.png, validation.js.patch, validation.js.patch
>
>
> I have an autocompleter named "site":
> <s:url id="siteList" action="AutocompleteField" method="selectSite" namespace="/general" />
> <sx:autocompleter label="Site" value="%{system.site}"
> forceValidOption="true"
> cssStyle="width:132px; height:18px; border:1px solid #7B9EBD"
> name="site" required="true" href="%{siteList}"
> loadOnTextChange="true" showDownArrow="false" dropdownWidth="300"
> searchType="substring" />
> It has the following validator:
> <field name="site">
> <field-validator type="requiredstring">
> <message>Field is required</message>
> </field-validator>
> </field>
> When I submit my .jsp without site filled in I get the message: "TypeError: row.cells has no properties"
> When I submit my .jsp with site filled in I get message that the field is required and all the other fields are blanked out.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (WW-2256) Validation broken on autocompleters
Posted by "Benjamin McCann (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/struts/browse/WW-2256?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Benjamin McCann updated WW-2256:
--------------------------------
Attachment: validation.js.patch
> Validation broken on autocompleters
> -----------------------------------
>
> Key: WW-2256
> URL: https://issues.apache.org/struts/browse/WW-2256
> Project: Struts 2
> Issue Type: Bug
> Components: Plugin - Mechanism, Plugin - Tags
> Affects Versions: 2.0.9, 2.1.0
> Environment: Issue identified on Windows XP using Firefox
> Reporter: Benjamin McCann
> Priority: Critical
> Fix For: 2.1.4
>
> Attachments: allFieldsFilledOnSubmit.png, siteEmptyOnSubmit.png, validation.js.patch, validation.js.patch, validation.js.patch
>
>
> I have an autocompleter named "site":
> <s:url id="siteList" action="AutocompleteField" method="selectSite" namespace="/general" />
> <sx:autocompleter label="Site" value="%{system.site}"
> forceValidOption="true"
> cssStyle="width:132px; height:18px; border:1px solid #7B9EBD"
> name="site" required="true" href="%{siteList}"
> loadOnTextChange="true" showDownArrow="false" dropdownWidth="300"
> searchType="substring" />
> It has the following validator:
> <field name="site">
> <field-validator type="requiredstring">
> <message>Field is required</message>
> </field-validator>
> </field>
> When I submit my .jsp without site filled in I get the message: "TypeError: row.cells has no properties"
> When I submit my .jsp with site filled in I get message that the field is required and all the other fields are blanked out.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (WW-2256) Validation broken on autocompleters
Posted by "Benjamin McCann (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/struts/browse/WW-2256?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43378#action_43378 ]
Benjamin McCann commented on WW-2256:
-------------------------------------
Hi Jeromy,
I looked up the spec for the HTML label element and you're right that the for attribute refers to the id of another element, so go ahead and exclude that portion of the patch. I can file another bug to make sure Ids are auto-generated for any elements that I find them missing on.
Also, as a note to whoever applies this patch, both the compressed and non-compressed versions of the file should be fixed. I'm not sure if just the uncompressed file can be patched and then a script is run to compress it or how that works.
-Ben
> Validation broken on autocompleters
> -----------------------------------
>
> Key: WW-2256
> URL: https://issues.apache.org/struts/browse/WW-2256
> Project: Struts 2
> Issue Type: Bug
> Components: Plugin - Mechanism, Plugin - Tags
> Affects Versions: 2.0.9, 2.1.0
> Environment: Issue identified on Windows XP using Firefox
> Reporter: Benjamin McCann
> Priority: Critical
> Fix For: 2.1.4
>
> Attachments: allFieldsFilledOnSubmit.png, siteEmptyOnSubmit.png, validation.js.patch, validation.js.patch
>
>
> I have an autocompleter named "site":
> <s:url id="siteList" action="AutocompleteField" method="selectSite" namespace="/general" />
> <sx:autocompleter label="Site" value="%{system.site}"
> forceValidOption="true"
> cssStyle="width:132px; height:18px; border:1px solid #7B9EBD"
> name="site" required="true" href="%{siteList}"
> loadOnTextChange="true" showDownArrow="false" dropdownWidth="300"
> searchType="substring" />
> It has the following validator:
> <field name="site">
> <field-validator type="requiredstring">
> <message>Field is required</message>
> </field-validator>
> </field>
> When I submit my .jsp without site filled in I get the message: "TypeError: row.cells has no properties"
> When I submit my .jsp with site filled in I get message that the field is required and all the other fields are blanked out.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (WW-2256) Validation broken on autocompleters
Posted by "Benjamin McCann (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/struts/browse/WW-2256?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Benjamin McCann updated WW-2256:
--------------------------------
Attachment: validation.js.patch
Patch is for struts2\core\src\main\resources\template\xhtml\validation.js
My patch for WW-2094 seems to have been approved, yet never committed. The issue was marked as fixed, but I don't believe that to be true since it doesn't appear my code made it into SVN. I haven't gotten any response as to what's going on. I hope something actually happens with this patch.
Thanks,
Ben
http://benmccann.com
> Validation broken on autocompleters
> -----------------------------------
>
> Key: WW-2256
> URL: https://issues.apache.org/struts/browse/WW-2256
> Project: Struts 2
> Issue Type: Bug
> Components: Plugin - Mechanism, Plugin - Tags
> Affects Versions: 2.0.9, 2.1.0
> Environment: Issue identified on Windows XP using Firefox
> Reporter: Benjamin McCann
> Priority: Critical
> Fix For: 2.1.4
>
> Attachments: allFieldsFilledOnSubmit.png, siteEmptyOnSubmit.png, validation.js.patch
>
>
> I have an autocompleter named "site":
> <s:url id="siteList" action="AutocompleteField" method="selectSite" namespace="/general" />
> <sx:autocompleter label="Site" value="%{system.site}"
> forceValidOption="true"
> cssStyle="width:132px; height:18px; border:1px solid #7B9EBD"
> name="site" required="true" href="%{siteList}"
> loadOnTextChange="true" showDownArrow="false" dropdownWidth="300"
> searchType="substring" />
> It has the following validator:
> <field name="site">
> <field-validator type="requiredstring">
> <message>Field is required</message>
> </field-validator>
> </field>
> When I submit my .jsp without site filled in I get the message: "TypeError: row.cells has no properties"
> When I submit my .jsp with site filled in I get message that the field is required and all the other fields are blanked out.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (WW-2256) Validation broken on autocompleters
Posted by "Jeromy Evans (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/struts/browse/WW-2256?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43374#action_43374 ]
Jeromy Evans commented on WW-2256:
----------------------------------
I haven't noticed this issue before. My interpretation is:
When clearing a field error, the existing javacript assumes a specific structure of the html elements that contain the field errors
(eg. e.parentNode.parentNode).
The patch replaces this assumption with a search for a parent node of type TR. That seems fine...
I assume then that the problem exists only where the template has been changed from the default??? Is that right?
I don't understand why the patch has also changed the labels errorFor to reference elements by name instead of id. That doesn't seem right.
Ben, it probably helps to initially provide a description of the problem and how it's been fixed by the patch, especially if it's not reproducible for others, otherwise the volunteer committers are likely to place it in the "too hard basket" and push it back to later release. Assume the assignment to 2.1.4 simply means "not 2.1.1".
I assume the larger of the two patches applies.
> Validation broken on autocompleters
> -----------------------------------
>
> Key: WW-2256
> URL: https://issues.apache.org/struts/browse/WW-2256
> Project: Struts 2
> Issue Type: Bug
> Components: Plugin - Mechanism, Plugin - Tags
> Affects Versions: 2.0.9, 2.1.0
> Environment: Issue identified on Windows XP using Firefox
> Reporter: Benjamin McCann
> Priority: Critical
> Fix For: 2.1.4
>
> Attachments: allFieldsFilledOnSubmit.png, siteEmptyOnSubmit.png, validation.js.patch, validation.js.patch
>
>
> I have an autocompleter named "site":
> <s:url id="siteList" action="AutocompleteField" method="selectSite" namespace="/general" />
> <sx:autocompleter label="Site" value="%{system.site}"
> forceValidOption="true"
> cssStyle="width:132px; height:18px; border:1px solid #7B9EBD"
> name="site" required="true" href="%{siteList}"
> loadOnTextChange="true" showDownArrow="false" dropdownWidth="300"
> searchType="substring" />
> It has the following validator:
> <field name="site">
> <field-validator type="requiredstring">
> <message>Field is required</message>
> </field-validator>
> </field>
> When I submit my .jsp without site filled in I get the message: "TypeError: row.cells has no properties"
> When I submit my .jsp with site filled in I get message that the field is required and all the other fields are blanked out.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (WW-2256) Validation broken on autocompleters
Posted by "Benjamin McCann (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/struts/browse/WW-2256?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43373#action_43373 ]
Benjamin McCann commented on WW-2256:
-------------------------------------
Also, I'd like to add that this issue affects not just autocompleters, but I believe all Dojo components and possibly other inputs.
> Validation broken on autocompleters
> -----------------------------------
>
> Key: WW-2256
> URL: https://issues.apache.org/struts/browse/WW-2256
> Project: Struts 2
> Issue Type: Bug
> Components: Plugin - Mechanism, Plugin - Tags
> Affects Versions: 2.0.9, 2.1.0
> Environment: Issue identified on Windows XP using Firefox
> Reporter: Benjamin McCann
> Priority: Critical
> Fix For: 2.1.4
>
> Attachments: allFieldsFilledOnSubmit.png, siteEmptyOnSubmit.png, validation.js.patch, validation.js.patch
>
>
> I have an autocompleter named "site":
> <s:url id="siteList" action="AutocompleteField" method="selectSite" namespace="/general" />
> <sx:autocompleter label="Site" value="%{system.site}"
> forceValidOption="true"
> cssStyle="width:132px; height:18px; border:1px solid #7B9EBD"
> name="site" required="true" href="%{siteList}"
> loadOnTextChange="true" showDownArrow="false" dropdownWidth="300"
> searchType="substring" />
> It has the following validator:
> <field name="site">
> <field-validator type="requiredstring">
> <message>Field is required</message>
> </field-validator>
> </field>
> When I submit my .jsp without site filled in I get the message: "TypeError: row.cells has no properties"
> When I submit my .jsp with site filled in I get message that the field is required and all the other fields are blanked out.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (WW-2256) Validation broken on autocompleters
Posted by "Benjamin McCann (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/struts/browse/WW-2256?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43429#action_43429 ]
Benjamin McCann commented on WW-2256:
-------------------------------------
Jeromy, thanks for committing the changes to get us closer on the client-side validation. I will try to give these other issues a look too.
> Validation broken on autocompleters
> -----------------------------------
>
> Key: WW-2256
> URL: https://issues.apache.org/struts/browse/WW-2256
> Project: Struts 2
> Issue Type: Bug
> Components: Plugin - Mechanism, Plugin - Tags
> Affects Versions: 2.0.9, 2.1.0
> Environment: Issue identified on Windows XP using Firefox
> Reporter: Benjamin McCann
> Assignee: Jeromy Evans
> Priority: Critical
> Fix For: 2.1.1
>
> Attachments: allFieldsFilledOnSubmit.png, siteEmptyOnSubmit.png, validation.js.patch, validation.js.patch, validation.js.patch
>
>
> I have an autocompleter named "site":
> <s:url id="siteList" action="AutocompleteField" method="selectSite" namespace="/general" />
> <sx:autocompleter label="Site" value="%{system.site}"
> forceValidOption="true"
> cssStyle="width:132px; height:18px; border:1px solid #7B9EBD"
> name="site" required="true" href="%{siteList}"
> loadOnTextChange="true" showDownArrow="false" dropdownWidth="300"
> searchType="substring" />
> It has the following validator:
> <field name="site">
> <field-validator type="requiredstring">
> <message>Field is required</message>
> </field-validator>
> </field>
> When I submit my .jsp without site filled in I get the message: "TypeError: row.cells has no properties"
> When I submit my .jsp with site filled in I get message that the field is required and all the other fields are blanked out.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (WW-2256) Validation broken on autocompleters
Posted by "Benjamin McCann (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/struts/browse/WW-2256?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43425#action_43425 ]
Benjamin McCann commented on WW-2256:
-------------------------------------
Thanks for taking this issue Jeromy. I am really looking forward to getting this patch committed before the first release of 2.1.x comes out.
> Validation broken on autocompleters
> -----------------------------------
>
> Key: WW-2256
> URL: https://issues.apache.org/struts/browse/WW-2256
> Project: Struts 2
> Issue Type: Bug
> Components: Plugin - Mechanism, Plugin - Tags
> Affects Versions: 2.0.9, 2.1.0
> Environment: Issue identified on Windows XP using Firefox
> Reporter: Benjamin McCann
> Assignee: Jeromy Evans
> Priority: Critical
> Fix For: 2.1.4
>
> Attachments: allFieldsFilledOnSubmit.png, siteEmptyOnSubmit.png, validation.js.patch, validation.js.patch, validation.js.patch
>
>
> I have an autocompleter named "site":
> <s:url id="siteList" action="AutocompleteField" method="selectSite" namespace="/general" />
> <sx:autocompleter label="Site" value="%{system.site}"
> forceValidOption="true"
> cssStyle="width:132px; height:18px; border:1px solid #7B9EBD"
> name="site" required="true" href="%{siteList}"
> loadOnTextChange="true" showDownArrow="false" dropdownWidth="300"
> searchType="substring" />
> It has the following validator:
> <field name="site">
> <field-validator type="requiredstring">
> <message>Field is required</message>
> </field-validator>
> </field>
> When I submit my .jsp without site filled in I get the message: "TypeError: row.cells has no properties"
> When I submit my .jsp with site filled in I get message that the field is required and all the other fields are blanked out.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (WW-2256) Validation broken on autocompleters
Posted by "Benjamin McCann (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/struts/browse/WW-2256?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43372#action_43372 ]
Benjamin McCann commented on WW-2256:
-------------------------------------
Why is the fix version 2.1.4?!
It basically already is fixed. The only thing that needs to be done is for the patch to be reviewed and committed. If there's a problem with the patch then let me know.
I know everyone is busy and has their own priorities, but I have to say it's frustrating trying to contribute to a project and then seeing your work ignored for months. This is not a new feature, but is a bug fix!
> Validation broken on autocompleters
> -----------------------------------
>
> Key: WW-2256
> URL: https://issues.apache.org/struts/browse/WW-2256
> Project: Struts 2
> Issue Type: Bug
> Components: Plugin - Mechanism, Plugin - Tags
> Affects Versions: 2.0.9, 2.1.0
> Environment: Issue identified on Windows XP using Firefox
> Reporter: Benjamin McCann
> Priority: Critical
> Fix For: 2.1.4
>
> Attachments: allFieldsFilledOnSubmit.png, siteEmptyOnSubmit.png, validation.js.patch, validation.js.patch
>
>
> I have an autocompleter named "site":
> <s:url id="siteList" action="AutocompleteField" method="selectSite" namespace="/general" />
> <sx:autocompleter label="Site" value="%{system.site}"
> forceValidOption="true"
> cssStyle="width:132px; height:18px; border:1px solid #7B9EBD"
> name="site" required="true" href="%{siteList}"
> loadOnTextChange="true" showDownArrow="false" dropdownWidth="300"
> searchType="substring" />
> It has the following validator:
> <field name="site">
> <field-validator type="requiredstring">
> <message>Field is required</message>
> </field-validator>
> </field>
> When I submit my .jsp without site filled in I get the message: "TypeError: row.cells has no properties"
> When I submit my .jsp with site filled in I get message that the field is required and all the other fields are blanked out.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (WW-2256) Validation broken on autocompleters
Posted by "Benjamin McCann (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/struts/browse/WW-2256?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43391#action_43391 ]
Benjamin McCann commented on WW-2256:
-------------------------------------
I have created another patch taking Jeromy's suggestion into consideration. Thanks for taking the time to look at this and don't hesitate to let me know if you have any concerns.
-Ben
> Validation broken on autocompleters
> -----------------------------------
>
> Key: WW-2256
> URL: https://issues.apache.org/struts/browse/WW-2256
> Project: Struts 2
> Issue Type: Bug
> Components: Plugin - Mechanism, Plugin - Tags
> Affects Versions: 2.0.9, 2.1.0
> Environment: Issue identified on Windows XP using Firefox
> Reporter: Benjamin McCann
> Priority: Critical
> Fix For: 2.1.4
>
> Attachments: allFieldsFilledOnSubmit.png, siteEmptyOnSubmit.png, validation.js.patch, validation.js.patch, validation.js.patch
>
>
> I have an autocompleter named "site":
> <s:url id="siteList" action="AutocompleteField" method="selectSite" namespace="/general" />
> <sx:autocompleter label="Site" value="%{system.site}"
> forceValidOption="true"
> cssStyle="width:132px; height:18px; border:1px solid #7B9EBD"
> name="site" required="true" href="%{siteList}"
> loadOnTextChange="true" showDownArrow="false" dropdownWidth="300"
> searchType="substring" />
> It has the following validator:
> <field name="site">
> <field-validator type="requiredstring">
> <message>Field is required</message>
> </field-validator>
> </field>
> When I submit my .jsp without site filled in I get the message: "TypeError: row.cells has no properties"
> When I submit my .jsp with site filled in I get message that the field is required and all the other fields are blanked out.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.