#9517 closed defect (fixed)
ComboBox does dropdown with Rest Store on Safari 4.0
Reported by: | vlad | Owned by: | Kris Zyp |
---|---|---|---|
Priority: | high | Milestone: | 1.4 |
Component: | DojoX Data | Version: | 1.3.1 |
Keywords: | combobox, filteringSelect, restStore | Cc: | |
Blocked By: | Blocking: |
Description
using trunk (latest) dojo
the combo box simply does not work. Nothing gets dropped down, no error no anything.
To replicate the problem you need the attached simple HTML (a php file) and a Rest Store backend. The backend is also also a php file that simply returns '[]' So one-liner backend can be done in any language, very simple.
Just click on the add button, it will add items to the store. Then go to combo box pull down -- and you will see that on Safari 4.0 nothing happens (I am running PC version of safari 4.0)
On other browsers, you will get a pull down, but also you will receive an error in ServiceStore?
defResult.ioArgs is undefined defResult.ioArgs.xhr.abort();
This is a separate bug, and I am entering separate issue for it, using the same test case.
Attachments (4)
Change History (10)
Changed 12 years ago by
Attachment: | REST_STORE_1.php added |
---|
Changed 12 years ago by
Attachment: | json_rest_store_backend.php added |
---|
php file returning an empty json array [] (needed for rest store)
comment:1 Changed 12 years ago by
just a note that the bug related to errors within Rest Stores and combo box (that uses the same attached files to reproduce) is http://bugs.dojotoolkit.org/ticket/9518
comment:2 Changed 12 years ago by
This is a pretty big test case, and there are a lot of things I don't understand about it. Can you make a simpler test case? I simplified it but after hitting the add button I query the store, like below:
testStore.fetch({onComplete: function(ary){ console.log(ary); } });
I don't see any data in the store.
Things I'm unclear about:
- your faux server json_rest_store_backend.php doesn't persist the items that the client is presumably sending to it via POST calls... how is that supposed to work? Is it depending on ClientFilter to do caching on the client?
- the query specified to FilteringSelect:
query="{ id: '*' }"
isn't in the right format for PersevereStore, is it?
Changed 12 years ago by
Attachment: | FILT_SELECT_REST_PROB_1.php added |
---|
FilteringSelect? on Safari test case
Changed 12 years ago by
Attachment: | json_rest_store_backend_some_itms.php added |
---|
updated backend store script, uncomment the line that echos at least one item to see Filtering Select working on Safari 4
comment:3 Changed 12 years ago by
Hi, thank you for looking at the issue so quickly. Sorry, the test case was a bit more than it needed to be.
I simplified it a lot.
a) removed or border containers stuff
b) changed to JsonRestStore? (not perserver anymore)
c) I left just one Grid in to show that the Grid works fine with the same store.
d) and this is probably the most important discovery that I made today. The Filtering Select works on safari 4.0 when initially there was at least one item in the store. It does not work only when there are no items in the store initially.
So I am attaching with this new test case, a new backend script that 'mimics' that there is one item in the store (you have to uncomment it) -- and in that case the filtering select will work.
e) this is likely a separate issue but on Opera 10 the arrow down is not visible on the filtering select
Other than that the test case works on all the other browsers
f) On any any browser if you run the test case you will see that with initial empty store , after you add rows using the button -- the filtering select will show a pulldown with entries, however right after that you will receive an error from ServiceStore?.js I entered a separate bug for this in ServiceStore? (9518). On Safari, however, the pulldown does not work even after items are added to the store *if* at the load time the store was empty. So for my needs I modified the code for ServiceStore? to get me going, but could not do anything with the FilteringSelect?/safari combination (that's why I entered this bug).
--- As far as other things. query '*' works for perservere stores too.
Yes the there is no data in the database, but for the test case it is not needed because the data is 'cached' in the 'store' -- that's why cache:true was set on the grid (so the store will cache the query generated by the grid )
comment:4 Changed 12 years ago by
Component: | Dijit → DojoX Data |
---|---|
Owner: | set to Kris Zyp |
I've traced through the code (both dijit and dojox). As you said, ClientFilter is doing client side caching, so even though your mock-service isn't processing the updates correctly, it's irrelevant.
The problem is that ComboBox does a query with count: Infinity, and then dojox.data.ClientFilter::updateResultSet() has some code:
if(request.count && updated){ // do we really need to do this? // make sure we still find within the defined paging set resultSet.splice(request.count,resultSet.length); }
resultSet is an array of length 4, so it's doing resultSet.splice(Infinity, 4)
which truncates the array on safari.
Passing to Kris to fix since that code doesn't make sense to me. It seems like it should be doing this:
resultSet.splice(request.start, request.count);
Making that change does fix the problem, although I didn't do extensive testing... a good way to test would be to set the ComboBox pageSize=3 (or something small) and then make sure paging through the drop down results works.
comment:5 Changed 11 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:6 Changed 11 years ago by
Milestone: | tbd → 1.4 |
---|
the main test case