Skip to content

Last Login Tag

March 31, 2008

Three methods in liferay –

* page html load,
* each portlet load
* complete page load

/* This function gets loaded when all the HTML, not including the portlets, is loaded. */

function() { LiferayJedi.init(); } );

/* This function gets loaded after each and every portlet on the page. portletId:
the current portlet’s id jQueryObj: the jQuery wrapped object of the current portlet
*/ function(portletId, jQueryObj) { } );

/* This function gets loaded when everything, including the portlets, is on the page. */ function() { } );

To REFRESH Portlet after a given frequency:

CODE to – update the last login time. used with JOURNAL CONTENT PORTLET.
3 dom api used getElementById , createTextNode, appendChild

var datasend = ‘group=’ + themeDisplay.getUserId();
var lastLogin=”;
url: “/html/common/test.jsp”,
data:datasend ,
type: “POST”,
success: function(data)
lastLogin = data;
alert (lastLogin);
txt = document.createTextNode(lastLogin);

// not working? –>> jQuery(‘updatedLogin’).append(lastLogin);
//end of s-ready


Issues:1. group was not being used in the page
got the userid from the themedisplay js element
from userid used UserLocalService and got the User object
then -> method did not work so used jquery.ajax instead.
Now – issue of appending the text to the div element.- used normal dom api of getElementById and createTextNode and appendChild.

No comments yet

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: