<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Servicenow portal widget customization in Developer forum</title>
    <link>https://www.servicenow.com/community/developer-forum/servicenow-portal-widget-customization/m-p/3126870#M1165013</link>
    <description>&lt;P&gt;I want to create a widget which will show me the tiles of active incident and closed incident ,i saw post in community that create tab with the same functioanlity but my frontend is different i am not able to call the widget from the html part&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My html:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;lt;sp-panel&amp;gt;&lt;BR /&gt;&amp;lt;!-- Tile Container --&amp;gt;&lt;BR /&gt;&amp;lt;div class="tile-container"&amp;gt;&lt;BR /&gt;&lt;BR /&gt;&amp;lt;!-- Active Requests Tile --&amp;gt;&lt;BR /&gt;&amp;lt;div class="tile" ng-click="toggleView('active')" ng-class="{'active-tile': currentView === 'active'}"&amp;gt;&lt;BR /&gt;&amp;lt;h3&amp;gt;Active Requests&amp;lt;/h3&amp;gt;&lt;BR /&gt;&amp;lt;p&amp;gt;View all active requests that you opened or that were opened on your behalf.&amp;lt;/p&amp;gt;&lt;BR /&gt;&amp;lt;/div&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;!-- Closed Requests Tile --&amp;gt;&lt;BR /&gt;&amp;lt;div class="tile" ng-click="toggleView('closed')" ng-class="{'active-tile': currentView === 'closed'}"&amp;gt;&lt;BR /&gt;&amp;lt;h3&amp;gt;Closed Requests&amp;lt;/h3&amp;gt;&lt;BR /&gt;&amp;lt;p&amp;gt;View all closed requests that you opened or that were opened on your behalf.&amp;lt;/p&amp;gt;&lt;BR /&gt;&amp;lt;/div&amp;gt;&lt;BR /&gt;&lt;BR /&gt;&amp;lt;/div&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;!-- Display content based on the selected view --&amp;gt;&lt;BR /&gt;&amp;lt;div class="widget-content" ng-if="currentView === 'active'"&amp;gt;&lt;BR /&gt;&amp;lt;sp-widget widget="data.all_active"&amp;gt;&amp;lt;/sp-widget&amp;gt;&lt;BR /&gt;&amp;lt;/div&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;div class="widget-content" ng-if="currentView === 'closed'"&amp;gt;&lt;BR /&gt;&amp;lt;sp-widget widget="data.all_closed"&amp;gt;&amp;lt;/sp-widget&amp;gt;&lt;BR /&gt;&amp;lt;/div&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/sp-panel&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;on click of different tiles different widget or different list will &lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="community.PNG" style="width: 999px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/407521i7E703BA1B87C5399/image-size/large?v=v2&amp;amp;px=999" role="button" title="community.PNG" alt="community.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 13 Dec 2024 05:44:13 GMT</pubDate>
    <dc:creator>abhi56</dc:creator>
    <dc:date>2024-12-13T05:44:13Z</dc:date>
    <item>
      <title>Servicenow portal widget customization</title>
      <link>https://www.servicenow.com/community/developer-forum/servicenow-portal-widget-customization/m-p/3126870#M1165013</link>
      <description>&lt;P&gt;I want to create a widget which will show me the tiles of active incident and closed incident ,i saw post in community that create tab with the same functioanlity but my frontend is different i am not able to call the widget from the html part&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My html:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;lt;sp-panel&amp;gt;&lt;BR /&gt;&amp;lt;!-- Tile Container --&amp;gt;&lt;BR /&gt;&amp;lt;div class="tile-container"&amp;gt;&lt;BR /&gt;&lt;BR /&gt;&amp;lt;!-- Active Requests Tile --&amp;gt;&lt;BR /&gt;&amp;lt;div class="tile" ng-click="toggleView('active')" ng-class="{'active-tile': currentView === 'active'}"&amp;gt;&lt;BR /&gt;&amp;lt;h3&amp;gt;Active Requests&amp;lt;/h3&amp;gt;&lt;BR /&gt;&amp;lt;p&amp;gt;View all active requests that you opened or that were opened on your behalf.&amp;lt;/p&amp;gt;&lt;BR /&gt;&amp;lt;/div&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;!-- Closed Requests Tile --&amp;gt;&lt;BR /&gt;&amp;lt;div class="tile" ng-click="toggleView('closed')" ng-class="{'active-tile': currentView === 'closed'}"&amp;gt;&lt;BR /&gt;&amp;lt;h3&amp;gt;Closed Requests&amp;lt;/h3&amp;gt;&lt;BR /&gt;&amp;lt;p&amp;gt;View all closed requests that you opened or that were opened on your behalf.&amp;lt;/p&amp;gt;&lt;BR /&gt;&amp;lt;/div&amp;gt;&lt;BR /&gt;&lt;BR /&gt;&amp;lt;/div&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;!-- Display content based on the selected view --&amp;gt;&lt;BR /&gt;&amp;lt;div class="widget-content" ng-if="currentView === 'active'"&amp;gt;&lt;BR /&gt;&amp;lt;sp-widget widget="data.all_active"&amp;gt;&amp;lt;/sp-widget&amp;gt;&lt;BR /&gt;&amp;lt;/div&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;div class="widget-content" ng-if="currentView === 'closed'"&amp;gt;&lt;BR /&gt;&amp;lt;sp-widget widget="data.all_closed"&amp;gt;&amp;lt;/sp-widget&amp;gt;&lt;BR /&gt;&amp;lt;/div&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/sp-panel&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;on click of different tiles different widget or different list will &lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="community.PNG" style="width: 999px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/407521i7E703BA1B87C5399/image-size/large?v=v2&amp;amp;px=999" role="button" title="community.PNG" alt="community.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Dec 2024 05:44:13 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/servicenow-portal-widget-customization/m-p/3126870#M1165013</guid>
      <dc:creator>abhi56</dc:creator>
      <dc:date>2024-12-13T05:44:13Z</dc:date>
    </item>
    <item>
      <title>Re: Servicenow portal widget customization</title>
      <link>https://www.servicenow.com/community/developer-forum/servicenow-portal-widget-customization/m-p/3126879#M1165017</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/248543"&gt;@abhi56&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ensure that the widget references in your &amp;lt;sp-widget&amp;gt; tags match the objects in your server script's data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;lt;sp-panel&amp;gt;&lt;BR /&gt;&amp;lt;!-- Tile Container --&amp;gt;&lt;BR /&gt;&amp;lt;div class="tile-container"&amp;gt;&lt;BR /&gt;&amp;lt;!-- Active Requests Tile --&amp;gt;&lt;BR /&gt;&amp;lt;div class="tile" ng-click="toggleView('active')" ng-class="{'active-tile': currentView === 'active'}"&amp;gt;&lt;BR /&gt;&amp;lt;h3&amp;gt;Active Requests&amp;lt;/h3&amp;gt;&lt;BR /&gt;&amp;lt;p&amp;gt;View all active requests that you opened or that were opened on your behalf.&amp;lt;/p&amp;gt;&lt;BR /&gt;&amp;lt;/div&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;lt;!-- Closed Requests Tile --&amp;gt;&lt;BR /&gt;&amp;lt;div class="tile" ng-click="toggleView('closed')" ng-class="{'active-tile': currentView === 'closed'}"&amp;gt;&lt;BR /&gt;&amp;lt;h3&amp;gt;Closed Requests&amp;lt;/h3&amp;gt;&lt;BR /&gt;&amp;lt;p&amp;gt;View all closed requests that you opened or that were opened on your behalf.&amp;lt;/p&amp;gt;&lt;BR /&gt;&amp;lt;/div&amp;gt;&lt;BR /&gt;&amp;lt;/div&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;lt;!-- Display content based on the selected view --&amp;gt;&lt;BR /&gt;&amp;lt;div class="widget-content" ng-if="currentView === 'active'"&amp;gt;&lt;BR /&gt;&amp;lt;!-- Ensure 'data.active_widget' is properly configured in your server script --&amp;gt;&lt;BR /&gt;&amp;lt;sp-widget widget="data.active_widget"&amp;gt;&amp;lt;/sp-widget&amp;gt;&lt;BR /&gt;&amp;lt;/div&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;lt;div class="widget-content" ng-if="currentView === 'closed'"&amp;gt;&lt;BR /&gt;&amp;lt;!-- Ensure 'data.closed_widget' is properly configured in your server script --&amp;gt;&lt;BR /&gt;&amp;lt;sp-widget widget="data.closed_widget"&amp;gt;&amp;lt;/sp-widget&amp;gt;&lt;BR /&gt;&amp;lt;/div&amp;gt;&lt;BR /&gt;&amp;lt;/sp-panel&amp;gt;&lt;BR /&gt;&lt;BR /&gt;and&amp;nbsp;Add a corresponding client controller to manage the currentView variable and handle view toggling:&lt;/P&gt;
