留言板

Single Page App (Portal) Using SennaJS

Muhammed Hussain,修改在8 年前。

Single Page App (Portal) Using SennaJS

New Member 帖子: 16 加入日期: 15-10-5 最近的帖子
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,修改在8 年前。

RE: Single Page App (Portal) Using SennaJS

Liferay Legend 帖子: 14918 加入日期: 06-9-2 最近的帖子
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,修改在8 年前。

RE: Single Page App (Portal) Using SennaJS

New Member 帖子: 5 加入日期: 15-2-6 最近的帖子
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