Opened 9 years ago

Closed 9 years ago

Last modified 8 years ago

#10477 closed defect (fixed)

CurrencyTextBox: currency symbol does not change upon change of the currency property

Reported by: Jean-Rubin Leonard Owned by: Douglas Hays
Priority: high Milestone: 1.5
Component: Dijit - Form Version: 1.4.0b
Keywords: CurrencyTextBox currency symbol remains unchanged Cc:
Blocked By: Blocking:

Description

Hi, As per Bill (wildbill) Keese's answer to my post on dojo-interest : "Sounds like a bug. Looking at the code I see that this.currency is reference from postCreate() rather than a _setCurrencyAttr() method, which is surely the problem (why changing currency after creation isn't working).

So, please file a ticket." Bill's answer says it all. When setting the currency at creation time, the currency symbol is what it's supposed to be but any later change to the currency attribute of the cTB leaves the currency symbol whereas it should change to match the currency. Thanks for correcting. Test case attached.

Attachments (3)

currenctyTextBox.zip (3.7 KB) - added by Jean-Rubin Leonard 9 years ago.
10477.patch (4.9 KB) - added by Douglas Hays 9 years ago.
marked currency as const and added attr('constraints', object) API, and added automated tests
10477.2.patch (5.1 KB) - added by Douglas Hays 9 years ago.
after initial feedback, renamed postCreate in RangeBoundTextbox? and postMixInProperties in CurrencyTextBox? and NumberTextbox? to _setConstraintsAttr

Download all attachments as: .zip

Change History (14)

Changed 9 years ago by Jean-Rubin Leonard

Attachment: currenctyTextBox.zip added

comment:1 Changed 9 years ago by bill

Owner: set to Douglas Hays
Summary: CurrencyTextBox currency symbol does not change upon change of the currency propertyCurrencyTextBox: currency symbol does not change upon change of the currency property

comment:2 Changed 9 years ago by Douglas Hays

Milestone: tbd1.5

comment:3 Changed 9 years ago by Cormac Flynn

This issue is currently a serious blocking issue for our application - do you know if theres a workaround that could be used until 1.5 arrives? Thanks in advance!

Changed 9 years ago by Douglas Hays

Attachment: 10477.patch added

marked currency as const and added attr('constraints', object) API, and added automated tests

comment:4 Changed 9 years ago by Douglas Hays

bill, please review the attached patch

Changed 9 years ago by Douglas Hays

Attachment: 10477.2.patch added

after initial feedback, renamed postCreate in RangeBoundTextbox? and postMixInProperties in CurrencyTextBox? and NumberTextbox? to _setConstraintsAttr

comment:5 Changed 9 years ago by Douglas Hays

Resolution: fixed
Status: newclosed

(In [21359]) Fixes #10477 !strict. Marked CurrencyTextBox::currency as const and added attr('constraints',object) API to ValidationTextBox? and subclasses, and added automated tests. Moved constraints processing from postMixinProperties and postCreate methods into _setConstraintsAttr methods.

comment:6 Changed 9 years ago by bill

Resolution: fixed
Status: closedreopened

Something about [21359] is breaking DateTextBox, in test_DateTextBox.html in the firebug console if you type

dijit.byId("german").attr("value")

it returns undefined, rather than the date it should return.

comment:7 Changed 9 years ago by Douglas Hays

Resolution: fixed
Status: reopenedclosed

(In [21385]) Fixes #10477 !strict. Must call _setConstraintsAttr from postMixInProperties since _set*Attr methods can be dependent on this.constraints

comment:8 Changed 9 years ago by Jean-Rubin Leonard

Resolution: fixed
Status: closedreopened

Hi, I updated my trunks and that issue does not seem to be resolved. I am still not getting the currency symbol updated.

comment:9 Changed 9 years ago by Douglas Hays

Resolution: fixed
Status: reopenedclosed

If you run dijit/tests/form/robot/test_validate.html with the latest trunk, there is a test at the very end that changes the currency symbol using

textWidget.attr('constraints', {currency:'USD', locale:'en-us'});

This test correctly runs and changes the test's currency symbol from Euro to "$". If you cannot get this to work, then please reopen after attaching a testcase using attr('constraints',blah).

comment:10 Changed 9 years ago by Jean-Rubin Leonard

My bad. I wasn't using attr('constraints',blah) was going with straight attr.('blah')

comment:11 Changed 8 years ago by bill

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