4 Replies Latest reply on Mar 30, 2009 2:21 AM by Tentu Polinaidu

    How to get portlet name or name space id using java script

    Tentu Polinaidu Newbie

      I am using Liferay portal, JBoss Portlet Bridge and JSF with XHTML extension & Rich faces.

      Portlet Bridge is prepending portal id or namespace to the all JSF components including form at run time like.


      __tnmanagementPortlet_WAR_CSO_INSTANCE_H4gj_ is portlet id
      _viewRoot is view id
      myform is JSF form id

      how can i get the above name sapce or portlet name which is "__tnmanagementPortlet_WAR_CSO_INSTANCE_H4gj_" using java script in the XHTML form so that i can prepend this value to all fileds which are used in java script.

      I tried with below statement.


      It is displaying the object But i need the portlet name as string so that i can append it to my form fileds in java script.

      Could you please let me know any other way to get portlet name or name space using java script in XHTML?.

      My sample script code:

      function selectFirstRadio() {

      var el = document.getElementById("__tnmanagementPortlet_WAR_CSO_INSTANCE_H4gj_:_viewRoot:myform").elements;


      Thank you.
      T P Naidu.