Aikau textbox not being populated by subscription topic

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-07-2020 01:08 AM
I'm working on an Aikau page for Alfresco Share containing a custom widget on one side and an Aikau form on the other.
I would like one of the form inputs to be populated by data obtained from clicking a button in the custom widget, so I declared my input with valueSubscriptionTopic like this:
var dateOfReportTextBox = {
name: "alfresco/forms/controls/TextBox",
config: {
fieldId: "DATE_OF_REPORT",
name: "cm:date-of-report",
label: "Date of Report",
placeHolder: "date",
requirementConfig: {
initialValue: false
},
valueSubscriptionTopic: "SET_DATE_OF_REPORT"
}
};
In my custom widget code I attached an event handler to the button containing this line:
this.alfPublish("SET_DATE_OF_REPORT", "Testing", true); // true for global scope
But the input is not being populated. I verified that "this" refers to the custom widget. Am I misunderstanding the usage of valueSubscriptionTopic?
- Labels:
-
Alfresco Content Services
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2020 05:24 PM
The payload of the publish should be an object with a value property, not a simple string. If you enable Aikau logging, you'll likely see a message stating "Attempt made to set form control value by subscription with an inapproriate payload"
