I am looking for a very simple solution model example that will dynamically create a list view of a table. I am trying to create a very simple table editor where the only inputs are the database name and the table name. I looked at the solution model sample solution and I’m sure the answer to my question is in there somewhere. Unfortunately, there is so much more functionality that I don’t need that it is obscuring the basic process of constructing the list view form. As I understand it the steps should be
- Check to see if the form exists using solutionModel.getForm(‘theForm’) If yes:
A. theForm.visible = false;
B. history.removeForm(theForm)
C. solutionModel.removeForm(theForm) - Create the new list view form using the solutionModel.newForm()
- Get a listing of the datasources in the table
- Use a loop and solutionModel.cloneComponent() to copy components from a template form for each field in the table?
A. I’m a little fuzzy here on whether this is necessary or if I can just create the field directly using the solution model - Add a tab to a tabpanel on an existing static form to display the new form. I really don’t need the parent form to be dynamic
(just need to be able to display the listview form just created in the tabpanel).
I’ve tried the above steps in various combinations and I’ve looked at the code examples and the sample solutions. Just can’t seem to put 2&2 together though (I’ve succeeded in creating forms but I also get various runtime errors).
Any help to get me on my way would be greatly appreciated.