Forums de discussion

Single Page App (Portal) Using SennaJS

Muhammed Hussain, modifié il y a 8 années.

Single Page App (Portal) Using SennaJS

New Member Publications: 16 Date d'inscription: 05/10/15 Publications récentes
Hi,
Can someone share some detailed info on how to create a Single Page Application (SPA) in Liferay using SennaJS. We cannot find any documentation on How to create SPA in Liferay. SPA-Application content should be refreshed with changing URL dynamically and it should not reload the Page.?
thumbnail
David H Nebinger, modifié il y a 8 années.

RE: Single Page App (Portal) Using SennaJS

Liferay Legend Publications: 14918 Date d'inscription: 02/09/06 Publications récentes
Senna is not the only option, plain old Angular works just fine too.

The problem is often that people confuse SPAs with "SPPs" (single page portlets). A SPA infers that there are no other things on the page, that there's only one app controlling the URL.

Under Liferay, well Liferay is interested in the URL as would be other portlets on the page that are not based on Senna or Angular (or whatever).

So your portlet can never completely own the URL just like it can never completely own the page (other links on the page such as the dockbar, the navigation, etc.).

And things get progressively worse if you have multiple "SPA" portlets on the same page; each would want to manipulate the address bar to reflect state, and they would end up stepping on each other most of the time.

The best I can offer is the understanding that, at least within a portal, individual portlets cannot and should not expect state to be retained in the URL. When you have two portlets on a page, the URL would have to reflect state for both of those portlets (they would need to know how to encode it into the URL and would need to know how to decode it when the URL is put in the address bar), and the mechanism would need to know how to scale as more of these portlets are added.
thumbnail
Shalinee Tawar, modifié il y a 8 années.

RE: Single Page App (Portal) Using SennaJS

New Member Publications: 5 Date d'inscription: 06/02/15 Publications récentes
You can achieve SPA(Single Page Application) concept in liferay using senna.js

We can create theme for support senna.js in liferay 6.2.

I have written blog on SPA. You can see the implementation part of SPA in liferay 6.2 using Senna.js in the following link.

Single Page Application in liferay 6.2 using Senna.js