dojox/mobile EdgeToEdgeList and scrolling questions

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

dojox/mobile EdgeToEdgeList and scrolling questions

Ken Benjamin
Two questions for your mobile gurus:

First, I'm use 1.8rc2.

When you have an EdgeToEdgeList with moveTo links, how can you make scrolling through a longer list work well without the user instantly being taken to the moveTo location?

Second, does anyone know a method to force the browser to scroll to the top of the page on change of View? I'd take any suggestion, dojo-based or not.

Thanks,
Ken

Kenneth Benjamin

Web Application Architect for Hire

Reply | Threaded
Open this post in threaded view
|

Re: dojox/mobile EdgeToEdgeList and scrolling questions

Ken Benjamin
I found an answer to #2. Still could use some suggestions on reducing click sensitivity on EdgeToEdgeList.

Ken Benjamin wrote
Two questions for your mobile gurus:

First, I'm use 1.8rc2.

When you have an EdgeToEdgeList with moveTo links, how can you make scrolling through a longer list work well without the user instantly being taken to the moveTo location?

Second, does anyone know a method to force the browser to scroll to the top of the page on change of View? I'd take any suggestion, dojo-based or not.

Thanks,
Ken

Kenneth Benjamin

Web Application Architect for Hire

Reply | Threaded
Open this post in threaded view
|

Re: dojox/mobile EdgeToEdgeList and scrolling questions

Adrian Vasiliu
Hi,

> I found an answer to #2. Still could use some suggestions on reducing click
> sensitivity on EdgeToEdgeList.

Starting with Dojo 1.8, there is a delay of 100 ms before selecting an item - to avoid that items get selected just because of scrolling actions. This seems to work fine. However, there seems to be indeed a trouble with the triggering of the transition, and this trouble seems new in Dojo 1.8.
I would suggest that you enter a defect at trac.dojotoolkit.org...

Adrian

________________________________________________________
Dojotoolkit: http://dojotoolkit.org
Reference Guide: http://dojotoolkit.org/reference-guide
API Documentation: http://dojotoolkit.org/api
Tutorials: http://dojotoolkit.org/documentation

[hidden email]
http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
Reply | Threaded
Open this post in threaded view
|

Re: dojox/mobile EdgeToEdgeList and scrolling questions

Ken Benjamin
Thanks, Adrian.

I'll put the bug report in even though I wound up overriding the transition mechanism entirely.

Is ListItem moveTo supposed to work differently than say the back button on Heading?

I'm just getting started with the mobile widgets and to my mind, the ListItem transition should be to a View (at least it is in my app) but are there scenarios where people transition to something else? If not, then shouldn't there be a single standard way of switching views?

The little bit I've worked with dojox/mobile, I find it somewhat inconsistent.


Adrian Vasiliu wrote
Hi,

> I found an answer to #2. Still could use some suggestions on reducing
click
> sensitivity on EdgeToEdgeList.

Starting with Dojo 1.8, there is a delay of 100 ms before selecting an item
- to avoid that items get selected just because of scrolling actions. This
seems to work fine. However, there seems to be indeed a trouble with the
triggering of the transition, and this trouble seems new in Dojo 1.8.
I would suggest that you enter a defect at trac.dojotoolkit.org...

Adrian

________________________________________________________
Dojotoolkit: http://dojotoolkit.org
Reference Guide: http://dojotoolkit.org/reference-guide
API Documentation: http://dojotoolkit.org/api
Tutorials: http://dojotoolkit.org/documentation

[hidden email]
http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest

Kenneth Benjamin

Web Application Architect for Hire

Reply | Threaded
Open this post in threaded view
|

Re: dojox/mobile EdgeToEdgeList and scrolling questions

Adrian Vasiliu
> to my mind, the ListItem transition should be to a View (at least it is in my app) but are
> there scenarios where people transition to something else? 

Always to a View. The property "moveTo" of the items is documented as "the id of the transition destination view" (see _ItemBase.moveTo).

> Is ListItem moveTo supposed to work differently than say the back button on Heading? 
> [...]  I find it somewhat inconsistent.

