I have a webpage that I made with spring framework in java. In some of the pages they can get a list of clickable rows, but if you select a range that is too large fe. 1000 rows, it freezes and the javascript needs some 20 seconds to put buttons and such on each row.
I know that in android developement one would use recyclerView to load only a portion on the screen and would load more as you keep scrolling. Is there something similar I can use in my webpage to achieve a similar result?
What I ended up, using was infinite scroll https://scrollmagic.io/examples/advanced/infinite_scrolling.html
then I seperated my JSP list page strictly from the "forEach" part into an another JSP document that the first JSP would call using something like
$.get("${endpointName}"+"?queryIteration="+ queryIteration+ extraVariables, function( data ) {
$("#mycontent").append(data);
if($("#queryCounter"+(queryIteration)).val() === 'true'){
$("#loader").hide();
}
end then in the endpoint I would add
model.addAttribute("endpointName", "listMaterialTests");
model.addAttribute("queryIteration", queryIteration);
if(queryIteration==null || queryIteration==0)
return "materialTestList";
return "materialTestListRows";
I would modify the services to load 100 rows at a time depending on what the queryIteration value is
Related
I am using Android-pdfview library to display pdfs within my application.
pdfView.fromFile(new File("/path/to/file")).defaultPage(1).enableSwipe(true).onPageChange(this).load();
How to use AnimationManager from Android-pdfview library ?
For example, I want to show each page for 10 seconds, and move to next page automatically without user interaction. Once last page is reached, loop again.
Using BIRT 3.7.2, I'm trying to place a grid at the bottom part of the last page of a report for signatories. However I can't seem to find a way to do that.
I've tried to place the grid in a footer and render it using:
if(BirtComp.lessThan(pageNumber, totalPage)) {
this.getStyle().display = "none";
}
on the grid's onRender.
However this only works on the webviewer, and I need it to work in PDF with my Java application. When I use run and format=pdf parameters, there is still that grid at every page, and using frameset instead of run makes it not appear at all. Are there other techniques to do this? If else I may have to settle for placing the signatory grid below the table data so at least it will be on the last page.
I'm using GXT Grid with a filter (StoreFilterField to be exact).
The problem is that when filter changes (user types something or clears it) it takes a long time for Grid to refresh.
I have a relatively small grid of 1000 rows with 7 columns. Scrolling works just fine, so I believe browser is able to handle it fast.
Looks like the problem is that when one types filter text method Grid.refresh() is called, which renders all the rows again and again inserting them as one huge HTML String.
Is there a way to make it more efficient? For instance, I would think that hiding elements in existing html that contains unfiltered set of rows would be faster.
Another way is to somehow cache or delay creation of components in the Grid, but I can't find any row caching capabilities in the GXT Grid API. Maybe I overlooked it.
Your help would be much appreciated.
The caching capability is not found in the Grid API itself but in the GridView. Grids have a view attribute that you can set.
What version of GXT are you using? In GXT 2.x, there is view variant called BufferView.
From documentation:
Renders the rows as they scroll into view. This GridView is fast for displaying many rows at once, but it does not support all features the normal {link #GridView} supports, such has expanding rows.
If you are using GXT 3.x, you may have to use LiveGridView instead because they have removed BufferView.
From this, you can specify the cache size, scroll delay, etc.
I hope this helps!
Paul
I have a web page which has three <div> elements:
Right_bar contains several layouts (nothing to do with this question)
Bottom_bar contains several components e.g. calculator, logo, a group of buttons etc. each component uses a <div> and must be resizable and draggable.
And a Working Area, where all the components are dropped & resized. Also a user can resize & change the location of components anywhere in the Working Area. Once a user sets a component then the page must be saved in same style and it shouldn't be changed even after refreshing the page.
My questions are:
Should I use a database to save the location of component.
Which one should I use: JQuery / AJAX / anyother?
If you know of any tutorials please let me know although I am beginner in JavaScript, Basically a Java programmer.
Note: on the server side I am using Servlet.
Whenever the user drops an element, launch a simple Ajax request that will pass the new value to the server.
try {
var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); // IE
}
catch(e)
{
var xmlhttp = new XMLHttpRequest(); // Other browsers
}
xmlhttp.open('GET', 'yourServerScript.url?param=value', true);
xmlhttp.send(null);
You may want to check if the request succeeded or failed by handling the "readystatechange" event of your http request, but that doesn't seem important in your case.
After that you just have to get the value server-side, store it in a session variable, and then on every page load, check if there is a session variable defined for the parameter before setting it to its default value.
What you can do is save the location of the control in a xml and save it in a table.
2.jquery UI has as build in framework that supports drag and drop div elements, check this link http://jqueryui.com/demos/droppable/
I did the same thing for an application. (but I used PHP, anyway it doesn't matter for what you need)
I used jQuery + jQuery UI drag & drop / resize
I used AJAX with 4 parameters (x,y, z-index and id of the element) for drag & drop on drag stop
I used XML as a database for this, but any database (or any persistance way) will do the trick. As #Thibault Witzig said, take the most pertinent for your project.
Im completely new to Java web stuff, but here goes my question:
1) How can I add new controls to a JSF page (webuijsf) in the prerender() function?
2) How can I change the position of elements already added using the visual designer? Also in prerender().
I have a number of input fields + labels to show, coming from a database. So I imagine I read from the database and add the appropriate number of controls during prerender. There's also a grid below these dynamically added controls, which I'd like to move further down at the same time.
Thanks!
You would need to write your own component if you wished to render forms based on database data. You should position your grid using standard html techniques or writing your own custom grid component.