Opened 10 years ago

Closed 10 years ago

#15975 closed defect (invalid)

Programmatically created DateTextBox is not mirrored

Reported by: ahmedasaleh Owned by: ahmedasaleh
Priority: undecided Milestone: tbd
Component: Dijit - Form Version: 1.8.0
Keywords: Cc:
Blocked By: Blocking:

Description (last modified by bill)

Using the test_dialog.html file to test the BIDI support for the DateTextBox, it found that The mirrored dijit.form.DateTextBox? is not displayed correctly in RTL direction.

Attachments (2)

datetextbox.JPG (39.8 KB) - added by ahmedasaleh 10 years ago.
DateTextBox.js.patch (874 bytes) - added by Douglas Hays 10 years ago.
patch from Hossam Katory (IBM, CCLA)

Download all attachments as: .zip

Change History (8)

Changed 10 years ago by ahmedasaleh

Attachment: datetextbox.JPG added

comment:1 Changed 10 years ago by ahmedasaleh

This problem appears when you apply the dir="rtl" on widget level.

comment:2 Changed 10 years ago by bill

Component: GeneralDijit - Form
Description: modified (diff)
Owner: set to ahmedasaleh
Status: newpending

You'll need to attach your actual test case. You claim there's a bug with programmatic creation of DateTextBox in test_Dialog.html, yet that file does not programmatically create a DateTextBox.

Probably your test is invalid because you didn't specify dir as a parameter to the DateTextBox constructor. The dir attribute in the markup is irrelevant for programmatic creation.

comment:3 Changed 10 years ago by ahmedasaleh

Status: pendingnew

Herein the modification I made inside the file. Just added dir="rtl" for the widjit with id="dialog1".

	<div dir="rtl" id="dialog1" data-dojo-type="dijit/Dialog" data-dojo-props='title:"First Dialog",
			"aria-describedby":"intro",
			onFocus:function(){ console.log("user focus handler") },
			onBlur:function(){ console.log("user blur handler") },
			execute:function(args){ console.log("submitted w/args:\n" + dojo.toJson(args, true)); }'>
		<div id="intro" style="width:30em;">Introductory information spoken by screen reader if aria-describedby is
		added to the declaration of dialog above with value equal to the id of the container element for this text. This technique
		will work in Dojo 1.4. </div>
		<table style="position:relative;">
			<tr>
				<td><label for="name">Name: </label></td>
				<td><input id="name" data-dojo-type="dijit/form/TextBox" data-dojo-props='type:"text", name:"name" '/></td>
			</tr>
			<tr>
				<td><label for="loc">Location: </label></td>
				<td><input id="loc" data-dojo-type="dijit/form/TextBox" data-dojo-props='type:"text", name:"loc" '/></td>
			</tr>
			<tr>
				<td><label for="date">Date: </label></td>
				<td><input id="date" data-dojo-type="dijit/form/DateTextBox" data-dojo-props='type:"text", name:"date" '/></td>
			</tr>
			<tr>
				<td><label>Time: </label></td>
				<td><div id="time" data-dojo-type="dijit/InlineEditBox" data-dojo-props='editor:"dijit.form.TimeTextBox", editorParams:{type:"text", name:"time"}, width:"100px", style:"width:100px;"'></div></td>
			</tr>
			<tr>
				<td><label for="desc">Description: </label></td>
				<td><input id="desc" data-dojo-type="dijit/form/TextBox" data-dojo-props='type:"text", name:"desc" '/></td>
			</tr>
			<tr>
				<td colspan="2" style="text-align:center;">
					<button id="ok" data-dojo-type="dijit/form/Button" data-dojo-props='type:"submit"'>OK</button></td>
			</tr>
		</table>
	</div>

comment:4 Changed 10 years ago by ahmedasaleh

Specifying dir on widjit level should be propagated to the grammatically created widjit. I understand that the current code of the widjit doesn't support that but I think the following code could fix it:

		buildRendering : function() {
			this.inherited(arguments);

			var myDijit = dijit.byId(this);
			var node = dojo.byId(myDijit.id);
			if(node){
				if (node.dir == "rtl") {
					myDijit.set("dir", "rtl");
				}
				
			}
		}

comment:5 Changed 10 years ago by bill

Status: newpending

Where is this programmatically created DateTextBox you keep talking about?

Anyway, as I wrote in your other ticket, programmatically created widgets don't read their parameters from HTML markup, and this is intended behavior.

Changed 10 years ago by Douglas Hays

Attachment: DateTextBox.js.patch added

patch from Hossam Katory (IBM, CCLA)

comment:6 Changed 10 years ago by trac-o-bot

Resolution: invalid
Status: pendingclosed

Because we get so many tickets, we often need to return them to the initial reporter for more information. If that person does not reply within 14 days, the ticket will automatically be closed, and that has happened in this case. If you still are interested in pursuing this issue, feel free to add a comment with the requested information and we will be happy to reopen the ticket if it is still valid. Thanks!

Note: See TracTickets for help on using tickets.