Is Vaadin 7 supporting table with pagination handled by server side? - vaadin

I'm handling a lot of data and I would like to show it in my app. Is there is UI component, table with support of pagination on server site? So I can handle it via REST or some AJAX request.

Doing "traditional pagination" is pretty easy with Vaadin components (some layouts, labels and buttons). Here is an example how you can do it:
https://github.com/viritin/viritin/blob/master/src/test/java/org/vaadin/viritin/it/MTableWithTraditionalPaging.java
That example calls just some dummy data service, but you can naturally replace that with anykind of backend: for example JPA or accessing a remote REST service. It uses MTable from Viritin, but the same approach can be used with plain Table or Grid as well and in Vaadin 8 beta (with Grid) the usage is almost the same, just swap "setBeans" to "setItems".
If you want to list your stuff in a VerticalLayout, this add-on might also be helpful: https://vaadin.com/directory#!addon/pagingcomponent

Related

UI5 Web Components and ObjectListItem

I am experimenting with UI5-webcomponents and Angular. I try making an application that has similar design with an existing OpenUI5 application that uses a list with ObjectListItem items. The only equivalent I found is ui5-li but it has very limited properties - description and info for texts. I need also number and nubmerUnit + some statuses.
Can I somehow achieve this preferably without custom css?

On blackboard is it possible to open multiple scorms?

I'm having difficulty finding way to open multiple scorms simultaneously..
Is there a setting that I need to change or blackboard does not allow multiple scorms to be opened?
So commonly with SCORM you have a Runtime API that is nested somewhere on the LMS web page. This API is directly flavored for the SCO that was requested. So having multiples trying to talk to the same API would lead to data corruption. The only way to extend the capability for multiple shareable content objects would require more IFRAMEs. You'd need to nest the runtime in the first IFRAME, then the Content in a sub IFRAME. I've accomplished this with another client and it was done mainly to represent single page SCOs stacked on top of each other as a Q and A style homework display.
Is it optimal? Probably not. Does it work? Totally. The SCORM Runtime is a JavaScript based API which is populated with a CMI object. Namespaces within that CMI Object (get / set) from the content, however the LMS is responsible for populating its base values as well as maintaining whats allowed and not allowed. Hope that helps, but based on your question Blackboard would have to implement that sort of module support to do it.

Progressive enhancement - what to do when JavaScript is off?

I understand what progressive enhancement is, I'm just fuzzy on some of the details in actually pulling it off. Of course, that could be because I'm looking at it in the wrong way. Let me try to explain my difficulty with a hypothetical:
ASP.NET MVC site. I have a view that has tabbed navigation. Each tab is for a movie category/genre which displays 5-10 links to movies in that category. The movie data is obtained through Netflix's Odata.
My initial thought is to use Ajax to pull and parse the JSON from the proper OData GET requests when each tab is clicked. How would I provide a non-JavaScript version of that? Is it even possible?
For simpler requests where JSON isn't necessary - like, say, having a user log into the system - I see how I could simply set a cookie and dynamically change the page based on it to reflect the change. But what if I need to return and parse JSON? How do I provide an alternative?
The deal with progressive enhancement is that your server side must be fully capable of generating every last bit of HTML that appears in all of your pages. This is obvious, since otherwise (if JS is turned off) there will be no part of your application capable of doing said rendering.
Since the server side must know how to render everything, it doesn't make much sense to generate things (DOM elements/HTML) on the client side from JSON responses the server gives you. Why repeat yourself?
This brings us to the logical conclusion that when doing dynamic updates on the client, you need to get ready-made HTML from the server (since the rendering logic is over there) and insert it into the DOM as appropriate. You are then free to work on the newly inserted elements with jQuery and enhance them all you want.
So -- forget about parsing JSON on the client, otherwise you 're locking yourself out of progressive enhancement. If you want to call a third party, have the server be your intermediary: call the server with all the necessary information for it to call the third party and get ready-made HTML back.
If you do this, then the server can of course provide non-JS versions of everything on your site with no problem. Total non-reliance on JS achieved.
There is no JSON without JS, by definition (JavaScript Object Notation). Without JS you won't make AJAX calls. Your pages will render as is, just like oldschool sites.
If you need to do this progressively, you will have to call the odata service server-side, and provide .net objects to the site in viewdata, or your viewmodel, and have your views/partials render it.
In ASP.Net MVC actions, the httpcontext available via the controller will have a property on this path: this.HttpContext.Request.IsAjaxRequest() and can be used to test whether you want to return a view or just json data, or whatever type of ActionResult you want. This can be an excellent timesaver for building progressive enhancement style sites.

Can you use jQuery POST in a Chrome extension?

I'm trying to get my Chrome extension working with the Google Calendar API. However, the way Google has set up the extension sandbox makes anything almost impossible.
I can't add the Calendar API using JavaScript because I've tried 200 different ways to include the http://www.google.com/jsapi library. Therefore, I want to try interact with the Calendar API with PHP. Is it even possible to do a POST from a Chrome extension in order to run my PHP file? If not, it's pretty much impossible to interact with any external API that doesn't have a downloadable library, isn't it? If that's the case, I don't see how you can make anything useful with Chrome extensions.
I think you are still having difficulties because you don't completely understand the difference between content scripts and background pages.
Content scripts have certain limits. They can't:
Use chrome.* APIs (except for parts of chrome.extension)
Use variables or functions defined by their extension's pages
Use variables or functions defined by web pages or by other content scripts
Make cross-site XMLHttpRequests
Basically all they can is access DOM of a page where they were injected and communicate with background page (by sending requests).
Background page thankfully doesn't have any of those limits, only it can't access pages user is viewing. Good news is that background page can communicate with content scripts (again through requests).
As you can see background page and content scripts supplement each other. If you use both at the same time you have almost no limitations. All you need is correctly split your logic between those two.
As to your initial question - content scripts can't make cross domain requests, but background pages can. You can read more here.

web scraping/parsing of college course site

Trying to parse/scrape the course site for memphis. The site is "https://spectrumssb2.memphis.edu/pls/PROD/bwckgens.p_proc_term_date". It appears to be some sort of javascript issue, or dynamic generation of the text. I can see the underlying DOM structure using livehttpdheaders/Firefox, but not when I simply view the underlying source/text of the page..
Thoughts/Comments/Pointers would be appreciated...
Well this modern days the site may be assembled in few steps. First the main structure is pulled in and then, often based on identity of the user additional AJAX calls are executed. Your best bet is to sniff HTTP to see what kind of requests are issued between the site is initially requested and when it's fully built
Since you are using firebug you can get HttpFox add-on which gives you what you need

Resources