I currently have many rows on a table that load as a user scrolls down the page.
There is a showPrintablePageBehavior tag added to create a printable layout page upon clicking that will show the contents on the table. Currently, it only shows 25 or so rows at a time.
I am trying to figure out how to display every row on the new page once the button is clicked.
Is there anything I can add to the <af:showPrintablePageBehavior/> tag or the af:commandToolbarButton tag that could help transfer all the rows over? I know fetchSize may be an option, but I'm not sure how to implement that in.
Thank you!
To my knowledge, the showPrintablePageBehavior will not trigger a server go around. This means that you need to build another page where you fetch all data (set the fetchsize to -1) and print this. This blog https://myadfnotebook.blogspot.com/2011/01/adf-printable-pages-fetching-more-data.html shows how to do this.
Related
I'm currently working on an App which should display a table of data. The data shown depends on the user's choices. I want to implement this table which should be autosized and scrollable, but I can't figure out how I could do that using a loop. Maybe you guys can help me by just giving me an example of how to implement such a table, maybe even with the specified data which the user chose in the first place.
PS: The things the user can choose are e.g. date, subject and teacher, so the table has 3 columns (subject, teacher, date). I have implemented this choice already using the jexcelAPI and an xls document, the only thing I need to do now is to implement the table to show the results.
Thanks in advance :)
you can actually complete your task using listview in andriod.And you will load the list of items displayed using baseadapter.
This is my application require :
- Get data from a server (JSON)
- Show all data report like image above. Data will display as multi page ( do not scroll), use next and previous button to switch
See how I want:
I can get data from server and show data as listview. But I have some problem and need help.
1. How to display data like image I attached. I found some way but seem it is not good
2. How to display data as multi page. I do not know exactly how much data because it depend data on Server, i have to show all data on server. Pages should auto generate depend on data.
Thanks you.
Simplest way to do it would be to create three datasets (let's say arraylists) and keep previous page data in one and current and future in the next one.
Then put an onClickListener that changes the data in listviews and then notify adapter using .notifyDatasetChanged().
This is not an default Android Behavior, So Please do not follow this design. Better to use Load More Functionality :)
You can refer links for that.
ListView to load more items when reached to an end
LoadMore library
Infinite Scroll ListView
I am writing a browser based application using GWT and making use of websql (yes, I know it is deprecated). I have created a custom table widget (based on FlexTable) and enabled it to scroll with the help of some CSS trickery. What I am striving to achieve (without much success) is that when the user scrolls to the start/end of the current data in the table, an event is fired and the next subset of X rows is returned from the websql DB and replaces the data currently in the table. In order for this to work, I need to keep track of the data offset in the table widget so that I can pass this to the query and use the limit and offset functions of SQL to return the required data. However, I just cannot seem to get the logic right to implement the data offset tracker within the widget. Another complication is that I need the table to be able to scroll 'into the past' (so to speak), so that it can retrieve data from before the initial start point when the table loads.
I have been at this for a number of days now and just cannot seem to get it right. So I was wondering/hoping that someone might be able to point me in the right direction (PLEASE!).
Thanks in advance
Tim
I am not sure why this is causing a problem.
int page = 0;
// when you hit the bottom
page++;
loadData(page);
// when you hit the top
if (page > 0) {
page--;
loadData(page);
}
Tim I think it is not a good idea controlling the scroll with CSS trickery.
I have done something similar soon and controlling all the logic (pagination, scroll positions,...).
What I suggest to use is a gwt's scrollPanel, a HasData widget (like a cellList) your custom AbstractCell (class which is rendered for each row of your list) and asyncDataProvider ( which gives you the onRangeChange handler for asking to your server when the range data display has changed).
You can force/fire that event when in scrollPanel.addScrollHandler detects you are arriving to the end.
If you want to see all of this in action have a look into (click on source code): http://gwt.googleusercontent.com/samples/Showcase/Showcase.html#!CwCellList
EDIT [according comment below]:
A. If you want to override the data (in the example is X+X+X...) with the new retrieved just maintain always the same range of data displayed [display.setVisibleRange(0, newPageSize);], and start from 0 when you render the new data (on your RangeChange listener).
B. If you need to have control over up and down scrolls instead of taking advantage of the used events internally on the cellList (basically onRangeChange), you can create your custom events and fire them (this option could be easier for your colleagues for understanding everything). And do not worry about controlling up and down scrolls, inside the ShowMorePagerPanel.java you can see a simple example of knowing up and down controls.
Anyway, I did not explain more detailed because I did not see you very convinced to use CellList approach (and I was using my tablet :D ).
If you change your mind, just let me know and I write for you a proper example step by step (this part could be tricky, so if you are lost it is normal ;) ).
I am using eclipse with tomcat server. My program is about to print a page containing dynamic table, which means the data and number of column even header title also dynamic. The table is continue to the next page, and i need to view the table header as well as the first page. Is there any example or page i can refer to?
Thanks in advance
your explanation is not clear enough but based on your question (How to preview before print using eclipse?) I think I know what you mean. as I realized you want to have a preview before printing your page, Ok then, jQuery has a plugin with this very aim which is called Print Preview Plugin. use this plugin and:
$('#yourcontainer').prepend('<a class="preview-page">Print this page</a>');
$('a.preview-page').printPreview();
then you can call $.printPreview.loadPrintPreview(); and your problem is solved. here this is a DEMO get a view-source, you'll see the solution.
I am a doing a project on Exam Suit in Netbeans swing java application. I have done all my work like login page, sign up page etc etc. But the main problem stick with exam page. I have inserted all the question and there choices with answer(not shown) in a database. I have designed one frame, 1 label for question and three radio buttons for choices and an OK button to select the choices and NEXT button to goto next question. I can easily get the data from database of only one row. But to get the other question I should keep the code in NEXT button, but this can be done only one time. I just want to change the data from table dynamically on click of NEXT button. I am unable to do this, Please help me. Thank You.....
Since your program acesses a database, I assume that you are using ResultSet from JDBC. You need to call ResultSet.next() each time the user clicks on the "Next" button. As long as you keep a reference to the ResultSet, you can call this method until you reach the end of the data set.