This has come to us as an enhancement. Since putting a lot of portlets on one page, results in slower loading of pages, we want to restrict the number of portlets on one page to four at max. I feel some validation should be done while clicking on Add portlets. But not sure how to achieve this.
You can do this on the Administrator controlled (Shared Dashboard) portlets, but there's no way currently for the User Controlled (Private Dashboard) to do this. This also relates to the current known issue, to restrict what filters users can use or how setup a pre-defined filter values based on the users, which is also not available. Hopefully in future versions HP comes up with something like Shared-cum-Private Administrator Controlled Dashboard concept where both the things can be achieved, i.e. admin can control and set various restrictions on the dashboards/portlets but users can modify filters, etc. too, to certain extent or upto the rights given to them.
How do you restrict the number for Administrator controlled shared dashboard pages?
When I right clicked on a dashboard page (private) and clicked on View Source, I found a function - handleAddButton that restricts the number of portlets. But the limiting number was a variable set on the page level. Now all I was wondering was from where does the variable take the value as null or a number. Please see if you can check this.
From the Administrator controlled dashboards, the admin basically will control or say decide how many portlets needs to be added on each page. So only that control is available. But for Private Pages there's no control available currently. The customization you are looking for may be deep down anywhere in .js or .jsp or .class or in database or at combined locations and again, modifying these files may lead to modifying them with every SP or version upgrades.