- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-19-2022 02:16 PM
I want to add button on service catalog form ---> "Reset", which will clear all variables values.
Solved! Go to Solution.
- Labels:
-
User Interface (UI)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-19-2022 02:56 PM
Hello
you can create a custom type variable and tag your widget in that variable which will render the button on the catalog form
please try below code in the widget
Html:
<button type="button" class="btn btn-danger btn-block" ng-click="c.clearValue()">Reset Values</button>
Client controller:
api.controller=function($scope) {
/* widget controller */
var c = this;
c.clearValue = function() {
alert('test');
var g_form = $scope.page.g_form;
var allFields = g_form.getFieldNames();
alert(allFields);
for(var fieldName in allFields){
g_form.setValue(allFields[fieldName],'');
}
};
};
Please try this and if it works please mark my answer as correct
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-19-2022 02:56 PM
Hello
you can create a custom type variable and tag your widget in that variable which will render the button on the catalog form
please try below code in the widget
Html:
<button type="button" class="btn btn-danger btn-block" ng-click="c.clearValue()">Reset Values</button>
Client controller:
api.controller=function($scope) {
/* widget controller */
var c = this;
c.clearValue = function() {
alert('test');
var g_form = $scope.page.g_form;
var allFields = g_form.getFieldNames();
alert(allFields);
for(var fieldName in allFields){
g_form.setValue(allFields[fieldName],'');
}
};
};
Please try this and if it works please mark my answer as correct
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-26-2023 05:27 AM
this is worked for me thanks, Possible to add condition from filter to exclude few fields.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-19-2022 03:18 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-19-2022 03:45 PM
Hi Mohit
button is showing but its not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-19-2022 03:46 PM
Can you share your widget code?