title: How to programatically add liferay portlet Instance dynamically and install the portlet to the to dashboard page on click of a button?
body: <p>I have a liferay portlet instance created dynamically and added to the layout programatically as follows</p>
  
  <pre><code>String portletId = objUtil.addPortlet("/prj/reports", "XYZPortlet_WAR_ecpmportlet", "column-2",groupId, "type: " + getSelectedType());
  </code></pre>
  
  <p>So it adds a portlet to the <code>/reports</code> page.<br>
  I want to add a button below the portlet called <kbd>send to dashboard</kbd> on clicking the button I want to install this portlet to the user dashboard permanently.</p>
  
  <p><em><strong>Note:</em></strong> There can any number of portlet instances added to the <code>/report</code>s page.</p>
  
  <p>As you see XYZPortlet is the id of the portlet defined in liferay-portlet.xml, liferay-display.xml which remains same for all the portlets I add to the reports page.</p>
  
  <p>I want to dynamically assign a new Id to the portlet instance and install it permanently to the dashboard layout.</p>
  
  <p>Can anyone please suggest a way to do this?</p>
  
  <p>Thanks</p>