Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#14423 closed defect (fixed)

dojox.mvc.Group prevents dojox.mobile.RoundRectList and dojox.mobile.ListItem select action

Reported by: Eric Wang Owned by: Ed Chatelain
Priority: high Milestone: 1.8
Component: DojoX MVC Version: 1.7.0
Keywords: todoapp Cc:
Blocked By: Blocking:

Description

in dojox.mobile, use dojox.mobile.RoundRectList? select property to do ListItem? select like this:

<ul id="list1" dojoType="dojox.mobile.RoundRectList" select="single">
				<li id="item1" dojoType="dojox.mobile.ListItem" checked="true">
					Cube
				</li>

				<li dojoType="dojox.mobile.ListItem">
					Dissolve
				</li>
				<li dojoType="dojox.mobile.ListItem">
					Ripple
				</li>
			</ul>

but dojox.mvc bind data to ListItem? will add dojox.mvc.Group as the parent of ListItem?, so ListItem? failed to find its original parent and the select action failed. dojox.mvc code:

<ul dojoType="dojox.mobile.RoundRectList" select="single">
			<div data-dojo-type="dojox.mvc.Repeat" data-dojo-props="exprchar:'#', ref:'listsmodel'">
				<div data-dojo-type="dojox.mvc.Group" data-dojo-props="ref: '#{this.index}'">
					<li id="configure_item#{this.index}" class="mblVariableHeight"  label="#{this.index}" dojoType="dojox.mobile.ListItem" checked="true">
					</li>
				</div>
			</div>
		</ul>

Attachments (1)

test_14423-mvc.html (5.6 KB) - added by Ed Chatelain 8 years ago.
This is a testcase to show the problem. Place this file in dojox/mvc/tests to run it. You will see the problems with the selections and the style.

Download all attachments as: .zip

Change History (8)

comment:1 Changed 8 years ago by cjolif

Keywords: todoapp added

Changed 8 years ago by Ed Chatelain

Attachment: test_14423-mvc.html added

This is a testcase to show the problem. Place this file in dojox/mvc/tests to run it. You will see the problems with the selections and the style.

comment:2 Changed 8 years ago by ykami

In [27604]:

Refs #14423 !strict. Added the stopParser feature, which is supported by dojo.parser.

comment:3 Changed 8 years ago by ykami

edchat, not all but part of this problem is use of the stopParser feature in dojox.mvc._Container, which dojo.parser support, but dojox.mobile.parser doesn't. You should be able to avoid the problem by switching the parser to dojo.parser. I didn't have a plan to add the stopParser feature to dojox.mobile.parser to keep its code size small. But I added it since the necessary code was not that big. The remaining problem I think is finding parent and children.

comment:4 Changed 8 years ago by ykami

In [27629]:

Refs #14423 !strict. Workaround to get correct parent/children even when a Repeat node is inserted between list widget and item widget. This code should be removed if better solution is found.

comment:5 Changed 8 years ago by ykami

In [27672]:

Refs #14423 !strict Reverted the workaround code and added a parent check.

comment:6 Changed 8 years ago by Ed Chatelain

Resolution: fixed
Status: newclosed

The solution to this problem is to use the data-dojo-mixin support to mixin the dojox.mvc.Repeat with the dojox.mobile.RoundRectList?, and to not use a dojox.mvc.Group inside the Repeat, like this:

<ul data-dojo-type="dojox.mobile.RoundRectList?" id="repeatId1" select="single"

data-dojo-mixins="dojox.mvc.Repeat" data-dojo-props="exprchar:'#',

ref:'model1.Results'">

<li id="configure_itemmix1#{this.index}" class="mblVariableHeight"

data-dojo-type="dojox.mobile.ListItem?" data-dojo-props="label: dojox.mvc.at('rel:#{this.index}.First', 'value'),

checked: dojox.mvc.at('rel:#{this.index}.Checked', 'value')">

</li>

</ul>

comment:7 Changed 8 years ago by Ed Chatelain

#14427 is a duplicate of this ticket.

Note: See TracTickets for help on using tickets.