论坛

主页 » Liferay Portal » English » 3. Development

组合视图 统一视图 树状图
讨论主题 [ 上一个 | 下一个 ]
toggle
Sharana Basavaraj Ballari
Ajaxible porltets
2009年1月26日 上午6:24
答复

Sharana Basavaraj Ballari

等级: Regular Member

帖子: 139

加入日期: 2007年9月9日

最近的帖子

Hi Guys,

I want to know how to load ajaxible == true porltets when javascript is disabled in the browser.

As far as my investigation, load_render_portlet is loading the ajax enabled porltets. when javascript is disabled via browser, just I am seeing the progress animation. no portlet loaded on the page.

Can you please let me know how to make these portlets load when javascript is disabled as normal porltes are loading.

For example, If you add news, currency converter portlets to the page, in which they might be doing a webservice call and disable javascript at the browser level and refresh the page. other portlets like admin, journal will load normally on the page. but not these porltets. can you guys le me know what should I do ?

Many thanks,
Sharan
Tobias Amon
RE: Ajaxible porltets
2009年1月26日 上午6:38
答复

Tobias Amon

等级: Liferay Master

帖子: 549

加入日期: 2007年8月8日

最近的帖子

Hi,

the only way is to make them not ajaxable. Ajax is ALWAYS using javascript...

kind regards
Tobias
Sharana Basavaraj Ballari
RE: Ajaxible porltets
2009年1月26日 上午7:08
答复

Sharana Basavaraj Ballari

等级: Regular Member

帖子: 139

加入日期: 2007年9月9日

最近的帖子

Hi Tobias,

thank you very much for your reply.

I understand AJAX always uses javascript. Can you please let me know where this differentiation is made? I mean to say to load Ajaxable and non-ajaxable porltets ?

Also I had a look into Porltet interface, which contains isAjaxable boolean attribute. what I am not getting is, how it has been done so that Ajaxable porltets should load through load_render_porltet.jsp ?

If I try ,

portlet.isAjaxable(false); will it load normally ? if it is yes, where I should do these changes ? because I had a look into

"C:\liferay-portal-src-4.4.2\liferay-portal-src-4.4.2\portal-impl\src\com\liferay\portlet\layoutconfiguration\util\velocity\PortletColumnLogic.java"(121,26):

This class, I feel it as Listener class. Lots of confusion around here for me.

Sorry to ask so many questions.

Many Thanks,
Sharan
Tobias Amon
RE: Ajaxible porltets
2009年1月27日 上午2:17
答复

Tobias Amon

等级: Liferay Master

帖子: 549

加入日期: 2007年8月8日

最近的帖子

Hi,

I do not know the difference in detail but what I can say is that when a portlet is not ajaxable, it is rendered together with the page, which means that if the portlet takes a long time to get it's data from a DB the whole page is taking long to load. But having it ajaxable, the page is being loaded directly and the content of the portlet is retrieved using ajax and added to the page after having received the portlet content.

You can set the value in liferay-portlet.xml and add it to any <portlet> definition

kind regards
Tobias
Sharana Basavaraj Ballari
RE: Ajaxable porltets
2009年1月27日 上午8:35
答复

Sharana Basavaraj Ballari

等级: Regular Member

帖子: 139

加入日期: 2007年9月9日

最近的帖子

Thank you Tobias,

I have some porltets which calls web services. I made them as ajaxible. so that till I get the response I'll be having a animated progress gif (out of the box functionality) in place of a portlet.

When I disable javascript, porltets will not load. only non-ajaxable portlets will load.

How make ajaxable portlets as non-ajaxable when javascript is disabled.

After some investigation I found that render-portlet.jsp will load the non-ajaxable portlets and load_render_porltet.jsp will load the ajaxable portlets. load_render_porltet.jsp will be called in the "PortletColumnLogic.java"

can I do something, when javascript is disabled render_porltet.jsp should load all the portlets, including ajaxable porltets? If so what should I follow.

Please help me to get a solution for this.
Tobias Amon
RE: Ajaxable porltets
2009年1月28日 上午12:43
答复

Tobias Amon

等级: Liferay Master

帖子: 549

加入日期: 2007年8月8日

最近的帖子

Hi,

as I said... in your liferay-portlet.xml file add a tag called "ajaxable". The definition may look like this:

1<liferay-portlet-app>
2    <portlet>
3        <portlet-name>YOUR_PORTLET_NAME</portlet-name>
4        <instanceable>false</instanceable>
5        <render-weight>1</render-weight>
6        <ajaxable>false</ajaxable>
7    </portlet>
8</liferay-portlet-app>


The file is located in WEB-INF folder.

kind regards
Tobias