Expand my Community achievements bar.

SOLVED

Form container Action Types

Avatar

Level 5

Hi All,

Want to understand the Form action types provided in core Form container component.  Actions Types of Mail & Store Content functionality have try them. Can anyone let me know functionalities in action types drop-down i.e. Submit & Update order. What those action types does and how to implement ?

rsl_lucky_0-1635494746814.png

 

Thanks in Advance.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi,

Please check following to know more about functioanity behind action type

https://github.com/adobe/aem-core-wcm-components/blob/master/content/src/content/jcr_root/apps/core/...

https://github.com/adobe/aem-core-wcm-components/blob/master/bundles/core/src/main/java/com/adobe/cq...

 

I think, it just add data attribute, you from front end you can handle the action based on type.



Arun Patidar

View solution in original post

7 Replies

Avatar

Correct answer by
Community Advisor

Hi,

Please check following to know more about functioanity behind action type

https://github.com/adobe/aem-core-wcm-components/blob/master/content/src/content/jcr_root/apps/core/...

https://github.com/adobe/aem-core-wcm-components/blob/master/bundles/core/src/main/java/com/adobe/cq...

 

I think, it just add data attribute, you from front end you can handle the action based on type.



Arun Patidar

Avatar

Community Advisor

Hi @rsl_lucky,

Submit order and Update order is related to commerce functionality, sample implementation/usage is available in we-retail site in Review Order page(/content/we-retail/us/en/user/checkout/order)and Checkout Page(/content/we-retail/us/en/user/checkout) respectively.

 

Respective action code is available in 

  • /libs/commerce/components/actions/submitorder
  • /libs/commerce/components/actions/updateorder

Avatar

Level 5

Thanks @Vijayalakshmi_S for the info shared, will check those.

Also can we customize, adding an option in drop-down to call a service that calls a third party service that returns response. Any samples around this would help ?

Avatar

Community Advisor

For creating custom action, we need to create a resource with sling:resourceType set as foundation/components/form/action (to be listed in the action types along with OOTB actions)

You can refer OOTB Store content(/libs/foundation/components/form/actions/store) implementation and copy the same to project specific folder and amend according to your use case.

Vijayalakshmi_S_0-1635782014005.png

  • cq:dialog has fields that comes up when you choose Store content in the action type. Same way, if you need to capture anything from the dialog with respect to your custom action, you can have those fields created here. 
  • post.POST.jsp has the actual logic of form action - In this case, calling third party service. 
  • clientlibs - logic for View data CTA as part of Store action (You can remove or retain based on your need)

Update this thread if you need any other specific inputs.

Avatar

Level 5

Hi Vijayalakshmi_S

Want to understand Store action type functionality existing in dialog of Form Container component. Is there any limit on no. of nodes to be stored or any space limitation of storing nodes on the path ?

My requirement to build a Form with core components available & to submit the information for different use-cases like to store form data onto external DB and to call any service to get response from it. Let me know your thought's across this.

Avatar

Level 5

HI Vijayalakshmi_S

Have created Custom action type in drop down of Form Container component. Now on click of submit need to call custom service/servlet logic. Try call the same in post.POST.jsp file defined under node which was created for custom action type but its not happening. Anything else is required for it to call.

Thanks in Advance.

Avatar

Level 3

Hi @rsl_lucky  I have used the core form container to create a form which needs to call a servlet. I need to how to add a custom actiom type. Can the POST action type be used?. If not how should I create a custom sction type for the same.

 

 

Thank you in advance