&lt;P&gt;function($scope) {&lt;BR /&gt;$scope.currentView = 'active'; // Default view&lt;/P&gt;
&lt;P&gt;$scope.toggleView = function(view) {&lt;BR /&gt;$scope.currentView = view;&lt;BR /&gt;};&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and&amp;nbsp;Define the widgets in your server script to match the widget attribute in your HTML. For example:&lt;/P&gt;
&lt;P&gt;(function() {&lt;BR /&gt;data.active_widget = $sp.getWidget('widget_id_for_active_incidents', {&lt;BR /&gt;// Pass any additional parameters if needed&lt;BR /&gt;});&lt;/P&gt;
&lt;P&gt;data.closed_widget = $sp.getWidget('widget_id_for_closed_incidents', {&lt;BR /&gt;// Pass any additional parameters if needed&lt;BR /&gt;});&lt;BR /&gt;})();&lt;BR /&gt;&lt;BR /&gt;The above data is from the recent question asked on Community&lt;/P&gt;</description>
      <pubDate>Fri, 13 Dec 2024 05:50:35 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/servicenow-portal-widget-customization/m-p/3126879#M1165017</guid>
      <dc:creator>Ravi Gaurav</dc:creator>
      <dc:date>2024-12-13T05:50:35Z</dc:date>
    </item>
  </channel>
</rss>

