Opened 13 years ago

Closed 12 years ago

#10440 closed defect (fixed)

ColorPicker does not work in TooltipDialog

Reported by: Adam Peller Owned by: Jared Jurkiewicz
Priority: high Milestone: 1.5
Component: DojoX Widgets Version: 1.4.0b
Keywords: Cc: bill
Blocked By: Blocking:

Description (last modified by bill)

The ColorPicker appears, but click on something and the color turns to gray. Apparently, this is because measurements are taken in postCreate() where the element is hidden. Bill says measurements should not be taken in postCreate -- apparently they should be done in startup(), though this would require the user to call startup on something which is not a layout container. There is already a startup method, though I'm not sure why it needs to do the value set there.

So we should consider that change, just to follow dijit rules, but I'm not sure this would solve the problem since startup also seems to be called for TooltipDialog content before it is visible. Do we need to consider implementing something like layout()?

Attachments (1)

test_TooltipDialog.html (17.3 KB) - added by Adam Peller 13 years ago.
TooltipDialog test modified to use ColorPicker

Download all attachments as: .zip

Change History (5)

Changed 13 years ago by Adam Peller

Attachment: test_TooltipDialog.html added

TooltipDialog test modified to use ColorPicker

comment:1 Changed 13 years ago by bill

Description: modified (diff)

Well, it needs a resize() method where the layout is done (even though technically there's no size change).

Startup() should call resize(), either all the time or at least when the ColorPicker isn't inside a layout widget.

In #10402 I'm considering passing a flag to startup() about whether or not the child widget is inside a layout widget, that will make it easier.

comment:2 Changed 13 years ago by bill

PS: The reason for the resize() method is that TooltipDialog will call resize() on it's child widgets when it's displayed. (Inherited behavior from ContentPane.)

As for resizing in startup() rather than postCreate(), that's got nothing to do with the problem in this ticket but it should be done anyway so that the following code works:

var cp = new dojox.widget.ColorPicker({});

The sizing code that runs in postCreate() is useless (in the above example) since ColorPicker is not attached to the DOM, and thus can't do sizing calculations.

comment:3 Changed 12 years ago by Adam Peller

Owner: changed from dante to Jared Jurkiewicz

comment:4 Changed 12 years ago by Jared Jurkiewicz

Resolution: fixed
Status: newclosed

(In [21338]) Fixing the ColorPicker? to work inside the dijit TooltipDialog? (and other popups.) fixes #10440

Note: See TracTickets for help on using tickets.