SP-Object-Suggest in plugin

Which IIQ version are you inquiring about?

Version 8.4

Share all details related to your problem, including any error messages you may have received.

I am loading ManagedAttribute in page.html using sp-object-suggest. I need help in retrieving the value selected by the user to the controller function. How can I do it?

ui:composition

<div class="container" ng-app="assignmentmodler" ng-controller="assignmentmodlerController as ctrl">

                        <div id="maSelector" sp-id="maSelector"></div>
                        <sp-object-suggest id="entObjectSuggest" sp-object-suggest-lookup-id="maSelector"
                            sp-object-suggest-id="maSelector"
                            sp-object-suggest-class="sailpoint.object.ManagedAttribute"
                            sp-object-suggest-context="Global"
                            ng-model="ma"
                            sp-object-suggest-limit="5"
                            sp-object-suggest-label="JIT Entitlement"
                            sp-object-suggest-help-text="search for the JIT entitlement"
                            sp-object-suggest-editable="true"
                            sp-button-aria-label="Managed Attribute Selector"
                            sp-object-suggest-filter='criticality=="JIT"'
                            on></sp-object-suggest>
                        <br/><br/>
                        <button id="getJITConfigButton" type="submit" class="btn btn-info" ng-click="getJITConfig()">Get JIT Configuration</button> 

</ui:composition>

Hello,

I believe with in your page.html, you should also include the AngularJS file, e.g.

<script src="#{plugins.requestContextPath}/plugin/PLUGIN_NAME/ui/js/app.js" />

Then within this app.js you define your controller and corresponding functions, e.g.

/**
 * Create the module.
 */

var appModule = angular.module('assignmentmodler', [
		'sailpoint.i18n', 'sailpoint.comment', 'sailpoint.email', 'sailpoint.esig',
		'sailpoint.identity.account', 'sailpoint.modal',
		'sailpoint.util', 'sailpoint.tree', 'sailpoint.ui.bootstrap.carousel',
		'sailpoint.dataview', 'sailpoint.config']);

/**
 * Controller.
 */
appModule.controller('assignmentmodler', ['$scope', 'spNotificationService', 'spModal',
		function($scope, spNotificationService, spModal) {
		
	$scope.getJITConfig = function () {		
		console.log($scope.ma);
	}
	
}]

);

under this framework, you should be able to access the value with with $scope.{ng-model} with in the app.js. In addition, there are many examples from Kitch Sink Plugin, not sure where is the offical post now, but package can still be found under this post: How to get SailPointBundleLibrary.js working with the FullPageKitchenSink plugin demo.

Best regards,

2 Likes

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.