We are designing a search fragment that will reside at the beginning of every form. The search fragment will allow a user to select one customer from a number of customers displayed. Once the user selects a customer, the search fragment will populate the main (parent) form with the customer data and then the search fragment should disappear.
We have a mock-up of the search fragment, but questions are surfacing as to the best way to integrate this into the form. Each form has different "customer data" fields that it needs from the search, for example, one form needs customer name and account while another form only needs customer name.
Here are some questions that are surfacing:
Is there a best practice for doing something like this? Lessons learned?
How is the search fragment going to know what to extract or is there goinng to be the same info everytime? I assume that is what you are doing. Depending on how the data is returned to you will dictate the best pratice. If it is a stream of XML then I woudl load that stream into the datadom and allow each of the fields to get their own data from the Dom (this would minimize the code needed on each form). If you are getting the info back field by field then the hidden field route is th ebest way to go (it is simple and the coding is very simple as well).