| Summary: | [Text] Support setMessage with SWT.MULTI style | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [RT] RAP | Reporter: | Claudio Guglielmo <claudio.guglielmo> | ||||
| Component: | RWT | Assignee: | Project Inbox <rap-inbox> | ||||
| Status: | RESOLVED FIXED | QA Contact: | |||||
| Severity: | enhancement | ||||||
| Priority: | P3 | CC: | tbuschto | ||||
| Version: | 1.5 | ||||||
| Target Milestone: | 2.1 M1 | ||||||
| Hardware: | PC | ||||||
| OS: | Windows 7 | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
This is done by design to respect the SWT behavior. There is no message displayed in SWT when Text is created with SWT.MULTI (at least on Windows). Ralf, could you check on GTK? No, the message is not displayed for MULTI texts in GTK. But it seems that this is GTK behavior, as there are no checks for the style in the SWT code and the exception is not documented. I currently don't see a good reason not to display the placeholder texts in multiline text fields. Are there any? I can't think of any. Me too. I changed the severity to enhancement as there is not different behavior between RAP and SWT. Fixed in master with commit a170b016890f6d27168e2b5aa9d02dbb94726490. |
Created attachment 225348 [details] example On text fields with style set to SWT.SINGLE, setting a message works fine. On text fields with style set to SWT.MULTI, no message is displayed. In Text.js there is a check which excludes textareas when setting the message, obviously it's done by purpose. But why? If I remove the check the message gets displayed, even in IE 7. Is there a reason for this check? It would be great if the message was displayed for textareas too. After removing the check the message gets displayed, but in the middle of the field. To make it look better, I changed the code in _layoutMessage() a little so that it will be moved to the top. Btw: Have you ever considered using the html 5 placeholder attribute instead of creating a custom div (at least for the modern browsers)? I think it may be a very little faster. See also the attached example.