Both ListItem and the back button are subclasses of _ItemBase. In both cases the view transition goes through _ItemBase.defaultClickAction which calls _ItemBase.makeTransition. This creates and dispatches a TransitionEvent. At least if we refer to the transition from a ListItem having a "moveTo" compared with the transition using the back button in a Heading, the default transition mechanism is similar (for my eyes). 

Adrian

________________________________________________________
Dojotoolkit: http://dojotoolkit.org
Reference Guide: http://dojotoolkit.org/reference-guide
API Documentation: http://dojotoolkit.org/api
Tutorials: http://dojotoolkit.org/documentation

[hidden email]
http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
Reply | Threaded
Open this post in threaded view
|

Re: dojox/mobile EdgeToEdgeList and scrolling questions

Ken Benjamin
Hmm. Yes, I see you are correct.

I think my confusion started with using View and, initially, though I'm no longer using, SwapView.

The transition mechanism in View, performTransition(), relies on pub/sub messaging whereas TransitionEvent (which is what _ItemBase calls) uses on.emit methods.

In ListItem onClick / moveTo there are no topics published on those transitions vs. ones called with View.performTransition().

In the end, View.performTransition() runs nearly identical code to what TransitionEvent does (though View does not use TransitionEvent or _ItemBase at all). Both end up in dojox/css3/transit via a check on the dojo config settings.

My 2 cents: All View transitions should go through View.performTransition(). The extra functionality provided is helpful and appropriate to any View transition events in a number of ways, not just the topic publication.

By the way, thanks for pointing out my error to me as I'm logging view swaps via pub/sub for usage analysis and I'm missing all the back button hits. Yet another bit of code to overload, or so it seems.

Adrian Vasiliu wrote
> to my mind, the ListItem transition should be to a View (at least it is
in my app) but are
> there scenarios where people transition to something else?

Always to a View. The property "moveTo" of the items is documented as "the
id of the transition destination view" (see _ItemBase.moveTo).

> Is ListItem moveTo supposed to work differently than say the back button
on Heading?
> [...]  I find it somewhat inconsistent.

Both ListItem and the back button are subclasses of _ItemBase. In both
cases the view transition goes through _ItemBase.defaultClickAction which
calls _ItemBase.makeTransition. This creates and dispatches a
TransitionEvent. At least if we refer to the transition from a ListItem
having a "moveTo" compared with the transition using the back button in a
Heading, the default transition mechanism is similar (for my eyes).

Adrian

________________________________________________________
Dojotoolkit: http://dojotoolkit.org
Reference Guide: http://dojotoolkit.org/reference-guide
API Documentation: http://dojotoolkit.org/api
Tutorials: http://dojotoolkit.org/documentation

[hidden email]
http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest

Kenneth Benjamin

Web Application Architect for Hire

Reply | Threaded
Open this post in threaded view
|

Re: dojox/mobile EdgeToEdgeList and scrolling questions

Adrian Vasiliu
My 2 cents: All View transitions should go through View.performTransition(). 

Well, for both the ListItem and for the back button, it does go through View.performTransition. The dispatching of the TransitionEvent emits a "startTransition" which is received by the ViewController which calls View.performTransition.
Now, it's true that the case of SwapView is somehow different, I guess because it needs to combine the mechanisms of its two superclasses, View and ScrollableMixin. 

All in one, I think there is already some level of consistency, and I tend to agree there could be even more consistency ;-)

Adrian

________________________________________________________
Dojotoolkit: http://dojotoolkit.org
Reference Guide: http://dojotoolkit.org/reference-guide
API Documentation: http://dojotoolkit.org/api
Tutorials: http://dojotoolkit.org/documentation

[hidden email]
http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
Reply | Threaded
Open this post in threaded view
|

Re: dojox/mobile EdgeToEdgeList and scrolling questions

Ken Benjamin
Aha! I see now.

It's definitely hard to follow the flow in Mobile sometimes.

Now I also see that some of my efforts, especially those based on what I learned in SwapView, are problematic. I need to go back and see why I wasn't getting topic notifications on ListItem and (some) Back buttons. I'm relying on them for certain things.

Thanks for all your help,
Ken

Adrian Vasiliu wrote
> My 2 cents: All View transitions should go through
View.performTransition().

Well, for both the ListItem and for the back button, it does go through
View.performTransition. The dispatching of the TransitionEvent emits a
"startTransition" which is received by the ViewController which calls
View.performTransition.
Now, it's true that the case of SwapView is somehow different, I guess
because it needs to combine the mechanisms of its two superclasses, View
and ScrollableMixin.

