Re: Celltable loading state
dataGrid.setRowCount(0, false); should do the magic On Friday, February 11, 2011 at 12:35:36 AM UTC+5:30, Deepak Singh wrote: > > Hi All, > > How can we set the loading image to be visible till the cell table loads ? > > -- You received this message because you are subscribed to the Google Groups "GWT Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit/68c5ffb7-ff02-4afe-be50-dc75ee5a212eo%40googlegroups.com.
Re: Celltable loading state
This works for me as well with DataGrid and AsyncDataProvider and 2.5rc1. I'll take hackish over not showing the loading indicator at all. Thanks guys. On Tuesday, May 15, 2012 12:38:35 PM UTC-4, Jens wrote: You need to make sure that the cell-widget thinks the current page size is non-zero e.g. setRowCount(x) (where x 0). You're basically trying to convince this method to enter the LOADING state - private void updateLoadingState() { int cacheSize = getVisibleItemCount(); int curPageSize = isRowCountExact() ? getCurrentPageSize() : getPageSize(); if (cacheSize = curPageSize) { view.setLoadingState(LoadingState.LOADED); } else if (cacheSize == 0) { view.setLoadingState(LoadingState.LOADING); } else { view.setLoadingState(LoadingState.PARTIALLY_LOADED); } } Ok I have now: list.setVisibleRangeAndClearData(list.getVisibleRange(), true); list.setRowCount(1); and it works for empty data in the CellList as well as with data. But to me it seems really hackish. -- J. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: Celltable loading state
I am with you that the loading indicator is never displayed when using a ListDataProvider. Using GWT 2.5, I tried all the methods mentioned in this thread, and none of them worked. So I came up with the following hack, which essentially temporarily hijacks the empty table widget for use as a loading indicator... // I call this method just prior to starting to async reload my data and update my ListDataProvider public void showLoadingIndicator() { this.emptyTableWidget = getEmptyTableWidget(); setEmptyTableWidget(getLoadingIndicator()); this.listDataProvider.getList().clear(); this.listDataProvider.flush(); } // I call this method after my I've updated the data in my ListDataProvider public void hideLoadingIndicator() { setEmptyTableWidget(this.emptyTableWidget); } --Ian -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: Celltable loading state
With GWT 2.5, looking into HasDataPresenter.updateLoadingState, I realized I also had to set the page size to see the loading indicator when loading on an empty table. My my hack was: setRowCount(1); setPageSize(1); setVisibleRangeAndClearData(getVisibleRange(), true); On Wednesday, 16 May 2012 02:38:35 UTC+10, Jens wrote: You need to make sure that the cell-widget thinks the current page size is non-zero e.g. setRowCount(x) (where x 0). You're basically trying to convince this method to enter the LOADING state - private void updateLoadingState() { int cacheSize = getVisibleItemCount(); int curPageSize = isRowCountExact() ? getCurrentPageSize() : getPageSize(); if (cacheSize = curPageSize) { view.setLoadingState(LoadingState.LOADED); } else if (cacheSize == 0) { view.setLoadingState(LoadingState.LOADING); } else { view.setLoadingState(LoadingState.PARTIALLY_LOADED); } } Ok I have now: list.setVisibleRangeAndClearData(list.getVisibleRange(), true); list.setRowCount(1); and it works for empty data in the CellList as well as with data. But to me it seems really hackish. -- J. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/X-xqKn8uFQsJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Celltable loading state
table.setVisibleRangeAndClear() will ensure that the loading indicator appears until setRowCount(0, true) or setRowData() are called. I am using a CellList and it seems like that AbstractHasData.setVisibleRangeAndClear() does not show the loading indicator if the CellList is empty. Its basically like: 1.) CellList created = shows loading indicator 2.) Server returns 0 records = ListDataProvider is empty = shows empty indicator 3.) Calling list.setVisibleRangeAndClear(list.getVisibleRange(), true) to show loading indicator because I want to reload the list data = no loading indicator, still shows empty indicator while data is loading. 4.) CellList/DataProvider now contains some data and when redoing 3.) the loading indicator appears as expected. Anyone knows if this is intentional behavior? To me it seems like a bug. Is there any other way to show the loading indicator even if the list is empty? -- J. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/UukgWkmauhYJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Celltable loading state
I looked into this a little while ago and as far as I could tell using the ListDataProvider prevents the loading indicator from ever being shown (long explanation which I never got round to writing up, but if there's interest I will do). The ListDataProvider is intended to be used when all of the data is resident in the client, if it isn't then you should use AsyncDataProvider. On Tue, May 15, 2012 at 2:59 PM, Jens jens.nehlme...@gmail.com wrote: table.setVisibleRangeAndClear() will ensure that the loading indicator appears until setRowCount(0, true) or setRowData() are called. I am using a CellList and it seems like that AbstractHasData.setVisibleRangeAndClear() does not show the loading indicator if the CellList is empty. Its basically like: 1.) CellList created = shows loading indicator 2.) Server returns 0 records = ListDataProvider is empty = shows empty indicator 3.) Calling list.setVisibleRangeAndClear(list.getVisibleRange(), true) to show loading indicator because I want to reload the list data = no loading indicator, still shows empty indicator while data is loading. 4.) CellList/DataProvider now contains some data and when redoing 3.) the loading indicator appears as expected. Anyone knows if this is intentional behavior? To me it seems like a bug. Is there any other way to show the loading indicator even if the list is empty? -- J. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/UukgWkmauhYJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Celltable loading state
I looked into this a little while ago and as far as I could tell using the ListDataProvider prevents the loading indicator from ever being shown (long explanation which I never got round to writing up, but if there's interest I will do). The ListDataProvider is intended to be used when all of the data is resident in the client, if it isn't then you should use AsyncDataProvider. Even when using an AsyncDataProvider the loading indicator isn't shown when calling list.setVisibleRangeAndClearData(list.getVisibleRange(), true) and the list data is empty at that time. I think its independent of the DataProvider you use. As soon as you have no data in your CellList the loading indicator does not work like expectedwell or I have missed something obvious?! -- J. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/305iEPbSaGYJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Celltable loading state
You need to make sure that the cell-widget thinks the current page size is non-zero e.g. setRowCount(x) (where x 0). You're basically trying to convince this method to enter the LOADING state - private void updateLoadingState() { int cacheSize = getVisibleItemCount(); int curPageSize = isRowCountExact() ? getCurrentPageSize() : getPageSize(); if (cacheSize = curPageSize) { view.setLoadingState(LoadingState.LOADED); } else if (cacheSize == 0) { view.setLoadingState(LoadingState.LOADING); } else { view.setLoadingState(LoadingState.PARTIALLY_LOADED); } } The cacheSize is retrieved eventually from the maximum relative index in the current page (i.e. the first visible item is index 0) that has had data associated with it plus one (to convert the index to a count). This is because as data is pushed into each index in the page, a placeholder data value of null is pushed into any missing indices up to the current index. The curPage size is just the size of the current page, either the specified page size in the last setVisibleRange call, or if the row count is exact and the last page is being viewed, then row count modulo page size (i.e. if there aren’t enough items to fill the last page). On Tue, May 15, 2012 at 5:11 PM, Jens jens.nehlme...@gmail.com wrote: I looked into this a little while ago and as far as I could tell using the ListDataProvider prevents the loading indicator from ever being shown (long explanation which I never got round to writing up, but if there's interest I will do). The ListDataProvider is intended to be used when all of the data is resident in the client, if it isn't then you should use AsyncDataProvider. Even when using an AsyncDataProvider the loading indicator isn't shown when calling list.setVisibleRangeAndClearData(list.getVisibleRange(), true) and the list data is empty at that time. I think its independent of the DataProvider you use. As soon as you have no data in your CellList the loading indicator does not work like expectedwell or I have missed something obvious?! -- J. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/305iEPbSaGYJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Celltable loading state
You need to make sure that the cell-widget thinks the current page size is non-zero e.g. setRowCount(x) (where x 0). You're basically trying to convince this method to enter the LOADING state - private void updateLoadingState() { int cacheSize = getVisibleItemCount(); int curPageSize = isRowCountExact() ? getCurrentPageSize() : getPageSize(); if (cacheSize = curPageSize) { view.setLoadingState(LoadingState.LOADED); } else if (cacheSize == 0) { view.setLoadingState(LoadingState.LOADING); } else { view.setLoadingState(LoadingState.PARTIALLY_LOADED); } } Ok I have now: list.setVisibleRangeAndClearData(list.getVisibleRange(), true); list.setRowCount(1); and it works for empty data in the CellList as well as with data. But to me it seems really hackish. -- J. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/rjiC8vRwQ3kJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Celltable loading state
I suppose it's intended for the situation where you know at least a rough estimate of the count before requesting the data e.g. paging. Another example could be passing the category item count down along with the category name etc. when requesting the category list, assuming a list of categories is what is swapping out the data in the table. I agree it struggles in the case of requesting a completely arbitrary set of data, maybe a method like setRowCountUnknown() would clean it up. On Tue, May 15, 2012 at 5:38 PM, Jens jens.nehlme...@gmail.com wrote: You need to make sure that the cell-widget thinks the current page size is non-zero e.g. setRowCount(x) (where x 0). You're basically trying to convince this method to enter the LOADING state - private void updateLoadingState() { int cacheSize = getVisibleItemCount(); int curPageSize = isRowCountExact() ? getCurrentPageSize() : getPageSize(); if (cacheSize = curPageSize) { view.setLoadingState(LoadingState.LOADED); } else if (cacheSize == 0) { view.setLoadingState(LoadingState.LOADING); } else { view.setLoadingState(LoadingState.PARTIALLY_LOADED); } } Ok I have now: list.setVisibleRangeAndClearData(list.getVisibleRange(), true); list.setRowCount(1); and it works for empty data in the CellList as well as with data. But to me it seems really hackish. -- J. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/rjiC8vRwQ3kJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Celltable loading state
I am sorry. I found this page surfing the web, I hope this is a good point to ask this. I have a problem using loading indicators in DataGrid. What is the right way to set to the DataGrid the state of LOADING or LOADED? I didn't find any resource whatsoever anywehere. The support for this is really poor. By the way, whare am I wrong? I just inizialize my DataGrid using: myDataGrid.setLoadingIndicator(new Image(/*my ImageResource object*/); and the during the flow of the program I use: myDataGrid.fireEvent(new LoadingStateChangeEvent(LoadingState.LOADING)); when I want to put the DataGrid in the 'LOADING' state, i.e. just before making an RCP call, and then: myDataGrid.fireEvent(new LoadingStateChangeEvent(LoadingState.LOADED)); just after the grid has been populated with data. This doesn't work. Please help. On Thursday, February 10, 2011 8:05:36 PM UTC+1, Deepak Singh wrote: Hi All, How can we set the loading image to be visible till the cell table loads ? -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/kRRWetyg0tgJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Celltable loading state
You'd probably need to add a zero-sized array list of data and set what you want to show with table.setEmptyTableWidget() -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/sd3WS18VYYUJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Celltable loading state
Hi John, Is there any way to disable the loading indicator from showing ? I even tried native methods, no luck. I am using a ListDataProvider, when I have data to show I just clear the existing list of the data provider. But problem is first time the image always shows. One way is to replace the current image with a blank image. But I was hoping for another solution. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/fVQwnBKZ40YJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Celltable loading state
Hi All, How can we set the loading image to be visible till the cell table loads ? -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Celltable loading state
You can specify your own image by extending CellTable.Resources and replacing cellTableLoading(). interface MyResources extends CellTable.Resources { @Source(myImage.png); ImageResource cellTableLoading(); } CellTable.Resources res = GWT.create(CellTable.Resources.class); CellTable table = new CellTable(25, res); Thanks, John LaBanca jlaba...@google.com On Thu, Feb 10, 2011 at 2:05 PM, Deepak Singh deepaksingh...@gmail.comwrote: Hi All, How can we set the loading image to be visible till the cell table loads ? -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Celltable loading state
I use setRowCount(0, true). -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Celltable loading state
My bad, I misunderstood. table.setVisibleRangeAndClear() will ensure that the loading indicator appears until setRowCount(0, true) or setRowData() are called. Thanks, John LaBanca jlaba...@google.com On Thu, Feb 10, 2011 at 2:26 PM, Y2i yur...@gmail.com wrote: I use setRowCount(0, true). -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Celltable loading state
Oops, sorry, I mis-read the question... -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Celltable loading state
Except there is no such method :). Perhaps you mean something like: table.setVisibleRangeAndClearData(table.getVisibleRange(), true); Cheers Craig -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.