Opened 12 years ago

Closed 12 years ago

Last modified 8 years ago

#5280 closed defect (fixed)

ValidationTextBox adds modifies value of textbox name, causes makes struts unhappy

Reported by: ialpert Owned by: Douglas Hays
Priority: high Milestone: 1.1
Component: Dijit - Form Version: 1.0
Keywords: Cc:
Blocked By: Blocking:

Description

This is probably a very particular problem, dont know how valueable it is to fix.

Background Struts (1.3.x) uses the name field to parse out objects from the incoming form. usually not finding an object isn't a problem, it just retuns null in the objects place. However if the object is part of a graph it will do lookups based in the form fieldName[X].anotherFieldName[Y].attributeName (where fieldName can be as nested as you want it to be and attributeName doesn't necessarly have to exist).

Because the ValidationTextBox? adds an "_" to the begginning of the input name the struts code can't do object graph look ups and throws exceptions. A simple solution would be to just not have the preceding "_".

The odd thing is that in firefox this problem never occures, i presume because node.removeAttribute("name") has different effects in IE and Firefox.

ValidationTextBox?.js {{{ this.textbox.name = "_" + this.textbox.name + "_displayed_";

this.textbox.removeAttribute("name");}}}

Change History (9)

comment:1 Changed 12 years ago by Adam Peller

Component: GeneralDijit
Owner: changed from anonymous to Douglas Hays
Reporter: changed from guest to ialpert

comment:2 Changed 12 years ago by Douglas Hays

Milestone: 1.1

Investigating...

comment:3 Changed 12 years ago by Douglas Hays

Resolution: fixed
Status: newclosed

Does anyone know why the preceding "_" causes problems? It is a valid starting identifier in java, c, c++, and javascript. Sounds more like a problem ticket with struts should be opened instead.

comment:4 Changed 12 years ago by Douglas Hays

Resolution: fixed
Status: closedreopened

comment:5 Changed 12 years ago by Douglas Hays

Resolution: invalid
Status: reopenedclosed

comment:6 Changed 12 years ago by Adam Peller

Don't know why struts chooses to be so particular, but Section 6.2 in the html4 spec does say that ID and NAME must start with a letter, so I guess the right thing to do is to add a suffix only.

comment:7 Changed 12 years ago by Douglas Hays

Resolution: invalid
Status: closedreopened

comment:8 Changed 12 years ago by Douglas Hays

Resolution: fixed
Status: reopenedclosed

(In [11953]) Fixes #5280. Removed _ prefix from the validation textbox name field.

comment:9 Changed 8 years ago by bill

Component: DijitDijit - Form
Note: See TracTickets for help on using tickets.