Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 363932 - Alert in new HelloWorld sample needs fixing
Summary: Alert in new HelloWorld sample needs fixing
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: EDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P1 normal (vote)
Target Milestone: ---   Edit
Assignee: Xiao Bin Chen CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-16 11:04 EST by broy2 CLA
Modified: 2017-02-23 14:17 EST (History)
1 user (show)

See Also:


Attachments
RBD (80.31 KB, image/png)
2011-11-16 11:04 EST, broy2 CLA
no flags Details
EDT (83.79 KB, image/png)
2011-11-16 11:05 EST, broy2 CLA
no flags Details
Patch for this defect (1.07 KB, text/plain)
2011-11-23 21:25 EST, Xiao Bin Chen CLA
xiaobinc: iplog+
xiaobinc: review?
Details

Note You need to log in before you can comment on or make changes to this bug.
Description broy2 CLA 2011-11-16 11:04:22 EST
Created attachment 207099 [details]
RBD

The title in the alert of the HelloWorld sample overlaps the close icon.
The title in the alert when run in RBD is Alert and doesn't overlap the close icon.
The title when run in EDT is HelloWorldView and overlaps the close icon.
Screen shots of RBD and EDT attached.
Comment 1 broy2 CLA 2011-11-16 11:05:16 EST
Created attachment 207100 [details]
EDT
Comment 2 Lisa Lasher CLA 2011-11-16 16:35:55 EST
Please try to fix this by Monday, as it is very visible to users.
Comment 3 Will Smythe CLA 2011-11-16 16:44:06 EST
This bug is not specific to the Hello World example. It will occur anytime the message being displayed in a Dojo Dialog is shorter than the title text.

Agree this needs to get fixed.

I would think the Dojo dialog widget would account for this and increase the width of the dialog such that the title wouldn't get cut off. I would check the Dojo docs and see what it recommends.
Comment 4 Xiao Bin Chen CLA 2011-11-17 00:24:57 EST
Fixed.
Comment 5 broy2 CLA 2011-11-18 09:44:01 EST
Verified in 20111118.
Comment 6 broy2 CLA 2011-11-21 15:39:56 EST
I'm on the 20111121 build.
Type abc for the name and click Go.
The title overlaps the close icon.

It seems to depend on the name entered.
When I enter brenda, the title is OK.
Comment 7 Xiao Bin Chen CLA 2011-11-21 20:07:23 EST
fixed, adding the length of 'x' image consideration.
Comment 8 Xiao Bin Chen CLA 2011-11-21 20:28:50 EST
Tested below input:
a
ab
abc
abcd
abcde
abcdef
abcdefg

And it works correctly, if it does not works in your machine,please reopen it.
Comment 9 broy2 CLA 2011-11-22 10:01:59 EST
Verified in 20111122 build.
Comment 10 Will Smythe CLA 2011-11-23 10:29:16 EST
The current fix/implementation is not going to hold up in the scenario where the developer supplies a long (based on character length) message string, but the string (when rendered in the dialog) is not wider than the title. For example:

DojoDialogLib.showMessage("States", "AZ<br>CO<br>NM<br>VT", null);

This again causes the title to overrun the close X since the title string ("States") is shorter - based on string length - than the message string.

One logical solution is to avoid trying to compare the title and message string lengths when determining the width, since string length does not equate to the width of the string on the dialog. CSS has a "min-width" attribute that allows the browser to make a better decisions on the width of the dialog (in contrast to setting).

I replaced the current logic with the following line:
dialog.style = "min-width: " + title.length() + "em";

Note the dialog's minimum width is determined by the title's length (and only the title's length).
Comment 11 Will Smythe CLA 2011-11-23 10:31:06 EST
Here is an example where the current solution fails:

DojoDialogLib.showMessage("States", "AZ<br>CO<br>NM<br>VT", null);
Comment 12 Xiao Bin Chen CLA 2011-11-23 21:25:26 EST
Created attachment 207455 [details]
Patch for this defect
Comment 13 Xiao Bin Chen CLA 2011-11-23 21:34:24 EST
(In reply to comment #12)
> Created attachment 207455 [details]
> Patch for this defect


Test below case:
Title:
"t"
a
<br>a
ab
abc


"States'

a
ab
abc
abcd
abcde
AZ<br>CO<br>NM<br>VT
a<br>
a<br>a<br>
Comment 14 Xiao Bin Chen CLA 2011-11-23 22:05:14 EST
Resolved.
Comment 15 broy2 CLA 2011-11-29 13:23:01 EST
Verified in 20111129 build.