Is it possible to perform stealth paging on a sap.ui.table.Table? By stealth paging I mean, when scrolling (up or down) only a batch of records is retrieved. The current page is removed and replaced with the next batch of records. I don't want a technique that continuously appends to the data because I have a last button and it would take forever to load everything.
Would I use something like getThreshold() found here?
Tables in sapui5 already have this built in.
a Table control can take care of only rendering the currently visible rows and use this ScrollBar control to make the user think he actually scrolls through a long list.
This can be found here.
SapUi5 is even cooler than I originally thought!
Related
When using a browser in my progress application the scroll bars never work correctly. It will show that I can only scroll down a little but then keeping going. Is this a bug in progress or is there something I can do to fix this problem?
define query browse-4 for customer.
DEFINE BROWSE BROWSE-4
QUERY BROWSE-4 NO-LOCK DISPLAY
custNum name
/* ENABLE name */
WITH NO-ROW-MARKERS SEPARATORS SIZE 32 BY 6.46 FIT-LAST-COLUMN.
.
open query browse-4 preselect each customer no-lock.
enable browse-4.
wait-for window-close of current-window.
You can adjust the MAX-DATA-GUESS property for the browse. You can get the value from NUM-RESULTS after the preselect query has been opened. Or you can set it to a suitable guesstimate without using preselect.
Keep in mind that using preselect causes every record to be read instead of just enough to fill the first browse window. That is potentially a lot of extra DB reads and network traffic just to get the scrollbars correct.
You may be confusing the scrollbar on the containing frame with the scrolling of the browse.
Do you see two boxes outlining the browse? If you add "with no-box" to your "enable" does the scrollbar that is bothering you go away?
If it does then the problem is that your containing frame (which is the default un-named frame because you have not specified a frame phrase with the ENABLE) is smaller than the browse viewport. So you are seeing a scrollbar on the FRAME, not on the BROWSE, that is trying to tell you that you can scroll the frame up and down to see the complete viewport of the browse. The browse may also scroll within that containing frame depending on how much data there is.
If you are running this code in a character (Unix) environment you should also be aware that many GUI features of the BROWSE are not available. Especially anything related to appearance. Like scrollbars.
This is a known "feature" of Openedge GUI, unfortunately.
The position of the slider on the right of the browse is not directly related to the number of records in the query, but to the "Max Data Guess" property of the browse.
You can set this value yourself in the property dialogue for the browse widget (it's just below the "query" editor, in v10 at least).
Just set it to a really big number (say 10,000) and the browse will behave as it should.
the main problem for my question is mainly ,i am deleting temptable before completing the excecution,that is the main reason for the vertical-scrollbar is not working,after eleminating this temp-table deletion statements .automatically vertical-scrollbar is working.
for each ttdummy:
delete ttdummy.
end.
How can I lock the cols title in a table when i scroll the content?
(I want cols title always visible)
p.s. I use sap.m.Table https://sapui5.hana.ondemand.com/sdk/docs/api/symbols/sap.m.Table.html
It's currently not possible, and when thinking of it, there (used to be) a good reason too:
Since the sap.m libraries were intended initially for mobile use, controls should not have any scrollbars. And since web applications on a mobile device more often than not require scrolling to display its content, having a control (a table) which needs scrolling itself would disrupt the page-scrolling behavior.
(Just think of a website you display on your mobile device where you need to scroll, and suddenly you're no longer scrolling the page but some inner iframe / control / div element takes over the scrolling, until you reach the end of that control, and your page resumes to scroll down again.)
On desktop applications I agree it would makes sense (and maybe there should be a flag to lock the column headers) but definitely not when displayed on a mobile device.
In SAP UI5, there exists the attachColumnFreeze method.
Perhaps it can be used for freezing columns on a table
attachColumnFreeze
First, please believe me when I say I did search for this answer first... a lot. I found many examples, but none performing similarly to what I need. Though I could have been searching using the wrong key words, I don't believe so.
Here is my issue:
I have a table view being populated by a query that is returning a huge amount of data. The data is for a list of restaurants, a price rating, and id. But there are so many restaurants in the database that it fills memory and crashes the app most time. (I am assuming this is what is going on, as the code works just fine if the query is limited, and has always worked on other pages I query things that don't have as much data returned.)
What I would like to do is make pagination for the application's table view for this page. I don't see how I could use the "Show More" method, or the auto load when scrolled to the bottom, simply because if you scroll down to the end of the list, you will still have the same issue: filling memory. Is there a way to do web-like pagination where (if they are not on the first page) they have a "Previous" cell at the top and (if not on the last page) a "Next" cell at the bottom? These would have to clear the cells out in the current view and drop the data so we're not just adding data which would cause the same issue, then do a new query to populate the cells.
Of course, I do not expect someone to sit here and write all that code for me. The main part I would need is just how to set up the cells for the next and previous cells. I should be able to figure the rest out after that, but I don't know how to go about clearing the data from the current table view.
Thanks for any help or suggestions.
I think you can do with a show more method or loading as you scroll, you say the problem is that you still load a bunch all the data and youll run out of memory, but you can avoid that... One option is, save to disk or just release data that isnt being shown on the table view, you can use indexPathsForVisibleRows method of UITableView to see which cells are visible, and with that info you should know which data you can safely release... You can do this either when you receive memory warnings, or maybe as cells are scrolled off the screen (up to you)...
Hope this helps
Daniel
I need to freeze the first column and first row of data in a CellTable, so that users can scroll through the data but still see the labels on the "axes." The first column should scroll when the user scrolls up and down, and the header row should scroll when the user scrolls left and right. Think "Freeze Panes" in Excel.
I'm using GWT 2.1 and am willing to write my own widget to do this if no solutions already exist. My question is a two-parter:
Do any widgets already have this behavior?
Any suggestions if I'm going to implement this myself?
Thanks!
I implemented a solution myself. Check out http://larkolicio.us/ScrollTable/ExperimentTables.html
It's a LayoutPanel with three AbsolutePanels inside it. The frozen columns are a CellTable, the main part is a CellTable, and the header is a Grid - I could find no way to set the width of a CellTable column! A ScrollHandler links the main part to the two frozen parts. There is a little bit of delay - I'd appreciate it if someone could find a way to get rid of the lag between the sections.
I got it working to a point that I could use it, and stopped. It is not a general-purpose widget. Please feel free to use it at your own risk.
This implementation is quite good. I have just tested it. It however needs some changes made to support asynchronous loading. GWT Issue 188 covering similar request for enhacement was created on Oct 2006?!
Thanks for sharing.
I've yet another question. I'm working with GWT 2.0.4 and IE8 as well as FireFox (the latter only for comparison purpose). My application needs to load data and show it inside a table. There are about 60 columns and 150 rows to show.
Since the loading is dynamic - as soon as a dataset has been fetched, it's added to the table - I'm fine with slowdowns during loading process. However: when the table is completely loaded, I'd expect it to be pretty snappy and let me scroll it without much lag.
While the loaded table reacts in FireFox pretty good - it stays very responsive - Internet Explorer 8 is causing me a lot of headaches. In particular: as soon as the table finished loading and I try to scroll around or highlight a row, IE8 becomes VERY laggy and highlighting a row makes IE8 consume 50+% of CPU power.
I am not using any 3rd-party libraries and even displaying empty cells in a FlexTable still gives me the same issue.
I found some probably related issue here: SmartGWT ListGrid is slow, but only in Internet Explorer . Unfortunately neither the issue there, nor the supplied links for SmartGWT solved my problem as I am not using SmartGWT. I do believe though that the problem is related.
I'd be happy to try any suggestions.
If it's possible (and your description of the problem suggests so), use Grid instead:
A rectangular grid that can contain
text, html, or a child Widget within
its cells. It must be resized
explicitly to the desired number of
rows and columns.
Have a look at bulk table renderers # GWT Incubator for a comparison of these approaches (it's a little dated, but the point that FlexTable is slower than Grid still holds ;)). The "bulk rendered" tables from the incubator are also an option, however keep in mind that those widgets might not be maintained any more (and for example, contain bugs) - or are rapidly maintained :D But looking at the source might at least point you in the right direction, if you wanted to roll out your own solution to this problem.
highlighting a row makes IE8 consume 50+% of CPU power.
Maybe it's because you added mouse listeners to every row in your table. If so you could use :hover-pseudo-class in your css-files.
This article maybe helpful if you need to handle Events from a bunch of widgets in your table: http://code.google.com/intl/en/webtoolkit/doc/latest/FAQ_UI.html#As_the_application_grows,_event_handlers_seem_to_fire_more_slowl