Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

help required with submit button

Avatar

Level 4

Hi,

I need a little help with the submit button. The user submits the form as PDf to a servelt using submit button. The form submitted is validated at server side. If there are any errors the error messages are to be displayed to the user as a part of Form.

My approach was to have a hidden field present in the form. Once the error messages are recieved the field is to be populated with these messages and made visible true.

Problem with my approach:

1) How to send back data to the field using the servlet code which we have?

1 Accepted Solution

Avatar

Correct answer by
Level 10

Unless if you use a Webservice, sending data back to form from the Servlet may not possible.

Once the form submits the data to the Servlet, the connection will be lost between the form and Servlet.

But if you use a Webservice, you can trap the response and display it to the user.

Other alternative to Servlet approach is, display a another page in the browser with the response.

So the user after submits will be notified of the result in a new window.

Thanks

Srini 

View solution in original post

2 Replies

Avatar

Correct answer by
Level 10

Unless if you use a Webservice, sending data back to form from the Servlet may not possible.

Once the form submits the data to the Servlet, the connection will be lost between the form and Servlet.

But if you use a Webservice, you can trap the response and display it to the user.

Other alternative to Servlet approach is, display a another page in the browser with the response.

So the user after submits will be notified of the result in a new window.

Thanks

Srini 

Avatar

Level 4

Hi Srini,

Thanks for the answer Srini. That was helpful.

Can you post some code if you have any? Also i would like to know how to display the result returned by the webservice in the PDF.

In my case the result returned is a string and i was hoping to assign it to a hidden field and display that field to the user.