- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2017 07:42 AM
Is there any way to retrieve a widget data and create a new Record Producer based on that data.
If someone have a solution please advice me to achieve this.
I want to create a new Record Producer based on this details. (New Record Producer as a Name) and others as Variables.
Regards,
Anna.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2017 01:11 PM
Hi Anna,
It appears you and I have similar requirements. My widget contains a table, with basic functionality like adding rows and inline editing.
The only way i've discovered to pass the data object is create a hidden catalog variable to store the serialized data object.
Widget client script:
$scope.page.g_form.setValue("hidden_widget_value", angular.toJson(c.data.notes));
Then on catalog client script you could do something like :
function onSubmit() {
var data_from_widget = g_form.getValue('hidden_widget_value');
/* parse string to object, then iterate object to insert records into table */
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2023 06:40 AM - edited 04-05-2023 06:40 AM
Hi there,
I think you can use "CustomEvent" as an "event publisher & subscriber" in widget controller & record producer catalog client script, something like:
1. Fire an event In widget controller:
CustomEvent.fireAll('hs-event', c.data.eventGenerated);
2. Listen the event in catalog client script (onLoad type script normally):
CustomEvent.on('my-event', function(newValue) {
g_form.setValue('description', newValue);
});
The events listening or firing can be dual-direction if needed.
Cheers,
Cheng