Foros de discusión

Ajaxible porltets

thumbnail
Sharana Basavaraj BM, modificado hace 15 años.

Ajaxible porltets

Regular Member Mensajes: 139 Fecha de incorporación: 10/09/07 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
thumbnail
Tobias Amon, modificado hace 15 años.

RE: Ajaxible porltets

Liferay Master Mensajes: 546 Fecha de incorporación: 8/08/07 Mensajes recientes
Hi,

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

kind regards
Tobias
thumbnail
Sharana Basavaraj BM, modificado hace 15 años.

RE: Ajaxible porltets

Regular Member Mensajes: 139 Fecha de incorporación: 10/09/07 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
thumbnail
Tobias Amon, modificado hace 15 años.

RE: Ajaxible porltets

Liferay Master Mensajes: 546 Fecha de incorporación: 8/08/07 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
thumbnail
Sharana Basavaraj BM, modificado hace 15 años.

RE: Ajaxable porltets

Regular Member Mensajes: 139 Fecha de incorporación: 10/09/07 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.
thumbnail
Tobias Amon, modificado hace 15 años.

RE: Ajaxable porltets

Liferay Master Mensajes: 546 Fecha de incorporación: 8/08/07 Mensajes recientes
Hi,

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

<liferay-portlet-app>
    <portlet>
        <portlet-name>YOUR_PORTLET_NAME</portlet-name>
        <instanceable>false</instanceable>
        <render-weight>1</render-weight>
        <ajaxable>false</ajaxable>
    </portlet>
</liferay-portlet-app>


The file is located in WEB-INF folder.

kind regards
Tobias