Vista combinada Visión Plana Vista de árbol
Discusiones [ Anterior | Siguiente ]
toggle
Sharana Basavaraj Ballari
Ajaxible porltets
26 de enero de 2009 6:24
Respuesta

Sharana Basavaraj Ballari

Ranking: Regular Member

Mensajes: 139

Fecha de incorporación: 9 de septiembre de 2007

Mensajes recientes

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
26 de enero de 2009 6:38
Respuesta

Tobias Amon

Ranking: Liferay Master

Mensajes: 549

Fecha de incorporación: 8 de agosto de 2007

Mensajes recientes

Hi,

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

kind regards
Tobias
Sharana Basavaraj Ballari
RE: Ajaxible porltets
26 de enero de 2009 7:08
Respuesta

Sharana Basavaraj Ballari

Ranking: Regular Member

Mensajes: 139

Fecha de incorporación: 9 de septiembre de 2007

Mensajes recientes

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
27 de enero de 2009 2:17
Respuesta

Tobias Amon

Ranking: Liferay Master

Mensajes: 549

Fecha de incorporación: 8 de agosto de 2007

Mensajes recientes

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
27 de enero de 2009 8:35
Respuesta

Sharana Basavaraj Ballari

Ranking: Regular Member

Mensajes: 139

Fecha de incorporación: 9 de septiembre de 2007

Mensajes recientes

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
28 de enero de 2009 0:43
Respuesta

Tobias Amon

Ranking: Liferay Master

Mensajes: 549

Fecha de incorporación: 8 de agosto de 2007

Mensajes recientes

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