06-18-2018 04:17 PM
Hi, I am new to Alfresco. I am developing a process in APS(Alfresco Process Services) for which I designed a form and submit button of this form triggers this process. Now, I used 'adf-start-form' component to display this form on browser using ADF. This template is referenced using #startForm template reference variable. (<adf-start-form #startForm>). Now I want to access a DOM element (button) inside this form. I have tried following approaches:
@ViewChild('startForm',{read: ElementRef})
btn: ElementRef;
ngAfterViewInit() {
console.log(this.btn.nativeElement.querySelector(".class of button").innerText);
}
and
@ViewChild('startForm')
startForm: StartFormComponent;
ngAfterViewInit() {
console.log(this.startForm.outcomesContainer.nativeElement.innerText);
}
But, none of them is working. Could you please suggest how to access a DOM element of the form. Thanks.
06-20-2018 07:59 AM
you can use a custom outcome in the form editor of APS
06-19-2018 02:20 AM
Form component has lot of APIs, the Form Service allows listening to most of the form events including Outcome clicks. Getting buttons in the "jQuery" way is not the right approach
alfresco-ng2-components/form.component.md at master · Alfresco/alfresco-ng2-components · GitHub
alfresco-ng2-components/form.service.md at master · Alfresco/alfresco-ng2-components · GitHub
06-27-2018 03:15 PM
Thanks.
06-19-2018 02:46 AM
Can I ask the reason why you are trying to access to the submit button? so what is the behavior that you want add?
06-19-2018 01:55 PM
I just want to change text on submit button
06-20-2018 07:59 AM
you can use a custom outcome in the form editor of APS
06-27-2018 03:15 PM
It worked. Thanks.
Explore our Alfresco products with the links below. Use labels to filter content by product module.