
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2020 02:13 PM
In the Idea Portal widget IM Create/Edit I added a field called u_epic. However, I cannot get a default value to populate on the form.
I tried to set the value and displayValue in the code shown below that can be found under $scope.data.formModel object. No text shows up in the form field (using 'Test' below just as example)
u_epic: {
label: $scope.data.messages.formLabels.u_epic,
name: $scope.data.messages.formLabels.u_epic,
stagedValue: ($scope.data.ideaInfo && $scope.data.ideaInfo.u_epic) || '',
value: 'Test',
displayValue: 'Test',
type: 'html',
mandatory: true,
mandatory_filled: function () {
return !!($scope.data.formModel._fields.u_epic.stagedValue);
},
isMandatory: function () {
return true;
}
}
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2020 09:05 AM
So looks like your HTML tinyMce editor is bound to the stagedValue.
Can you replace the staged value line in your client controller's u_epic's definition with:
stagedValue: ($scope.data.ideaInfo && $scope.data.ideaInfo.u_epic) || 'Test',
Thanks & Regards,
Rishabh Jha
Aavenir (http://www.aavenir.com/)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2020 11:32 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2020 12:01 PM
Hi,
I don't see any event handlers for form load on your client controller. You can try to create an onLoad client script, and in that script, set the value using: g_form.setValue('u_epic', 'your default_value');
If you don't want to create a client script, you'd need to look for the event that gets emitted/broadcasted at form load, and try to set the value there, using the same g_form.setValue method.
Otherwise, in your client controller, try replacing your $scope.getGlideForm function with the below snippet, and see if that works.
$scope.getGlideForm = function () {
$timeout(function () {
g_form.setValue('u_epic', 'Test');
g_form.setDisplayValue('u_epic', 'Test');
});
return g_form;
};
Thanks & Regards,
Rishabh Jha
Aavenir (http://www.aavenir.com/)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2020 01:29 PM
Adding the code above to the existing widget client controller didn't work.
How do I add an on load client script for a portal. I know how to do it for a regular form but not sure on the idea portal.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2020 01:37 PM
Client script are defined on a table. You'd need to select the table where your ideas are stored, and where you have this new field getting added to.
Make sure you select the UI Type as "All" on the client script, and the type as "onLoad".
Thanks & Regards,
Rishabh Jha
Aavenir (http://www.aavenir.com/)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2020 02:17 PM