I am trying to implement a feature in a webmaker application that will allow to look up and dynamically populate some fields for customer info on my form.
The way I have it set up right now is I have a input box to enter customer email address, then a button that will submit that email address to a partial page that will display a list of matching customers with a button next to each one. The intent is that once the user clicks the button next to a particular customer, the form fields on the parent page will be populated with that customer's info.
The tricky part I am having difficulty trying to figure out is the customer can have a list of contact info and each piece of contact info has a contact info type. So I have an editable row rich composite control that has a text box and a select for contact info and contact info type.
How do I dynamically populate this editable table control with the existing customer info?
The way I have it set up right now is I have a input box to enter customer email address, then a button that will submit that email address to a partial page that will display a list of matching customers with a button next to each one. The intent is that once the user clicks the button next to a particular customer, the form fields on the parent page will be populated with that customer's info.
The tricky part I am having difficulty trying to figure out is the customer can have a list of contact info and each piece of contact info has a contact info type. So I have an editable row rich composite control that has a text box and a select for contact info and contact info type.
How do I dynamically populate this editable table control with the existing customer info?
RE: How to dynamically populate editable table?
If I understand what you are trying to do correctly I think the best approach would be to have 2 partial pages.
Keep the email address box on the main page, but move all the selected customer details onto a new partial page.
Your search process would work as you have it, but when they select a customer from the first partial page, this would call the second partial page, passing in the ID of the selected customer. You could then use this to retrieve their details on the server, and render the partial page with all the required customer details in the normal way.
Although this would require another server call I think this would be the better approach, as trying to set a different repeated set of information for each selected contact gets quite tricky on the client side. Also this would allow you to reduce the amount of information you need to retrieve on the initial search process, as you will only need to show the summary information for each match, and only get the full details for the specific contact they select.
I hope this makes sense. Let me know if you have any further questions.
Regards,
Gerard