from widgect code need to set record producer variable values
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi team , i using the widget on record producer in from that code i'm calling event and in onload script i'm setting the values but not setting thevalues getting java script error at the time of loading the record producer.
How can i resolve the issue giving my widget client controller script and onlaod script coode please help me to resolve the issue .
thanks for your time and support .
html code :
<div class="search-widget">
<div class="form-group search-container">
<input type="text"
class="form-control"
placeholder="Start typing the address..."
ng-model="c.searchText"
ng-change="c.onSearchChange()"
ng-keydown="c.handleKeyDown($event)" />
<!-- Spinner -->
<span class="search-icon" ng-if="c.isLoading">
<i class="fa fa-spinner fa-spin"></i>
</span>
</div>
<!-- Dropdown -->
<ul class="dropdown-list" ng-if="c.locations.length > 0">
<li ng-repeat="loc in c.locations track by $index"
ng-click="c.selectLocation(loc)"
ng-class="{'active': $index === c.selectedIndex}">
<span ng-bind-html="c.highlightMatch(loc.name)"></span>
</li>
</ul>
<!-- No results -->
<div class="no-results" ng-if="c.noResults">
Address not found
</div>
</div>
Client controller script :
Onload client script :
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
the syntax to get and set value of variable from widget is like this
$scope.page.g_form.setValue('variableName', 'value');
var val = $scope.page.g_form.getValue('variableName');
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader