01-31-2017 08:55 AM
Hello, a quick question about the Topics in Aikau
when I click publish on a simple button it's working perfect
****************
aikau code :
name: "alfresco/buttons/AlfButton",
config: {
publishTopic: "REDRACCOON"
}
results in logs :
Object {type: "PUBLICATION", topic: "REDRACCOON", payload: Object, publisherId: "alfresco_buttons_AlfButton___7b2f8a01-5fd4-473f-8d96-0d50763de145", publisher: Object}
****************
but now let's try in a simple form
****************
aikau code :
name : "alfresco/forms/Form",
config : {
okButtonPublishTopic : "REDRACCOON",
widgets : [ ]
}
results in logs :
Object {type: "PUBLICATION", topic: "0a785910-a2a8-4b51-8988-edf6e9334b390a785910-a2a8-4b51-8988-edf6e9334b39REDRACCOON", payload: Object, publisherId: "uniqName_1_76", publisher: Object
****************
with the bad topic I can't intercept my payload
I'm making this post because I often went trought this without understanding why sometimes the topic is changed like this ?
I remember having the same issue with topic on "_valueChangeOf_" before but can't remember how I fixed and I really would like to get the mechanics
Thank you
01-31-2017 10:58 AM
a random prefix for the scope is generated to be shure that all of your widgets inside your form are saff and together, you can desactivate this option with
scopeFormControls: true
Or better solution rename this random scope with pubSubScope
name : "alfresco/forms/Form",
config : {
pubSubScope : "fixedPrefixScope",
okButtonPublishTopic : "REDRACCOON",
widgets : [ ]
}
01-31-2017 10:51 AM
in the source I found this wich might be the solution,
/** * Indicates that the a new pubSubScope should be generated for this widget so that it's * form controls will be scoped to only communicate with this instance and not "pollute" * any other forms that may also be on the page. * * @instance * @type {boolean} * @default */
scopeFormControls: true,
It's really usefull (without this scope I couldn't use requirementConfig: {initialValue: true} but still don't know how to intercept my topic with a random value
01-31-2017 10:58 AM
a random prefix for the scope is generated to be shure that all of your widgets inside your form are saff and together, you can desactivate this option with
scopeFormControls: true
Or better solution rename this random scope with pubSubScope
name : "alfresco/forms/Form",
config : {
pubSubScope : "fixedPrefixScope",
okButtonPublishTopic : "REDRACCOON",
widgets : [ ]
}
Explore our Alfresco products with the links below. Use labels to filter content by product module.