问题
Aikau example contains a var button
which configured to show popup with form control. As I know every aikau form has a value, which can be used to prepopulate controls, but how to load value from URL?
E.g. someone push on the button, it load "somehow" data from URL, stores them into Form value and then populate one field on the form.
The key problem is what parameters to use as URL (is it publishPayload.url
?) and what and where a topic should be set for this?
I have tried already example modification and try to add publishPayload.url
and setValueTopic: ALF_CREATE_FORM_DIALOG_REQUEST
, but do not see any HTTP requests with URL. If URL was wrong I can see requests with 500 or 404 codes, but even these requests are not send.
Could somebody provide an example how to do this?
Note
It can be just a piece of code for button and cell with value. What is the data or url it does not matter, URL can be a simple link to some NodeRef with title/name property.
回答1:
As with your last question I would suggest that you work through the Aikau tutorial on GitHub (see https://github.com/Alfresco/Aikau/blob/develop/tutorial/chapters/About.md) I think that you'll find that it has a lot more useful information on Aikau than the official documentation - those examples are taken from old blog posts that were written before Aikau became a standalone project in GitHub. The examples you're looking at a very much out of date and I will try to get them removed from the official documentation.
Aikau works on a publication/subscription model. A button will be configured with a publishTopic and a publishPayload. When clicked the payload will be published on that topic. Services can be provided to subscribe to published topics and provide data.
There are lots of examples of this in both the tutorial previously referenced and in my blog posts on the Alfresco Community platform
来源:https://stackoverflow.com/questions/41010801/could-anyone-provide-aikau-form-example-with-data-loading