如何在Liferay 7中禁用SennaJS/SPA? [英] How can I disable SennaJS/SPA in Liferay 7?

查看:74
本文介绍了如何在Liferay 7中禁用SennaJS/SPA?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Liferay 7使用 SennaJS 作为其单页应用程序引擎,以便在访问期间加载和替换门户网站页面的某些部分.表单提交和导航.有时,此功能会干扰我的用例,那么如何禁用它?

Liferay 7 uses SennaJS as its Single Page Application engine in order to load and replace certain parts of the portal page during form submission and navigation. Occasionally this feature interferes with my use case, so how can I disable it?

推荐答案

如果要禁用SennaJS执行的XHR GET导航或其对表单提交的处理,可以尝试以下操作之一:

If you want to disable the XHR GET navigation performed by SennaJS or its handling of form submissions, you can try one of the following:

  • 如果只想对某些表单或链接禁用SPA,则可以将data-senna-off="true"属性添加到那些<form><a>标记中.

  • If you want to disable SPA for only certain forms or links, you can add the data-senna-off="true" attribute to those <form> or <a> tags.

如果只想禁用一个portlet的SPA,则可以将<single-page-application>false</single-page-application>添加到 liferay-portlet.xml <portlet>部分(请参阅

If you want to disable SPA for only one portlet, you can add <single-page-application>false</single-page-application> to the <portlet> section of your liferay-portlet.xml (see the DTD for the expected order of liferay-portlet.xml elements).

如果只想对一个OSGi模块portlet禁用SPA,则可以将"com.liferay.portlet.single-page-application=false"添加到portlet元数据中.

If you want to disable SPA for only one OSGi module portlet, you can add "com.liferay.portlet.single-page-application=false" to your portlet metadata.

如果要在门户范围内禁用SPA,可以将javascript.single.page.application.enabled=false添加到 portal-ext.properties 文件中.

If you want to disable SPA on a portal wide basis, you can add javascript.single.page.application.enabled=false to your portal-ext.properties file.

这篇关于如何在Liferay 7中禁用SennaJS/SPA?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