in Education by
Currently, when I submit a redux-form, and send the data-transfer-object to the backend, there is a backend object that accepts the data and creates an object (I am using Spring Boot Framework in the backend). One example is, if my form contains the following: Name: _____________ Address: _____________ Age: _____________ I have a backend DTO object Person that has these fields: String name; String Address; int age; Spring is smart enough that if I define the request body as a Person Object, that it will take the values entered by the user and create the Object for me to use in my receiving API endpoint. (Again this is just an example). In my real problem, I have to add a new field called LocationCode. As I currently have it designed, users will add all of their location codes as a comma separated list. This is just one field on the UI that is labeled Location Code. So a possible value could be "loc1, location 2, myLocation" and the corresponding backend will have a LocationCode variable to store this string. However I have a new requirement to create a new field for every location code the user wants to input ( The front end is all set). I can create as many of these as I want in the frontend and the user can have Location Code 1 _____________ Location Code 2 _____________ .... Location Code x _____________ My problem is, my backend cant have a random number of fields. Is there some way to take all of these user inputs, and combine them into one string to pass back to the Spring Backend so I can still end up with a comma separated string. This way I can still only have the one field in the backend? JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
You can combine these values of your location codes by using a formValueSelector. One of the uses mentioned is to select multiple fields as a group into a grouped prop. You can use this grouped prop as a single string that can be sent to your backend. Hope this helps!

Related questions

0 votes
    I have multiple tables like make, model and year etc and using joins. I would like to search from ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 26, 2022 in Education by JackTerrance
0 votes
    I have multiple tables like make, model and year etc and using joins. I would like to search from ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 20, 2022 in Education by JackTerrance
0 votes
    I writing a function in my form that require user to upload a file, but doesn't necessary have to ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 2, 2022 in Education by JackTerrance
0 votes
    I'm making a drag and drop game for my A level computing coursework. My drag and drop works fine, but I have 6 ... >= 190 && theButton.Location.X = 42 && theButton.Location.Y...
asked Apr 9, 2022 in Education by JackTerrance
0 votes
    Which of the following tag automatically focus one particular form field in HTML5? A - output B - placeholder C - autofocus D - required...
asked Dec 2, 2020 in Technology by JackTerrance
0 votes
    Which statement about the name and id attributes of form fields is false? 1. It is customary to give form fields both ... . 4. Either attribute may be omitted if it is unused....
asked Feb 26, 2021 in Technology by JackTerrance
0 votes
    Which of the following input control is used for input fields that should contain an URL address in Web Form 2.0? A - email B - url C - number D - range...
asked Dec 2, 2020 in Technology by JackTerrance
0 votes
    Which of the following input control is used for input fields that should contain an e-mail address in Web Form 2.0? A - email B - url C - number D - range...
asked Dec 2, 2020 in Technology by JackTerrance
0 votes
    Which of the following input control is used for input fields that should contain a value from a range of numbers in Web Form 2.0? A - week B - time C - number D - range...
asked Dec 2, 2020 in Technology by JackTerrance
0 votes
    I'm new to Flutter Redux, I got a problem and I have no idea how to deal with it at all! ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 20, 2022 in Education by JackTerrance
0 votes
    I have a grouped style UITableView with a HeaderView that is loaded from another .xib. The HeaderView has 4 ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 26, 2022 in Education by JackTerrance
0 votes
    A _____________ is a collection of multiple data which are stored in related fields that can be treated as a single unit. Select the correct answer from above options...
asked Nov 27, 2021 in Education by JackTerrance
0 votes
    In the circuit given below, C= C1 = C2. The gain of the multiple-feedback band-pass filter is ___________ (a) ... for GATE EC Exam, Network Theory MCQ (Multiple Choice Questions)...
asked Oct 12, 2021 in Education by JackTerrance
0 votes
    What are the benefits of a single-threaded web backend to a multi-threaded one?...
asked Jan 25, 2021 in Technology by JackTerrance
...