Adding two HTTP Submit Buttons to a single XDP form (OSGi) | Community
Skip to main content
nileshpb
November 8, 2023
Solved

Adding two HTTP Submit Buttons to a single XDP form (OSGi)

  • November 8, 2023
  • 2 replies
  • 686 views

Hi All,

We have a use case where we need to add 'Print' and 'Submit' buttons to an HTML5 form. We are calling a servlet and adding that servlet from the XDP file properties. This servlet will call two different methods based on the click event. For example, if a user clicks on 'Print,' it will call the same servlet with Print method and a separate method for submission.

First of all, could you please let me know if we can add two HTTP Submit Buttons to a single XDP form? If yes, then how can we call the same servlet? Can we call it through an AJAX call?

Alternatively, you can also guide me on how to achieve this use case with better approach.

Best regards

Nilesh

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Vijay_Katoch

One approach will be to expose the Post method servlet as RESTful API, using a swagger file to create data source configuration and create a form data model based on it and integrate it with your form.

 

Take a submit button and Configure the Adaptive Form container submit action as  Submit using the Form Data Model.

Based on passing the data to the post method, you can write your logic for the print/submit button in the servlet.

2 replies

Vijay_Katoch
Community Advisor
Vijay_KatochCommunity AdvisorAccepted solution
Community Advisor
November 8, 2023

One approach will be to expose the Post method servlet as RESTful API, using a swagger file to create data source configuration and create a form data model based on it and integrate it with your form.

 

Take a submit button and Configure the Adaptive Form container submit action as  Submit using the Form Data Model.

Based on passing the data to the post method, you can write your logic for the print/submit button in the servlet.

kautuk_sahni
Community Manager
Community Manager
November 9, 2023

@nileshpb Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.

Kautuk Sahni