All in one, I think there is already some level of consistency, and I tend
to agree there could be even more consistency ;-)

Adrian

________________________________________________________
Dojotoolkit: http://dojotoolkit.org
Reference Guide: http://dojotoolkit.org/reference-guide
API Documentation: http://dojotoolkit.org/api
Tutorials: http://dojotoolkit.org/documentation

[hidden email]
http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest

Kenneth Benjamin

Web Application Architect for Hire

Reply | Threaded
Open this post in threaded view
|

Re: dojox/mobile EdgeToEdgeList and scrolling questions

vgkotha
This post has NOT been accepted by the mailing list yet.
In reply to this post by Ken Benjamin
Hi,

I tried as below. I don't know is it right way or not but i am getting  scrolling for EdgetoEdgeList when long list items in the list
<div data-dojo-type="dojox.mobile.View" id="View1">
                <div data-dojo-type="dojox.mobile.Heading" data-dojo-props='label:"Asset View", back:"Brief", moveTo:"View"'></div>
                <div data-dojo-type="dojox.mobile.ScrollableView">
                       

Contact Details

                        <ul data-dojo-type="dojox.mobile.EdgeToEdgeList">
                          <li data-dojo-type="dojox.mobile.ListItem" data-dojo-props='rightText:"abc' style="font-size: small">A</li>
                          <li data-dojo-type="dojox.mobile.ListItem" data-dojo-props='rightText:"abc' style="font-size: small">B</li>
                          <li data-dojo-type="dojox.mobile.ListItem" data-dojo-props='rightText:"abc' style="font-size: small">c</li>
                                <li data-dojo-type="dojox.mobile.ListItem" data-dojo-props='rightText:"abc' style="font-size: small">d</li>
                                <li data-dojo-type="dojox.mobile.ListItem" data-dojo-props='rightText:"abc' style="font-size: small">e</li>
                                <li data-dojo-type="dojox.mobile.ListItem" data-dojo-props='rightText:"abc' style="font-size: small">f</li>
                                <li data-dojo-type="dojox.mobile.ListItem" data-dojo-props='rightText:"abc' style="font-size: small">g</li>
                                <li data-dojo-type="dojox.mobile.ListItem" data-dojo-props='rightText:"abc' style="font-size: small">h</li>
                                <li data-dojo-type="dojox.mobile.ListItem" data-dojo-props='rightText:"abc' style="font-size: small">i</li>
                                <li data-dojo-type="dojox.mobile.ListItem" data-dojo-props='rightText:"abc' style="font-size: small">j</li>
                                <li data-dojo-type="dojox.mobile.ListItem" data-dojo-props='rightText:"abc' style="font-size: small">k</li>
                                <li data-dojo-type="dojox.mobile.ListItem" data-dojo-props='rightText:"abc' style="font-size: small">l</li>
                                <li data-dojo-type="dojox.mobile.ListItem" data-dojo-props='rightText:"abc' style="font-size: small">m</li>
                                <li data-dojo-type="dojox.mobile.ListItem" data-dojo-props='rightText:"abc' style="font-size: small">n</li>
                                <li data-dojo-type="dojox.mobile.ListItem" data-dojo-props='rightText:"abc' style="font-size: small">o</li>
                                <li data-dojo-type="dojox.mobile.ListItem" data-dojo-props='rightText:"abc' style="font-size: small">p</li>
                                <li data-dojo-type="dojox.mobile.ListItem" data-dojo-props='rightText:"abc' style="font-size: small">q</li>
                                <li data-dojo-type="dojox.mobile.ListItem" data-dojo-props='rightText:"abc' style="font-size: small">r</li>
                                <li data-dojo-type="dojox.mobile.ListItem" data-dojo-props='rightText:"abc' style="font-size: small">s</li>
                                <li data-dojo-type="dojox.mobile.ListItem" data-dojo-props='rightText:"abc' style="font-size: small">t</li>
                                <li data-dojo-type="dojox.mobile.ListItem" data-dojo-props='rightText:"abc' style="font-size: small">u</li>
                        </ul>
                </div>
</div>

Thank you

Venugopal