[Dojo-interest] Dojo 1.5 -> 1.6 migration: FilteringSelect+QueryReadStore broken

126 views
Skip to first unread message

Victor Danilchenko

unread,
Aug 25, 2011, 6:04:54 PM8/25/11
to dojo-i...@dojotoolkit.org
Hi guys,

I am trying to migrate my application from 1.5 to 1.6, the I am having
trouble with a custom QueryReadStore. It works fine in 1.5, but doesn't
send any queries in 1.6, logs nothing useful to the console, and
basically just sits there, inert.

I looked over the docs and release notes, but found nothing. The JS
file which implements this custom control -- a username selector -- can
be seen at
http://demo.askonline.net/js-lib/askonline/base/UserInterface/UnamePicker.js
. The corresponding HTML tag may look as follows:

<input id="to_users"
class="uname-select"
account_type="6"
unameSelectedCallback="uname_entered"
title="Please type in a username and press 'Return'"
blankPadding="1"/>

The server-side stuff doesn't matter. Under Dojo 1.6, the
FilteringSelect simply does nothing, no queries go over the wire,
nothing. If i could simply get it to query, I can take it from there.

I am just totally stumped... it looks like nothing which should have
affected this code, changed from 1.5 to 1.6!

Can someone perhaps help me with some advice perhaps? I put together a
quick demo, two pages -- identical code, just loads different Dojo
versions, so you can see how my FilteringSelect works under 1.5 but not 1.6:

http://demo.askonline.net/uname-picker-dojo1.5.html
http://demo.askonline.net/uname-picker-dojo1.6.html

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

Dojo-i...@mail.dojotoolkit.org
http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest

Jamey Graham

unread,
Aug 25, 2011, 10:21:48 PM8/25/11
to dojo-i...@mail.dojotoolkit.org
not sure how this worked in 1.5, but add a this.inherited(arguments) to askonline.UnameComboBox.postCreate().  There's a bunch of stuff that happens in _HasDropDown's postCreate() that you're currently not calling.


From: Victor Danilchenko <vic...@askonline.net>
To: dojo-i...@dojotoolkit.org
Sent: Thursday, August 25, 2011 6:04 PM
Subject: [Dojo-interest] Dojo 1.5 -> 1.6 migration: FilteringSelect+QueryReadStore broken

Victor Danilchenko

unread,
Aug 26, 2011, 8:29:26 AM8/26/11
to dojo-i...@mail.dojotoolkit.org, dojo-i...@dojotoolkit.org
So I did some more digging, and realized it's because of my postCreate
message. My override method was:

postCreate: function () {
this.displayMessage(uname_postdisplay_message);
}

I was missing the call to parent's postCreate:

postCreate: function () {
var retval = this.inherited("postCreate", arguments);
this.displayMessage(uname_postdisplay_message);
return retval;
}

However, for some weird reason, the displayMessage method -- the reason
why I overrode the postCreate in the first place -- doesn't in fact
display as the tooltip with my message.

The displaymessage text simply, silently, doesn't display. I tried
displaying it from elsewhere, hanging it on a setTimeout call, I
explicitly included dijit.Tooltip -- nothing.

Has something changed about the displayMessage implementation? I didn't
see anything in the docs...

--
Victor Danilchenko
Senior Software Engineer, AskOnline.net
vic...@askonline.net - 617-273-0119

Bill Keese

unread,
Aug 26, 2011, 10:30:24 AM8/26/11
to dojo-i...@mail.dojotoolkit.org
You lost me, you were talking about QueryReadStore before.   Surely that doesn't have methods like postCreate() and displayMessage()?

Victor Danilchenko

unread,
Aug 26, 2011, 11:05:57 AM8/26/11
to dojo-i...@mail.dojotoolkit.org, Bill Keese
On 8/26/11 10:30 AM, Bill Keese wrote:
> You lost me, you were talking about QueryReadStore before. Surely that
> doesn't have methods like postCreate() and displayMessage()?

Yeah, that was my bad, I should have been more clear -- the problem was
seemingly the combination of FilteringSelect and QueryReadStore. I
resolved one problem, and ran into another.

What messed up the query call was the bad postCreate method in my
FilteringSelect subclass -- it worked under 1.5 but broke under 1.6; so
apparently the FilteringSelect widget got its UI initialized, but never
set up the datastore properly. Once I fixed the postCreate problem, the
querying worked, but the displayMessage didn't.

displayMessage was the very reason I overrode postCreate in the first
place. The UI functionality of this widget is unobvious, and we are
dealing with a lot of transient users, so I wanted the widget to display
a tooltip on initialization. Well, displayMessage used to do just that
-- and now it doesn't.

I am currently working around this by using an actual tooltip and
forcibly displaying it on page load:

new dijit.Tooltip({
connectId: [iNode.id],
label: uname_postdisplay_message
}).open(selector.domNode);

However, this solution is more complicated, and actually worse from the
UI PoV. The tooltip tends to cover up other UI elements, and the
information in the tooltip simple enough to need being displayed only
once (i.e. "you can type here"). Regular, popup-on-hover tooltip is too
intrusive.

So my choices ATM are either get the displayMessage to work right, or
pile on more cruft to make the tooltip behave as a one-time message,
e.g. by making its popup delay stupidly huge.

I would really prefer for the FilteringSelect.displayMessage to just
work, the way it used to under 1.5.

> vic...@askonline.net <mailto:vic...@askonline.net> - 617-273-0119


> ________________________________________________________
> Dojotoolkit: http://dojotoolkit.org
> Reference Guide: http://dojotoolkit.org/reference-guide
> API Documentation: http://dojotoolkit.org/api
> Tutorials: http://dojotoolkit.org/documentation
>
> Dojo-i...@mail.dojotoolkit.org

> <mailto:Dojo-i...@mail.dojotoolkit.org>
> http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest

Ben Hockey

unread,
Aug 26, 2011, 11:21:10 AM8/26/11
to dojo-i...@mail.dojotoolkit.org, Bill Keese
Sounds like you want to use the placeholder property to display a prompt to the user when no value is selected.

ben...



Sent from my Palm Pre on AT&T


Victor Danilchenko

unread,
Aug 26, 2011, 1:52:17 PM8/26/11
to dojo-i...@mail.dojotoolkit.org
On 8/26/11 11:21 AM, Ben Hockey wrote:
> Sounds like you want to use the placeholder property to display a prompt
> to the user when no value is selected.

Thanks. A combination of placeHolder and promptMessage seems to be an
even better UI solution than my original displayMessage prompt.

Reply all
Reply to author
Forward
0 new messages