Opened 8 years ago

Closed 7 years ago

#17799 closed defect (patchwelcome)

InlineEditBox returns the wrong value on Select-widget (or MappedTextBox-widgets)

Reported by: overtune Owned by:
Priority: undecided Milestone: 1.13
Component: Dijit Version: 1.9.3
Keywords: Cc:
Blocked By: Blocking:



I'm not really shure if this is a bug, but it is a bit of problematic...

If you create an InlineEditBox? with a Select. On the onChange-event for the InlineEditBox?, the value returned are the label of the Select and not the value.

See here, it's easier to show:

Even if the InlineEditBox? needs the displayValue, it would really be usefull to also get the "real" value (maybe as a second argument)?

Perhaps I can take a look at the code in next week, but I would first like to get a second opinion, or perhaps if someone knows a way to do this...

Change History (4)

comment:1 Changed 8 years ago by overtune

I may have a solution, not sure if it's perfect though... In dijit/InlineEditBox.js in the function "_setValueAttr" (row 596), I have changed the line 609 from this:


to this:

// Return both displayedValue and value.
this.onChange(val, this.wrapperWidget.editWidget.get("value"));

So I return two arguments, both the "displayedValue" and the "real" value. In most widgets these two values are the same. But on some widgets (like the Select) they will differ.

comment:2 Changed 8 years ago by bill

I wouldn't call the current behavior a bug, but I guess we could implement your change as an enhancement.

comment:3 Changed 8 years ago by overtune

No, perhaps not a "real" bug. But still, if you use the InlineEditBox? with a Select, you can't get the value of the Select, just the label. Which makes it really hard to use in an application where you need to save the "real" value to the server.

I'm not entirely sure if my modification will have any sideeffects. But hopefully it should be able to add it without affecting anything else.

comment:4 Changed 7 years ago by dylan

Milestone: tbd1.12
Resolution: patchwelcome
Status: newclosed

Given that no one has shown interest in creating a patch in more than a year, I'm closing this as patchwelcome. Please let us know if you would like to get involved in helping make this change to Dojo!

Note: See TracTickets for help on using tickets.